History log of /drivers/mtd/nand/bf5xx_nand.c
Revision Date Author Comments
6a918bade9dab40aaef80559bd1169c69e8d69cb 11-Mar-2012 Mike Dunn <mikedunn@newsguy.com> mtd: flash drivers set ecc strength

Flash device drivers initialize 'ecc_strength' in struct mtd_info, which is the
maximum number of bit errors that can be corrected in one writesize region.

Drivers using the nand interface intitialize 'strength' in struct nand_ecc_ctrl,
which is the maximum number of bit errors that can be corrected in one ecc step.
Nand infrastructure code translates this to 'ecc_strength'.

Also for nand drivers, the nand infrastructure code sets ecc.strength for ecc
modes NAND_ECC_SOFT, NAND_ECC_SOFT_BCH, and NAND_ECC_NONE. It is set in the
driver for all other modes.

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
88146872f0fbd89e425e3e0db71d42df8db9d932 23-May-2011 Jamie Iles <jamie@jamieiles.com> mtd: bf5xx_nand: convert to mtd_device_register()

Convert to mtd_device_register() and remove the CONFIG_MTD_PARTITIONS
preprocessor conditionals as partitioning is always available.

Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
5954c47c2194abcdeeae5f752e64b7c75770dbd3 17-Oct-2010 Mike Frysinger <vapier@gentoo.org> mtd: Blackfin NFC: fix badblock location with BootROM OOB

The bbt structure isn't actually used, just the badblockpos. This lets
the driver correctly handle badblocks with the different OOB layout with
certain sized flashes. Previously, the blocks would all be reported as
bad and be completely unusable.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8b865d5efd9205b131dd9a43a6f450c05d38aaa1 28-Aug-2010 Mike Frysinger <vapier@gentoo.org> mtd: Blackfin NFC: fix invalid free in remove()

Since info->mtd isn't dynamically allocated, we shouldn't attempt to
kfree() it. Otherwise we get random fun corruption when unloading
the driver built as a module.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
eac15a429a27cb74115daaf4c1127c5e854d50e4 28-Aug-2010 Mike Frysinger <vapier@gentoo.org> mtd: Blackfin NFC: fix build error after nand_scan_ident() change

Seems some patches got out sync when being merged. The Blackfin NFC
driver was updated to use nand_scan_ident(), but it missed the change
where nand_scan_ident() now takes 3 arguments. So update this driver
to fix build failures.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
d2350c2ab51df7088d3db73a4c85ad73ded37a01 05-Aug-2010 Barry Song <barry.song@analog.com> mtd: Blackfin NFC: fix nand busy detection

The IRQSTAT register is a W1C register used by the interrupt handler and
may have its BUSY bit changed. This makes it somewhat unreliable for the
polling devready function. So switch it over to use the BUSY bit in the
STAT register that always reflects the current state of the hardware.

This fixes driver hangs seen when the NAND flash is under heavy system
load (like I/O benchmarks).

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
44299179c0e87cc6d8b753c1ca8c97b1cf9340e1 05-Aug-2010 Barry Song <barry.song@analog.com> mtd: Blackfin NFC: fix handling of page sizes

Rather than forcing the platform resources to declare the desired page
size, simply use the existing information passed down to us by the higher
layers. This way we work out of the box with all flash chips that the
kernel knows about.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
752b957a37ee1cc09fccb39a8bc5843edf32119b 05-Aug-2010 Barry Song <barry.song@analog.com> mtd: Blackfin NFC: wait for the ECC reset to finish

When resetting the ECC registers/counters, the bit will automatically
clear itself once the reset has actually finished. So make sure we
wait for that to occur before doing anything else rather than assuming
everything is peachy and proceeding with stale ECC values.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
00355b0baadf949f02ab7d3e2bd222e3fbcc72ee 05-Aug-2010 Barry Song <barry.song@analog.com> mtd: Blackfin NFC: fix typo for read/write delay setup

