From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?=22David_M=FCller_=28ELSOFT_AG=29=22?= Date: Fri, 19 Sep 2003 12:15:32 +0200 Subject: [U-Boot-Users] Re: Patch s3c2410 nand-boot. In-Reply-To: <3F69A08E.2000907@libero.it> References: <20030918103204.E5111C59E4@atlas.denx.de> <3F69A08E.2000907@libero.it> Message-ID: <3F6AD744.1030107@elsoft.ch> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Gianluca wrote: > I have changed NAND code only to remove warning beacuse I don't use > some variable an then I rewrite "unsigned long nandptr = nand->IO_ADDR;" in > "unsigned long nandptr; nandptr = nand->IO_ADDR;". > Wolfgang and I have agreed, that direct hardware accesses and board specific implementation details should be removed from "cmd_nand.c", but should be implemented in a cpu and / or board specific low level NAND flash driver instead. Please take a look at the NAND part of the Linux MTD drivers to get an idea how it should work. > David, I've forwarded the patch to you. Can you please have a look at > the implementation details? Thanks. > I'm afraid that "bulletproof" booting from a NAND flash is not as simple as i may look at first. Please keep in mind that NAND flash are not 100% error free, but contain an arbitrary number of "bad blocks" (and new ones could appear during lifetime). Only the two first blocks of a NAND flash device are normally guarantied to be error free. Additionally the code which can be executed "directly" on the S3C24x0 when booting from a NAND flash is further limited to 4KB in size. So a multi stage boot process has to be implemented. After reset, hardware loads a tiny piece of code from the first two blocks of the NAND flash. This code has to do: - minimial initialisation of CPU - initialisation of SDRAM and NAND flash - copy rest of boot code (U-Boot) from NAND to SDRAM while taking care of bad blocks - jump to an appropriate place to give up control to rest of boot code Dave