summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
Commit message (Collapse)AuthorAgeFilesLines
...
* introduce io.hSascha Hauer2011-09-2211-11/+11
| | | | | | | To allow for some generic io accessors introduce io.h and use this instead of asm/io.h throughout the tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX NAND: pass second base address as resourceSascha Hauer2011-09-211-6/+15
| | | | | | | | The nand controller on i.MX51/53 uses two base addresses. Instead of hardcode the second address use the new shiny resources two specify it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* at91: nand switch ecc base to resourceJean-Christophe PLAGNIOL-VILLARD2011-09-201-4/+4
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand: convert to struct resourceJean-Christophe PLAGNIOL-VILLARD2011-07-232-7/+7
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* nomadik/nand: switch to dev_request_mem_regionJean-Christophe PLAGNIOL-VILLARD2011-07-201-4/+3
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* atmel/drivers: switch to dev_request_mem_regionJean-Christophe PLAGNIOL-VILLARD2011-07-201-1/+1
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand i.MX: convert to struct resourceSascha Hauer2011-07-191-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nomadik_nand: use "struct resource" instead of platform_dataJean-Christophe PLAGNIOL-VILLARD2011-07-181-4/+4
| | | | | | drop data_va, cmd_va and addr_va in favor of resources Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* atmel_nand: switch to "struct resource"Jean-Christophe PLAGNIOL-VILLARD2011-07-181-1/+1
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Improved gpmc_nand driver to show the current eccmode.Juergen Kilb2011-06-101-3/+5
| | | | | | | | | | Now a 'devinfo gpmc_nand0' shows the current used eccmode instead of <NULL>. The function omap_gpmc_eccmode is now called by dev_set_param. Signed-off-by: Juergen Kilb <J.Kilb@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Always initialize oob_poi before writing OOB dataJuergen Beisert2011-05-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following patch came across the mtd mailing list today. I thinks its also valid for barebox (it handles a special corner case, but maybe it can hit us, too): In nand_do_write_ops() code it is possible for a caller to provide ops.oobbuf populated and ops.mode == MTD_OOB_AUTO, which currently means that the chip->oob_poi buffer isn't initialised to all 0xFF. The nand_fill_oob() method then carries out the task of copying the provided OOB data to oob_poi, but with MTD_OOB_AUTO it skips areas marked as unavailable by the layout struct, including the bad block marker bytes. An example of this causing issues is when the last OOB data read was from the start of a bad block where the markers are not 0xFF, and the caller wishes to write new OOB data at the beginning of another block. In this scenario the caller would provide OOB data, but nand_fill_oob() would skip the bad block marker bytes in oob_poi before copying the OOB data provided by the caller. This means that when the OOB data is written back to NAND, the block is inadvertently marked as bad without the caller knowing. This has been witnessed when using YAFFS2 where tags are stored in the OOB. This patch changes the code so that oob_poi is always initialised to 0xFF to make sure no left over data is inadvertently written back to OOB data. The comment above is for the linux kernel, but the same is valid for barebox and CPUs writing the OOB date controlled in software (like the Samsung S3C2440 does). Signed-off-by: Adam Thomson <adam.thomson@alcatel-lucent.com> Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: omap4: fix dev_width for omap_enable_hweccJan Weitzel2011-04-201-1/+1
| | | | | | | | NAND_BUSWIDTH_16 should result in dev_width = 1 according to the kernel driver omap_enable_hwecc: dev_width = (chip->options & NAND_BUSWIDTH_16) ? 1 : 0; Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand omap: handle erased pages correctly in hamming ecc modeSascha Hauer2011-04-121-0/+5
| | | | | | do not throw ecc errors on erased pages. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand omap: use xzalloc instead of callocSascha Hauer2011-04-121-5/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand omap: use standard debug functionsSascha Hauer2011-04-121-19/+8
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand bb: add proper bb remove functionSascha Hauer2011-04-121-0/+22
| | | | | | | | The old way happily removed cdev entries which were no bb dev at all. Fix this by checking if the given device actually is a bb device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand bb: switch to cdev operationsSascha Hauer2011-04-121-39/+26
| | | | | | | The cdev operations are available without the complete file API, so they are more suitable for internal usage. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand: move bb handling code to drivers/mtd/nandSascha Hauer2011-04-122-1/+283
| | | | | | | It's good to seperate the code which others can use from commands. This way other users do not depend on the command being compiled in. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand: nand_block_markbad is only used with nand write supportSascha Hauer2011-04-123-21/+5
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand omap: turn debug messages into dev_dbgSascha Hauer2011-04-121-8/+8
| | | | | | | The information from the probe function is useful for developers only, so turn them into dev_dbg to safe binary space. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand omap: fix hamming romcode ecc codeSascha Hauer2011-04-121-4/+14
| | | | | | | | This got broken in commit: 6943635 mtd nand omap: make ecc mode runtime configurable Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand: make reading oob optionalSascha Hauer2011-04-114-9/+49
| | | | | | | The nand oob functions occupy quite some binary space. If not needed, we can save this space by making this configurable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand: remove unused nand_util fileSascha Hauer2011-04-112-859/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devfs: remove unused struct filep* argument from open/closeSascha Hauer2011-04-111-2/+2
| | | | | | | the cdev layer is under the file layer, so it should not use struct filep*. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ubi: do not use filepSascha Hauer2011-04-111-7/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'nand-pu' into nextSascha Hauer2011-04-0611-1300/+1398
|\
| * nand: make bbt support optionalSascha Hauer2011-04-043-4/+20
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * nand: make vendor/type printout optionalSascha Hauer2011-04-042-69/+84
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * nand: Make different ecc modes optionalSascha Hauer2011-04-043-5/+32
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * nand: Make write support optionalSascha Hauer2011-04-046-9/+39
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * nand: factor out nand write supportSascha Hauer2011-04-044-717/+766
| | | | | | | | | | | | In order to make it optional later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * nand: factor out syndrome support to seperate fileSascha Hauer2011-04-044-207/+228
| | | | | | | | | | | | In order to make it optional later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * nand: factor out software ecc support to seperate fileSascha Hauer2011-04-044-75/+97
| | | | | | | | | | | | in order to make it optional later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * nand: Factor out hw ecc support to seperate fileSascha Hauer2011-04-044-85/+120
| | | | | | | | | | | | In order make hwecc support optional later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * nand: do not fall through in nand_scan_tail()Sascha Hauer2011-04-041-16/+22
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * nand: remove unneeded nand_[get|release]_device functionsSascha Hauer2011-04-041-95/+0
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * nand: remove unused suspend/resume functionsSascha Hauer2011-04-041-28/+0
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'omap-drivers' into nextSascha Hauer2011-04-063-107/+738
|\ \
| * | mtd nand omap: Add BCH ecc supportSascha Hauer2011-04-043-38/+576
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds BCH ecc support to the omap nand driver. The BCH error correction allows for up to 8 bit error correction. It is also needed for booting from nand on omap4. This is based on code from Sukumar Ghorai <s-ghorai@ti.com>: [PATCH] omap3: nand: bch ecc support added Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd nand omap: make ecc mode runtime configurableSascha Hauer2011-04-041-88/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | On omap we use different ecc modes for different purposes. The initial boot code has to be written with hardware ecc whereas Linux usually uses software ecc. To be able to write in both modes with a sinlge barebox image introduce a eccmode device parameter. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd nand omap: Pass ecc mode from platformSascha Hauer2011-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | | As we will get more ecc modes pass through the exact mode from the platform, not only a flag. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | omap: rename GPMC Kconfig entry to OMAP_GPMCSascha Hauer2011-04-041-1/+1
| |/ |/| | | | | | | | | | | Give this omap specific entry an omap namespace. Also, remove unnecessary dependency to omap2/3 in nand Kconfig. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'next'Sascha Hauer2011-04-042-33/+100
|\|
| * mtd/nand_imx: add support for page size of 4kBaruch Siach2011-03-181-1/+1
| | | | | | | | | | Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * S3C24xx/NFC: Add OOB/ECC handling documentation for different NANDsJuergen Beisert2011-03-141-3/+18
| | | | | | | | | | Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * S3C24xx/NFC: Setup ECC handling in accordance to the kernelJuergen Beisert2011-03-141-4/+17
| | | | | | | | | | | | | | | | | | Do the same ECC handling and ECC size in barebox than the kernel does. Currently its done for S3C2440 based systems only, as I have no idea how to manage it on a S3C2410 based system. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * S3C24xx/NFC: Consider correct NAND page size for boot.Juergen Beisert2011-03-141-18/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When booting from NAND, its important to know the correct page size. When the NAND is used as the boot source, four dedicated pins are used to configure the correct page size and address cycles. These pins can be read back in one of the NFC registers to parametrize the load function. This patch also extends the read routine to support more than four address cycles on demand. BTW: At least some mini2440s are misconfigured to use five address cycles for a NAND device that is known to need only four address cycles. In this case the vendor is at our side: This NAND simply ignores any additional address cycles than required. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * S3C24xx/NFC: Remove double function setupJuergen Beisert2011-03-141-1/+0
| | | | | | | | | | | | | | Three lines above this setting is already done. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * S3C24xx/NFC: Remove dead codeJuergen Beisert2011-03-141-6/+2
| | | | | | | | | | | | | | | | Something was to be done here. But I do not remember what. As it works also without it, remove this dead code. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * S3C24xx/NFC: Re-enable the controller after NAND boot testJuergen Beisert2011-03-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | After running the 'nand_boot_test' command, any usage of the NAND fails with a IO error. This happens due to the load routine disables the NAND controller after loading the image. This patch re-enables the NAND controller again after running the test. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>