Skip to contentSkip to conversation

hi,guys,about the nand flash driver

U-Boot lanmanck 4 participants 6 messages May 29, 2009 – Jun 4, 2009

lore
Share & tools
lore

lanmanck

author
#0 lore raw

hi:
i am going to port uboot1.1.6 nand flash driver to my arm926ejs board.use /drivers/nand/nand.c. not nand_legacy.c .
out cpu chip has a nand flash controller,the program flow is as below:
1?set address to controller's register
2?set command to controller's register
3?write controller's special register,so that the 2 steps above can execute.
4?wait for the steps above to be completed ,through another register.
5?now program the data.
the problem is;
i don't konw how to set struct nand_chip's func point because of the nand controller:
xxx_hwcontrol(): the ale,cle cannot be controlled by program.
IO_ADDRW:what's it?
now i think i just need to write the fllowing functions:
wirtebyte,readbyte,writebuf,readbuf,
can anyone tell me if i am right? or give me some advise?
thank you.

#1 lore raw

Dear lanmanck,

Quoted 3 lines · In message <[email protected]>…

i am going to port uboot1.1.6 nand flash driver to my arm926ejs board.use
/drivers/nand/nand.c. not nand_legacy.c .

Forget it. U-Boot 1.1.6 is dead and buried and totally unsupported.

Please use recent code (top of tree or at minimum the latest release = v2009.03) for recent development.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
In the bathtub of history the truth is harder to hold than the  soap,
and much more difficult to find ...     - Terry Pratchett, _Sourcery_
#2 lore raw
In reply to lanmanck
Quoted 3 lines · lanmanck

hi:
i am going to port uboot1.1.6 nand flash driver to my arm926ejs board.use /drivers/nand/nand.c. not nand_legacy.c .
out cpu chip has a nand flash controller,the program flow is as below:

As Wolfgang pointed out, that is very old. Please use current code.

Quoted 11 lines

1?set address to controller's register
2?set command to controller's register
3?write controller's special register,so that the 2 steps above can execute. 4?wait for the steps above to be completed ,through another register. 5?now program the data.
the problem is;
i don't konw how to set struct nand_chip's func point because of the nand controller:
xxx_hwcontrol(): the ale,cle cannot be controlled by program. IO_ADDRW:what's it?
now i think i just need to write the fllowing functions:
wirtebyte,readbyte,writebuf,readbuf,

That will not be sufficient. If your NAND controller does not fit in the cmd_ctrl model, then you'll have to override higher level functions such as cmdfunc -- see drivers/mtd/nand/fsl_elbc.c for an example.

Alternatively, you may want to override the higher level functions that call cmdfunc.

-Scott

author
#3 lore raw

[U-Boot] Reply:Re: hi,guys,about the nand flash driver

hi scott:
thank you for replying.
because i am not familiar with the framework of uboot's nand driver ,do you think i should read all of the source code about the nand driver? BTW,i have not found the diretory "drivers/mtd/nand/fsl_elbc.c",is it the latest version?
best regards.

?> -----????-----

Quoted 33 lines

???: "Scott Wood" <[email protected]> ????: 2009?5?30? ???
???: lanmanck <[email protected]>
??: u-boot at lists.denx.de
??: Re: [U-Boot] hi,guys,about the nand flash driver

Quoted 3 lines · lanmanck

hi:
i am going to port uboot1.1.6 nand flash driver to my arm926ejs board.use /drivers/nand/nand.c. not nand_legacy.c .
out cpu chip has a nand flash controller,the program flow is as below:

As Wolfgang pointed out, that is very old. Please use current code.

Quoted 11 lines

1?set address to controller's register
2?set command to controller's register
3?write controller's special register,so that the 2 steps above can execute. 4?wait for the steps above to be completed ,through another register. 5?now program the data.
the problem is;
i don't konw how to set struct nand_chip's func point because of the nand controller:
xxx_hwcontrol(): the ale,cle cannot be controlled by program. IO_ADDRW:what's it?
now i think i just need to write the fllowing functions:
wirtebyte,readbyte,writebuf,readbuf,

That will not be sufficient. If your NAND controller does not fit in the cmd_ctrl model, then you'll have to override higher level functions such as cmdfunc -- see drivers/mtd/nand/fsl_elbc.c for an example.

Alternatively, you may want to override the higher level functions that call cmdfunc.

-Scott

#4 lore raw

[U-Boot] Reply:Re: hi,guys,about the nand flash driver

Quoted 5 lines · lanmanck

hi scott:
thank you for replying.
because i am not familiar with the framework of uboot's nand driver ,do you think i should read all of the source code about the nand driver? BTW,i have not found the diretory "drivers/mtd/nand/fsl_elbc.c",is it the latest version?
best regards.

the u-boot 1.1.6 don't have fsl_elb.c.

Quoted 5 lines · as Wolfgang

Forget it. U-Boot 1.1.6 is dead and buried and totally unsupported.

Please use recent code (top of tree or at minimum the latest release = v2009.03) for recent development.

I also have a u-boot 1.1.6, it's work with Pi (ingenic CPU device) now I am try to move to u-boot V2009.03. :-)

Signature · 5 lines
Best Regards
Xiangfu Liu

jabber : xiangfu.z at gmail.com
skype  : xiangfu.z
#5 lore raw

[U-Boot] Reply:Re: hi,guys,about the nand flash driver

In reply to lanmanck
Quoted 2 lines · lanmanck

because i am not familiar with the framework of uboot's nand driver ,do you think i should read all of the source code about the nand driver?

That's always helpful. :-)

Quoted 1 line

BTW,i have not found the diretory "drivers/mtd/nand/fsl_elbc.c",is it the latest version?

Sorry, I meant drivers/mtd/nand/fsl_elbc_nand.c.

-Scott