diff options
Diffstat (limited to 'packages')
48 files changed, 1235 insertions, 328 deletions
diff --git a/packages/anki/.mtn2git_empty b/packages/anki/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/packages/anki/.mtn2git_empty diff --git a/packages/anki/anki.inc b/packages/anki/anki.inc new file mode 100644 index 0000000000..e9a71c286b --- /dev/null +++ b/packages/anki/anki.inc @@ -0,0 +1,15 @@ +DESCRIPTION = "Anki is a program designed to help you remember facts \ +(such as words and phrases in a foreign language) \ +as easily, quickly and efficiently as possible" +HOMEPAGE = "http://ichi2.net/anki/" +AUTHOR = "Damien Elmes" +PRIORITY = "optional" +LICENSE = "GPLv2" +RDEPENDS = "python-pyqt" +RRECOMMENDS = "kakasi virtual/japanese-font" + +SRC_URI = "http://ichi2.net/anki/download/anki-${PV}.tgz" + +inherit setuptools + +PACKAGE_ARCH = "all" diff --git a/packages/anki/anki_0.4.3.bb b/packages/anki/anki_0.4.3.bb new file mode 100644 index 0000000000..5d0c8fabe7 --- /dev/null +++ b/packages/anki/anki_0.4.3.bb @@ -0,0 +1,9 @@ +require anki.inc + +RDEPENDS += "libanki" +PR = "r0" + +export PV + +SRC_URI += "file://no-need-for-pyqt-at-buildtime.patch;patch=1" +S = "${WORKDIR}/anki-${PV}" diff --git a/packages/anki/files/.mtn2git_empty b/packages/anki/files/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/packages/anki/files/.mtn2git_empty diff --git a/packages/anki/files/no-need-for-pyqt-at-buildtime.patch b/packages/anki/files/no-need-for-pyqt-at-buildtime.patch new file mode 100644 index 0000000000..56cfec4999 --- /dev/null +++ b/packages/anki/files/no-need-for-pyqt-at-buildtime.patch @@ -0,0 +1,28 @@ +# +# (C) Michael 'Mickey' Lauer <mlauer@vanille-media.de> +# +Index: anki-0.4.3/setup.py +=================================================================== +--- anki-0.4.3.orig/setup.py 2008-02-12 19:17:56.000000000 +0000 ++++ anki-0.4.3/setup.py 2008-02-12 19:19:29.000000000 +0000 +@@ -3,10 +3,8 @@ + from setuptools import setup, find_packages + import sys, os + +-import ankiqt +- + setup(name='ankiqt', +- version=ankiqt.appVersion, ++ version=os.environ["PV"], + description='An intelligent spaced-repetition memory training program', + long_description="", + # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers +@@ -24,7 +22,7 @@ + license='GPLv2', + packages=find_packages(), + include_package_data=True, +- install_requires = 'anki >= ' + ankiqt.appVersion, ++ install_requires = 'anki >= ' + os.environ["PV"], + zip_safe=False, + package_data={'ankiqt': + ['locale/*/*/*']}, diff --git a/packages/anki/libanki_0.4.3.bb b/packages/anki/libanki_0.4.3.bb new file mode 100644 index 0000000000..ac33833790 --- /dev/null +++ b/packages/anki/libanki_0.4.3.bb @@ -0,0 +1,5 @@ +require anki.inc + +PR = "r0" + +S = "${WORKDIR}/anki-${PV}/libanki" diff --git a/packages/gpe-login/files/gpe-xcalibrate-rises-from-dead.patch b/packages/gpe-login/files/gpe-xcalibrate-rises-from-dead.patch index afad073acf..d1745f0897 100644 --- a/packages/gpe-login/files/gpe-xcalibrate-rises-from-dead.patch +++ b/packages/gpe-login/files/gpe-xcalibrate-rises-from-dead.patch @@ -1,3 +1,5 @@ +upstream: http://bugs.linuxtogo.org/show_bug.cgi?id=124 + diff -r 976c01632fea gpe-login.keylaunchrc --- a/gpe-login.keylaunchrc Sun Nov 25 22:39:23 2007 +0200 +++ b/gpe-login.keylaunchrc Mon Nov 26 01:12:14 2007 +0200 diff --git a/packages/gpe-login/files/lock-on-supend.patch b/packages/gpe-login/files/lock-on-supend.patch index 2aeb20f1ea..29ccce5ae6 100644 --- a/packages/gpe-login/files/lock-on-supend.patch +++ b/packages/gpe-login/files/lock-on-supend.patch @@ -1,3 +1,5 @@ +upstream: http://bugs.linuxtogo.org/show_bug.cgi?id=125 + Lock screen when device goes to suspend, not after some time has passed since resume and they stole your data from the unprotected screen. diff --git a/packages/gpe-login/files/size-autolock-properly.patch b/packages/gpe-login/files/size-autolock-properly.patch index b8e2cd6f4f..cf2978f34d 100644 --- a/packages/gpe-login/files/size-autolock-properly.patch +++ b/packages/gpe-login/files/size-autolock-properly.patch @@ -1,3 +1,5 @@ +upstream: http://bugs.linuxtogo.org/show_bug.cgi?id=152 + # HG changeset patch # User "Paul Sokolovsky <pfalcon@users.sourceforge.net>" # Date 1196345352 -7200 diff --git a/packages/keylaunch/files/unbreak-keyevents.patch b/packages/keylaunch/files/unbreak-keyevents.patch index 0a2d58b16a..ee13cc9a63 100644 --- a/packages/keylaunch/files/unbreak-keyevents.patch +++ b/packages/keylaunch/files/unbreak-keyevents.patch @@ -1,3 +1,5 @@ +upstream: http://bugs.linuxtogo.org/show_bug.cgi?id=123 + # HG changeset patch # User "Paul Sokolovsky <pfalcon@users.sourceforge.net>" # Date 1196027570 -7200 diff --git a/packages/libpcap/libpcap.inc b/packages/libpcap/libpcap.inc new file mode 100644 index 0000000000..f2e5d3072b --- /dev/null +++ b/packages/libpcap/libpcap.inc @@ -0,0 +1,33 @@ +DESCRIPTION = "Network Packet Capture Library" +HOMEPAGE = "http://www.tcpdump.org/" +SECTION = "libs/network" +LICENSE = "BSD" +DEPENDS = "flex-native bison-native" + +# Don't forget to edit shared.patch to have the correct version number inside +SRC_URI = "http://www.tcpdump.org/release/libpcap-${PV}.tar.gz \ + file://shared.patch;patch=1" + +inherit autotools + +EXTRA_OECONF = "--with-pcap=linux" + +CPPFLAGS_prepend = "-I${S} " +CFLAGS_prepend = "-I${S} " +CXXFLAGS_prepend = "-I${S} " + +do_configure_prepend () { + if [ ! -e acinclude.m4 ]; then + cat aclocal.m4 > acinclude.m4 + fi +} + +do_stage () { + install -m 0644 pcap.h ${STAGING_INCDIR}/pcap.h + install -m 0644 pcap-namedb.h ${STAGING_INCDIR}/pcap-namedb.h + install -m 0644 pcap-bpf.h ${STAGING_INCDIR}/pcap-bpf.h + oe_libinstall -a -so libpcap ${STAGING_LIBDIR} + install -d ${STAGING_INCDIR}/net + ln -sf ${STAGING_INCDIR}/pcap-bpf.h ${STAGING_INCDIR}/net/bpf.h + install -m 0644 acinclude.m4 ${STAGING_DATADIR}/aclocal/libpcap.m4 +} diff --git a/packages/libpcap/libpcap_0.9.3.bb b/packages/libpcap/libpcap_0.9.3.bb index 5d66687482..865e57ab93 100644 --- a/packages/libpcap/libpcap_0.9.3.bb +++ b/packages/libpcap/libpcap_0.9.3.bb @@ -1,32 +1,3 @@ -DESCRIPTION = "Network Packet Capture Library" -HOMEPAGE = "http://www.tcpdump.org/" -LICENSE = "BSD" -SECTION = "libs/network" -PR = "r1" +require libpcap.inc -SRC_URI = "http://www.tcpdump.org/release/libpcap-${PV}.tar.gz \ - file://shared.patch;patch=1" - -inherit autotools - -EXTRA_OECONF = "--with-pcap=linux" - -CPPFLAGS_prepend = "-I${S} " -CFLAGS_prepend = "-I${S} " -CXXFLAGS_prepend = "-I${S} " - -do_configure_prepend () { - if [ ! -e acinclude.m4 ]; then - cat aclocal.m4 > acinclude.m4 - fi -} - -do_stage () { - install -m 0644 pcap.h ${STAGING_INCDIR}/pcap.h - install -m 0644 pcap-namedb.h ${STAGING_INCDIR}/pcap-namedb.h - install -m 0644 pcap-bpf.h ${STAGING_INCDIR}/pcap-bpf.h - oe_libinstall -a -so libpcap ${STAGING_LIBDIR} - install -d ${STAGING_INCDIR}/net - ln -sf ${STAGING_INCDIR}/pcap-bpf.h ${STAGING_INCDIR}/net/bpf.h - install -m 0644 acinclude.m4 ${STAGING_DATADIR}/aclocal/libpcap.m4 -} +PR = "r2" diff --git a/packages/libpcap/libpcap_0.9.5.bb b/packages/libpcap/libpcap_0.9.5.bb index 5d66687482..865e57ab93 100644 --- a/packages/libpcap/libpcap_0.9.5.bb +++ b/packages/libpcap/libpcap_0.9.5.bb @@ -1,32 +1,3 @@ -DESCRIPTION = "Network Packet Capture Library" -HOMEPAGE = "http://www.tcpdump.org/" -LICENSE = "BSD" -SECTION = "libs/network" -PR = "r1" +require libpcap.inc -SRC_URI = "http://www.tcpdump.org/release/libpcap-${PV}.tar.gz \ - file://shared.patch;patch=1" - -inherit autotools - -EXTRA_OECONF = "--with-pcap=linux" - -CPPFLAGS_prepend = "-I${S} " -CFLAGS_prepend = "-I${S} " -CXXFLAGS_prepend = "-I${S} " - -do_configure_prepend () { - if [ ! -e acinclude.m4 ]; then - cat aclocal.m4 > acinclude.m4 - fi -} - -do_stage () { - install -m 0644 pcap.h ${STAGING_INCDIR}/pcap.h - install -m 0644 pcap-namedb.h ${STAGING_INCDIR}/pcap-namedb.h - install -m 0644 pcap-bpf.h ${STAGING_INCDIR}/pcap-bpf.h - oe_libinstall -a -so libpcap ${STAGING_LIBDIR} - install -d ${STAGING_INCDIR}/net - ln -sf ${STAGING_INCDIR}/pcap-bpf.h ${STAGING_INCDIR}/net/bpf.h - install -m 0644 acinclude.m4 ${STAGING_DATADIR}/aclocal/libpcap.m4 -} +PR = "r2" diff --git a/packages/libpcap/libpcap_0.9.6.bb b/packages/libpcap/libpcap_0.9.6.bb index 9822f38ada..865e57ab93 100644 --- a/packages/libpcap/libpcap_0.9.6.bb +++ b/packages/libpcap/libpcap_0.9.6.bb @@ -1,36 +1,3 @@ -# Copyright (C) 2007, Stelios Koroneos - Digital OPSiS, All Rights Reserved -# Released under the MIT license (see packages/COPYING) -DESCRIPTION = "Network Packet Capture Library" -HOMEPAGE = "http://www.tcpdump.org/" -LICENSE = "BSD" -SECTION = "libs/network" -PR = "r1" +require libpcap.inc - -# Don't forget to edit shared.patch to have the correct version number inside -SRC_URI = "http://www.tcpdump.org/release/libpcap-${PV}.tar.gz \ - file://shared.patch;patch=1" - -inherit autotools - -EXTRA_OECONF = "--with-pcap=linux" - -CPPFLAGS_prepend = "-I${S} " -CFLAGS_prepend = "-I${S} " -CXXFLAGS_prepend = "-I${S} " - -do_configure_prepend () { - if [ ! -e acinclude.m4 ]; then - cat aclocal.m4 > acinclude.m4 - fi -} - -do_stage () { - install -m 0644 pcap.h ${STAGING_INCDIR}/pcap.h - install -m 0644 pcap-namedb.h ${STAGING_INCDIR}/pcap-namedb.h - install -m 0644 pcap-bpf.h ${STAGING_INCDIR}/pcap-bpf.h - oe_libinstall -a -so libpcap ${STAGING_LIBDIR} - install -d ${STAGING_INCDIR}/net - ln -sf ${STAGING_INCDIR}/pcap-bpf.h ${STAGING_INCDIR}/net/bpf.h - install -m 0644 acinclude.m4 ${STAGING_DATADIR}/aclocal/libpcap.m4 -} +PR = "r2" diff --git a/packages/linux/linux-davinci/davinci-nand.patch b/packages/linux/linux-davinci/davinci-nand.patch new file mode 100644 index 0000000000..33e53cf095 --- /dev/null +++ b/packages/linux/linux-davinci/davinci-nand.patch @@ -0,0 +1,905 @@ +Index: linux-davinci/drivers/mtd/nand/davinci_nand.c +=================================================================== +--- /dev/null ++++ linux-davinci/drivers/mtd/nand/davinci_nand.c +@@ -0,0 +1,638 @@ ++/* ++ * linux/drivers/mtd/nand/davinci_nand.c ++ * ++ * NAND Flash Driver ++ * ++ * Copyright (C) 2006 Texas Instruments. ++ * ++ * ported to 2.6.23 (C) 2008 by ++ * Sander Huijsen <Shuijsen@optelecom-nkf.com> ++ * Troy Kisky <troy.kisky@boundarydevices.com> ++ * Dirk Behme <Dirk.Behme@gmail.com> ++ * ++ * -------------------------------------------------------------------------- ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * -------------------------------------------------------------------------- ++ * ++ * Overview: ++ * This is a device driver for the NAND flash device found on the ++ * DaVinci board which utilizes the Samsung k9k2g08 part. ++ * ++ * Modifications: ++ * ver. 1.0: Feb 2005, Vinod/Sudhakar ++ */ ++ ++#include <linux/kernel.h> ++#include <linux/init.h> ++#include <linux/module.h> ++#include <linux/platform_device.h> ++#include <linux/err.h> ++#include <linux/clk.h> ++#include <linux/io.h> ++#include <linux/mtd/mtd.h> ++#include <linux/mtd/nand.h> ++#include <linux/mtd/partitions.h> ++ ++#include <asm/arch/hardware.h> ++#include <asm/arch/nand.h> ++#include <asm/arch/mux.h> ++ ++#include <asm/mach/flash.h> ++ ++#ifdef CONFIG_NAND_FLASH_HW_ECC ++#define DAVINCI_NAND_ECC_MODE NAND_ECC_HW3_512 ++#else ++#define DAVINCI_NAND_ECC_MODE NAND_ECC_SOFT ++#endif ++ ++#define DRIVER_NAME "davinci_nand" ++ ++static struct clk *nand_clock; ++static void __iomem *nand_vaddr; ++ ++/* ++ * MTD structure for DaVinici board ++ */ ++static struct mtd_info *nand_davinci_mtd; ++ ++#ifdef CONFIG_MTD_PARTITIONS ++const char *part_probes[] = { "cmdlinepart", NULL }; ++#endif ++ ++static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; ++ ++/* BB marker is byte 5 in OOB of page 0 */ ++static struct nand_bbt_descr davinci_memorybased_small = { ++ .options = NAND_BBT_SCAN2NDPAGE, ++ .offs = 5, ++ .len = 1, ++ .pattern = scan_ff_pattern ++}; ++ ++/* BB marker is bytes 0-1 in OOB of page 0 */ ++static struct nand_bbt_descr davinci_memorybased_large = { ++ .options = 0, ++ .offs = 0, ++ .len = 2, ++ .pattern = scan_ff_pattern ++}; ++ ++inline unsigned int davinci_nand_readl(int offset) ++{ ++ return davinci_readl(DAVINCI_ASYNC_EMIF_CNTRL_BASE + offset); ++} ++ ++inline void davinci_nand_writel(unsigned long value, int offset) ++{ ++ davinci_writel(value, DAVINCI_ASYNC_EMIF_CNTRL_BASE + offset); ++} ++ ++/* ++ * Hardware specific access to control-lines ++ */ ++static void nand_davinci_hwcontrol(struct mtd_info *mtd, int cmd, ++ unsigned int ctrl) ++{ ++ struct nand_chip *chip = mtd->priv; ++ u32 IO_ADDR_W = (u32)chip->IO_ADDR_W; ++ ++ /* Did the control lines change? */ ++ if (ctrl & NAND_CTRL_CHANGE) { ++ IO_ADDR_W &= ~(MASK_ALE|MASK_CLE); ++ ++ if ((ctrl & NAND_CTRL_CLE) == NAND_CTRL_CLE) ++ IO_ADDR_W |= MASK_CLE; ++ else if ((ctrl & NAND_CTRL_ALE) == NAND_CTRL_ALE) ++ IO_ADDR_W |= MASK_ALE; ++ ++ chip->IO_ADDR_W = (void __iomem *)IO_ADDR_W; ++ } ++ ++ if (cmd != NAND_CMD_NONE) ++ writeb(cmd, chip->IO_ADDR_W); ++} ++ ++static void nand_davinci_select_chip(struct mtd_info *mtd, int chip) ++{ ++ /* do nothing */ ++} ++ ++#ifdef CONFIG_NAND_FLASH_HW_ECC ++static void nand_davinci_enable_hwecc(struct mtd_info *mtd, int mode) ++{ ++ u32 retval; ++ ++ /* Reset ECC hardware */ ++ retval = davinci_nand_readl(NANDF1ECC_OFFSET); ++ ++ /* Restart ECC hardware */ ++ retval = davinci_nand_readl(NANDFCR_OFFSET); ++ retval |= (1 << 8); ++ davinci_nand_writel(retval, NANDFCR_OFFSET); ++} ++ ++/* ++ * Read DaVinci ECC register ++ */ ++static u32 nand_davinci_readecc(struct mtd_info *mtd) ++{ ++ /* Read register ECC and clear it */ ++ return davinci_nand_readl(NANDF1ECC_OFFSET); ++} ++ ++/* ++ * Read DaVinci ECC registers and rework into MTD format ++ */ ++static int nand_davinci_calculate_ecc(struct mtd_info *mtd, ++ const u_char *dat, u_char *ecc_code) ++{ ++ unsigned int ecc_val = nand_davinci_readecc(mtd); ++ /* squeeze 0 middle bits out so that it fits in 3 bytes */ ++ unsigned int tmp = (ecc_val&0x0fff)|((ecc_val&0x0fff0000)>>4); ++ /* invert so that erased block ecc is correct */ ++ tmp = ~tmp; ++ ecc_code[0] = (u_char)(tmp); ++ ecc_code[1] = (u_char)(tmp >> 8); ++ ecc_code[2] = (u_char)(tmp >> 16); ++ ++ return 0; ++} ++ ++static int nand_davinci_correct_data(struct mtd_info *mtd, u_char *dat, ++ u_char *read_ecc, u_char *calc_ecc) ++{ ++ struct nand_chip *chip = mtd->priv; ++ u_int32_t eccNand = read_ecc[0] | (read_ecc[1] << 8) | ++ (read_ecc[2] << 16); ++ u_int32_t eccCalc = calc_ecc[0] | (calc_ecc[1] << 8) | ++ (calc_ecc[2] << 16); ++ u_int32_t diff = eccCalc ^ eccNand; ++ ++ if (diff) { ++ if ((((diff>>12)^diff) & 0xfff) == 0xfff) { ++ /* Correctable error */ ++ if ((diff>>(12+3)) < chip->ecc.size) { ++ dat[diff>>(12+3)] ^= (1 << ((diff>>12)&7)); ++ return 1; ++ } else { ++ return -1; ++ } ++ } else if (!(diff & (diff-1))) { ++ /* Single bit ECC error in the ECC itself, ++ nothing to fix */ ++ return 1; ++ } else { ++ /* Uncorrectable error */ ++ return -1; ++ } ++ ++ } ++ return 0; ++} ++#endif ++ ++/* ++ * Read OOB data from flash. ++ */ ++static int read_oob_and_check(struct mtd_info *mtd, loff_t offs, uint8_t *buf, ++ struct nand_bbt_descr *bd) ++{ ++ int i, ret; ++ int page; ++ struct nand_chip *chip = mtd->priv; ++ ++ /* Calculate page address from offset */ ++ page = (int)(offs >> chip->page_shift); ++ page &= chip->pagemask; ++ ++ /* Read OOB data from flash */ ++ ret = chip->ecc.read_oob(mtd, chip, page, 1); ++ if (ret < 0) ++ return ret; ++ ++ /* Copy read OOB data to the buffer*/ ++ memcpy(buf, chip->oob_poi, mtd->oobsize); ++ ++ /* Check pattern against BBM in OOB area */ ++ for (i = 0; i < bd->len; i++) { ++ if (buf[bd->offs + i] != bd->pattern[i]) ++ return 1; ++ } ++ return 0; ++} ++ ++/* ++ * Fill in the memory based Bad Block Table (BBT). ++ */ ++static int nand_davinci_memory_bbt(struct mtd_info *mtd, ++ struct nand_bbt_descr *bd) ++{ ++ int i, numblocks; ++ int startblock = 0; ++ loff_t from = 0; ++ struct nand_chip *chip = mtd->priv; ++ int blocksize = 1 << chip->bbt_erase_shift; ++ uint8_t *buf = chip->buffers->databuf; ++ int len = bd->options & NAND_BBT_SCAN2NDPAGE ? 2 : 1; ++ ++ /* -numblocks- is 2 times the actual number of eraseblocks */ ++ numblocks = mtd->size >> (chip->bbt_erase_shift - 1); ++ ++ /* Now loop through all eraseblocks in the flash */ ++ for (i = startblock; i < numblocks; i += 2) { ++ int j, ret; ++ int offs = from; ++ ++ /* If NAND_BBT_SCAN2NDPAGE flag is set in bd->options, ++ * also each 2nd page of an eraseblock is checked ++ * for a Bad Block Marker. In that case, len equals 2. ++ */ ++ for (j = 0; j < len; j++) { ++ /* Read OOB data and check pattern */ ++ ret = read_oob_and_check(mtd, from, buf, bd); ++ if (ret < 0) ++ return ret; ++ ++ /* Check pattern for bad block markers */ ++ if (ret) { ++ /* Mark bad block by writing 0b11 in the ++ table */ ++ chip->bbt[i >> 3] |= 0x03 << (i & 0x6); ++ ++ printk(KERN_WARNING "Bad eraseblock %d at " \ ++ "0x%08x\n", i >> 1, ++ (unsigned int)from); ++ ++ mtd->ecc_stats.badblocks++; ++ break; ++ } ++ offs += mtd->writesize; ++ } ++ ++ /* Make -from- point to next eraseblock */ ++ from += blocksize; ++ } ++ ++ printk(KERN_NOTICE "Bad block scan: %d out of %d blocks are bad.\n", ++ mtd->ecc_stats.badblocks, numblocks>>1); ++ ++ return 0; ++} ++ ++/* ++ * This function creates a memory based bad block table (BBT). ++ * It is largely based on the standard BBT function, but all ++ * unnecessary junk is thrown out to speed up. ++ */ ++static int nand_davinci_scan_bbt(struct mtd_info *mtd) ++{ ++ struct nand_chip *chip = mtd->priv; ++ struct nand_bbt_descr *bd; ++ int len, ret = 0; ++ ++ chip->bbt_td = NULL; ++ chip->bbt_md = NULL; ++ ++ /* pagesize determines location of BBM */ ++ if (mtd->writesize > 512) ++ bd = &davinci_memorybased_large; ++ else ++ bd = &davinci_memorybased_small; ++ ++ chip->badblock_pattern = bd; ++ ++ /* Use 2 bits per page meaning 4 page markers per byte */ ++ len = mtd->size >> (chip->bbt_erase_shift + 2); ++ ++ /* Allocate memory (2bit per block) and clear the memory bad block ++ table */ ++ chip->bbt = kzalloc(len, GFP_KERNEL); ++ if (!chip->bbt) { ++ printk(KERN_ERR "nand_davinci_scan_bbt: Out of memory\n"); ++ return -ENOMEM; ++ } ++ ++ /* Now try to fill in the BBT */ ++ ret = nand_davinci_memory_bbt(mtd, bd); ++ if (ret) { ++ printk(KERN_ERR "nand_davinci_scan_bbt: " ++ "Can't scan flash and build the RAM-based BBT\n"); ++ ++ kfree(chip->bbt); ++ chip->bbt = NULL; ++ } ++ ++ return ret; ++} ++ ++/* ++ * Read from memory register: we can read 4 bytes at a time. ++ * The hardware takes care of actually reading the NAND flash. ++ */ ++static void nand_davinci_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) ++{ ++ int i; ++ int num_words = len >> 2; ++ u32 *p = (u32 *)buf; ++ struct nand_chip *chip = mtd->priv; ++ ++ for (i = 0; i < num_words; i++) ++ p[i] = readl(chip->IO_ADDR_R); ++} ++ ++/* ++ * Check hardware register for wait status. Returns 1 if device is ready, ++ * 0 if it is still busy. ++ */ ++static int nand_davinci_dev_ready(struct mtd_info *mtd) ++{ ++ return (davinci_nand_readl(NANDFSR_OFFSET) & NAND_BUSY_FLAG); ++} ++ ++static void nand_davinci_set_eccsize(struct nand_chip *chip) ++{ ++ chip->ecc.size = 256; ++ ++#ifdef CONFIG_NAND_FLASH_HW_ECC ++ switch (chip->ecc.mode) { ++ case NAND_ECC_HW12_2048: ++ chip->ecc.size = 2048; ++ break; ++ ++ case NAND_ECC_HW3_512: ++ case NAND_ECC_HW6_512: ++ case NAND_ECC_HW8_512: ++ chip->ecc.size = 512; ++ break; ++ ++ case NAND_ECC_HW3_256: ++ default: ++ /* do nothing */ ++ break; ++ } ++#endif ++} ++ |