We used the platform rd_dly field when we meant to use the wr_dly field.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
fd508da2208696db146cd1be2bb2e8b799f6e3a2 05-Aug-2010 Barry Song <barry.song@analog.com> mtd: Blackfin NFC: make sure to check NAND_ALE in cmd_ctrl

The NAND base may send some controls which are neither CLE nor ALE, so
we need to explicitly check both instead of assuming things are always
one or the other. Otherwise, we sometimes send out illegal addresses
to the NAND device.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
085d45fb5216c25b69103e5d861fabdc4389e221 05-Aug-2010 Barry Song <barry.song@analog.com> mtd: Blackfin NFC: fix raw page write/read handling

Our write_buf/read_buf funcs always do ECC in HW ECC mode. That is not
needed for raw funcs. In fact, write_buf/read_buf should be a pure func
for data input/output while chip->ecc.hwctl controls ECC. Unfortunately,
we can't separate ECC from normal data input/output in our NFC, so our DMA
write_buf/read_buf entries are coupled with ECC operations closely.

Thus we need to provide dedicated read_page_raw/write_page_raw funcs where
we do non-DMA transactions so as to avoid automatic ECC.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
7ee064c90b3a65aa0c8d8cd87681177645db494e 05-Aug-2010 Barry Song <barry.song@analog.com> mtd: Blackfin NFC: delete useless comment about jffs2

The low level NAND driver doesn't care about filesystems, so punt the
local comment indicating otherwise.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
ac39ee304ac33f15107e42adb5ee5b0d0ce2dc4a 09-Mar-2010 Mike Frysinger <vapier@gentoo.org> mtd: Blackfin NFC: localize MMR bit masks

Convert all magic numbers into appropriate defines, and move the defines
out of the global namespace and into this one driver. No other driver
needs to care about the MMR layout anyways.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
c3a9f35673290f49ec115d36ad283961c82c135a 26-May-2009 Cliff Cai <cliff.cai@analog.com> mtd: blackfin NFC: fix hang when using NAND on BF527-EZKITs

The DMAs have different bit sizes on BF52x and BF54x. From the PHRM:

"The 16-bit DMA Access Bus (DAB) connects the DMA controller to the
on-chip peripherals, PPI, SPI, Ethernet MAC, the SPORTs, NFC,
HOSTDP and the UARTs."

32-bit DMA won't work for BF52x.

Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
530c3b60658687e2ad7bf98ef83631a8280ae8a6 26-May-2009 Mike Frysinger <vapier@gentoo.org> mtd: blackfin NFC: remove pointless return value in bf5xx_nand_dma_rw

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
bfc492571e7ad1eb4b9fe3ac8ab0a7cdaecf8eca 04-Mar-2009 Mike Frysinger <vapier.adi@gmail.com> [MTD] [NAND] Blackfin NFC Driver: drop pointless casts with set_dma_callback()

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8d30cab06920f9efb7e089f2c69e451b2a637d8a 04-Mar-2009 Mike Frysinger <vapier.adi@gmail.com> [MTD] [NAND] Blackfin NFC Driver: mark bf5xx_nand_add_partition() as __devinit

The bf5xx_nand_add_partition() func is only called by __devinit functions,
so put it into the __devinit section as well

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
08d2503ecc2337275942c1f52822b7a464c0c0a3 04-Mar-2009 Mike Frysinger <vapier.adi@gmail.com> [MTD] [NAND] Blackfin NFC Driver: do not clobber DMAC1_PERIMUX

