Skip to contentSkip to conversation

NAND driver

DISCUSSION Mark Underwood 2 participants 3 messages Feb 25, 2008 – Mar 26, 2008 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

I’m writing a NAND driver for an ASIC. The NAND controller has been designed to handle page read & writes with little SW intervention using interrupts or DMA, so I plan to implement the write_page_raw & read_page_raw functions.
However, looking through nand_base.c it looks like not all NAND access go through these functions so to start with I have implemented the cmd_ctrl function & supplied the IO_ADDR_R & IO_ADDR_W address with the thinking that these would be a fall back when the access doesn't go through the raw functions.
Unfortunately it seems the single write functionality of the controller is broken. The page read & write functionality only allow me to work in 512byte blocks so I can't write OOB that way. Can you confirm that there are cases where OOB is written separately and if so do you have any suggestions for getting around this problem?

Many thanks,

Mark

      ___________________________________________________________ 

Rise to the challenge for Sport Relief with Yahoo! For Good

http://uk.promotions.yahoo.com/forgood/

#1 lore raw
Quoted 15 lines · --- Mark Underwood

I’m writing a NAND driver for an ASIC. The NAND controller has been designed to handle page read &
writes with little SW intervention using interrupts or DMA, so I plan to implement the write_page_raw & read_page_raw functions.
However, looking through nand_base.c it looks like not all NAND access go through these functions
so to start with I have implemented the cmd_ctrl function & supplied the IO_ADDR_R & IO_ADDR_W address with the thinking that these would be a fall back when the access doesn't go through the raw functions.
Unfortunately it seems the single write functionality of the controller is broken. The page read
& write functionality only allow me to work in 512byte blocks so I can't write OOB that way. Can you confirm that there are cases where OOB is written separately and if so do you have any suggestions for getting around this problem?

Quoted 4 lines

Many thanks,

Mark

I forgot to say that I'm working on a 2.6.21.1 kernel.

After some pondering I managed to implement the single write functionality by abusing the command fifo and playing with GPIO pins.

Looking through nand_base.c I notice that although I can pass in *_page_raw operations in the nand_chip structure they are not used in the *_page_swecc functions but instead they call the internal *_page_raw functions directly. I propose just to replace the direct calls with indirect ones (via the function pointers in the nand_chip structure). Does this proposal sound OK?

Mark

Quoted 11 lines

      ___________________________________________________________ 

Rise to the challenge for Sport Relief with Yahoo! For Good

http://uk.promotions.yahoo.com/forgood/

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

      ___________________________________________________________ 

Rise to the challenge for Sport Relief with Yahoo! For Good

http://uk.promotions.yahoo.com/forgood/

#2 lore raw

I have faced situation similar to yours.

What I did was to start afresh instead of tweaking the generic nand interface driver. I would suggest you to look at the OneNAND interface driver. That will have a lot of similarities to an interface written for a controller.

Hope that helps.

Regards,
RK

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mark Underwood
Sent: Tuesday, February 26, 2008 2:34 PM
To: [email protected]
Subject: Re: NAND driver

Quoted 1 line · --- Mark Underwood

I'm writing a NAND driver for an ASIC. The NAND controller has been

designed to handle page read

Quoted 2 lines

&
writes with little SW intervention using interrupts or DMA, so I plan

to implement the

Quoted 2 lines

write_page_raw & read_page_raw functions.
However, looking through nand_base.c it looks like not all NAND access

go through these

Quoted 2 lines

functions
so to start with I have implemented the cmd_ctrl function & supplied

the IO_ADDR_R & IO_ADDR_W

Quoted 1 line

address with the thinking that these would be a fall back when the

access doesn't go through the

Quoted 2 lines

raw functions.
Unfortunately it seems the single write functionality of the

controller is broken. The page

Quoted 2 lines

read
& write functionality only allow me to work in 512byte blocks so I

can't write OOB that way. Can

Quoted 1 line

you confirm that there are cases where OOB is written separately and

if so do you have any

Quoted 6 lines

suggestions for getting around this problem?

Many thanks,

Mark

I forgot to say that I'm working on a 2.6.21.1 kernel.

After some pondering I managed to implement the single write functionality by abusing the command
fifo and playing with GPIO pins.

Looking through nand_base.c I notice that although I can pass in *_page_raw operations in the
nand_chip structure they are not used in the *_page_swecc functions but instead they call the
internal *_page_raw functions directly. I propose just to replace the direct calls with indirect
ones (via the function pointers in the nand_chip structure). Does this proposal sound OK?

Mark

Quoted 11 lines

      ___________________________________________________________ 

Rise to the challenge for Sport Relief with Yahoo! For Good

http://uk.promotions.yahoo.com/forgood/

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

      ___________________________________________________________ 

Rise to the challenge for Sport Relief with Yahoo! For Good

http://uk.promotions.yahoo.com/forgood/

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

Conexant E-mail Firewall (Conexant.Com) made the following annotations
---------------------------------------------------------------------
********************** Legal Disclaimer ****************************

"This email may contain confidential and privileged material for the sole use of the intended recipient. Any unauthorized review, use or distribution by others is strictly prohibited. If you have received the message in error, please advise the sender by reply email and delete the message. Thank you."

**********************************************************************

---------------------------------------------------------------------