tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Assistance working with Marvell SoC NAND controller



I'm trying to write a driver for the NAND controller on the Marvell Kirkwood (and I believe Orion as well) SoC (specifically the 88F6281, as used in my Sheevaplug), using the datasheet here:

http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf

and also poking around Linux and u-boot source for examples of how they do things. From what I can tell,

With some help from ahoka@ (who wrote nand_samsung.c, already in-tree) I have a driver attaching and getting *some* information from the NAND:

mvsocnand0 at mvsoc0 unit 0 offset 0x10418-0x10473: Marvell SoC NAND controller
nand0 at mvsocnand0: Legacy NAND Flash
nand0: manufacturer id: 0xec (Samsung), device id: 0xdc
nand0: page size: 2048 bytes, spare size: 64 bytes, block size: 65536 bytes
nand0: LUN size: 0 blocks, LUNs: 0, total storage size: 384 MB
nand0: column cycles: 0, row cycles: 0
flash0 at nand0: NAND flash partition size 1024 KB, offset 0, read only
flash0: erase size 64 KB, page size 2048 bytes, write size 2048 bytes
flash1 at nand0: NAND flash partition size 4096 KB, offset 0x100000, read only
flash1: erase size 64 KB, page size 2048 bytes, write size 2048 bytes
flash2 at nand0: NAND flash partition size 507 MB, offset 0x500000
flash2: erase size 64 KB, page size 2048 bytes, write size 2048 bytes

My driver-so-far is here: http://www.tastylime.net/netbsd/mvsocnand.diff , and I added the following to SHEEVAPLUG:

options NAND_DEBUG
options NAND_VERBOSE
mvsocnand*    at mvsoc? offset ? irq ?
nand0 at nandbus?
flash0 at nand0 offset 0x000000 size 0x00100000 readonly 1 # uboot? flash1 at nand0 offset 0x00100000 size 0x00400000 readonly 1 # uimage
flash2          at nand0 offset 0x00500000 size 0x1fb00000 # chfs?

I haven't implemented all the functions yet, trying to get what I have so far working first. I think I'm not quite understanding how the command latch/address latch bit is supposed to work - I've done mvsocnand_command() and mvsocnand_address() based on what u-boot does, the datasheet, and ahoka's omap2_nand.c, but reading data from the NAND flash doesn't actually seem to work, and I'm hoping someone with more experience can spot something wrong that I'm doing...

Thanks for any and all assistance,
+j



Home | Main Index | Thread Index | Old Index