Only set DMAC1_PERIMUX once we have requested and been granted the dma
channel to prevent breaking other peripherals in the error case

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
4f0ca70e52b67f41287d853f0d572dafa875e485 30-Jul-2008 Bryan Wu <cooloney@kernel.org> [MTD] [NAND] Blackfin NFC Driver: Cleanup the error exit path of bf5xx_nand_probe function

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Cc: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
0ee002b041cb45ab3cc5384b86271d41ccf90fe1 30-Jul-2008 Mike Frysinger <vapier.adi@gmail.com> [MTD] [NAND] Blackfin NFC Driver: use standard dev_err() rather than printk()

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2445af3853928bf3ee7960e09f548a1b07924091 30-Jul-2008 Mike Frysinger <vapier.adi@gmail.com> [MTD] [NAND] Blackfin NFC Driver: add proper devinit/devexit markings to probe/remove functions

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
fcb90ba7e9ba9a17ca5103be3f3ae3a446dadc14 30-Jul-2008 Mike Frysinger <vapier.adi@gmail.com> [MTD] [NAND] Blackfin NFC Driver: add support for the ECC layout the Blackfin bootrom uses

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
cf840392e83914b9fcdbce8a8a2bc17a84cf0353 30-Jul-2008 Mike Frysinger <vapier.adi@gmail.com> [MTD] [NAND] Blackfin NFC Driver: fix bug - hw ecc calc by making sure we extract 11 bits from each register instead of 10

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
e274f025e2caaadc1a6dd41adc9c9a19be075110 30-Jul-2008 Mike Frysinger <vapier.adi@gmail.com> [MTD] [NAND] Blackfin NFC Driver: fix bug - do not clobber the status from the first 256 bytes if operating on 512 pages

Singed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
afc4bca63941746f1d49394620d294074150e664 24-Apr-2008 Michael Hennerich <michael.hennerich@analog.com> [MTD] [NAND] bf5xx_nand: Avoid crash if bfin_mac is installed.

http://blackfin.uclinux.org/gf/project/uclinux-dist/tracker/?action=TrackerItemEdit&tracker_item_id=4053

Singed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
1ff184225b15930ea118ac2130f074c741d34f08 18-Apr-2008 Kay Sievers <kay.sievers@vrfy.org> [MTD] [NAND] fix platform driver hotplug/coldplug

Since 43cc71eed1250755986da4c0f9898f9a635cb3bf, the platform modalias is
prefixed with "platform:". Add MODULE_ALIAS() to the hotpluggable MTD NAND
platform drivers, to re-enable auto loading.

NOTE: at91_nand for some reason disallows modular builds. I'm assuming that's
just an oversight that will be fixed.

[dbrownell@users.sourceforge.net: minor fix]
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
8e87d7820a6362b6304924befb22d1ee79b754f3 03-Feb-2008 Joe Perches <joe@perches.com> drivers/mtd/: Spelling fixes

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
5eb91034f3d825f43b3c8ace7b69f94752b7deda 30-Jan-2008 Bryan Wu <bryan.wu@analog.com> [MTD] [NAND] Fix Blackfin NFC ECC calculating bug with page size 512 bytes

Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
f4dda0914e76feb1ff5ec349cc68f319f6a4e40f 30-Jan-2008 Bryan Wu <bryan.wu@analog.com> [MTD] [NAND] Remove wrong operation in PM function of the BF54x NFC driver

There is no suspend/resume operation in NFC driver at all, currently.

Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
a25b7fee537ab4dbc6eb301bd455ee8d01b707f6 30-Oct-2007 Michael Hennerich <michael.hennerich@analog.com> [MTD] [NAND] Add Blackfin BF52x support in bf5xx_nand driver

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
b37bde147890c8fea8369a5a4e230dabdea4ebfb 02-Oct-2007 Bryan Wu <bryan.wu@analog.com> [MTD] [NAND] Blackfin on-chip NAND Flash Controller driver

This is the driver for latest Blackfin on-chip nand flash controller

- use nand_chip and mtd_info common nand driver interface
- provide both PIO and dma operation
- compiled with ezkit bf548 configuration
- use hardware 1-bit ECC
- tested with YAFFS2 and can mount YAFFS2 filesystem as rootfs

ChangeLog from try#1
- use hweight32() instead of count_bits()
- replace bf54x with bf5xx and BF54X with BF5XX
- compare against plat->page_size in 2 cases when enable hardware ECC

ChangeLog from try#2
- passed nand_test suites
- use cpu_relax() instead of busy wait loop
- some coding style issue pointed out by Andrew

Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>