debug read nand(weekly report)

Andy Green andy at
Tue Jul 15 12:16:43 CEST 2008

Hash: SHA1

Somebody in the thread at some point said:

| i never change the code nand_read.c
| (i comment this line buf +=j, because this change my buf address :-)
| copy this file from the uboot/cpu/arm920t/s3c24x0/
| size += NAND_BLOCK_SIZE;  <========= this may to skip the bad block

Sorry Xiangfu you are right, I didn't look at the code carefully
enough., I understood it better by staring at it in git with the indents.

| the image i write to NAND is only 824bytes
| i see "define NAND_PAGE_SIZE          2048 " one page is 2048bytes.
| so i made the buf is 2048 , is there something wrong.

In this case it seems it can be that is_bad_block() is always telling
you that it is a bad block() so you keep moving forward all the time?
Maybe add some code to reject and fail if it is told there is > 4 bad
blocks in a row.

| about the serial console debug . which code i should read?

I read you used the serial port init from U-Boot.  Sending a character
in C in kernel looks like this, you can adapt to U-Boot

+               int timeout = 10000000;
+               /* spin on it being busy */
+               while ((!(rd_regl(port, S3C2410_UTRSTAT) & 2)) && timeout--)
+                       ;
+               /* transmit register */
+               wr_regl(port, S3C2410_UTXH, mycharacter);

| now i am working on (1), i also want learn some base knowledge about
| 'move initialization into kernel' or read some book about that So i need
| help and direction, what i should learn?

U-Boot has some things it sets up before passing control to Linux.  For
example it spams the pcf50633 PMU registers using
./board/neo1973/gta02/pcf50633.c data (which is very slow).  This can be
reduced down and move to platform defined data set in the Linux driver
when it starts.  Don't worry about it because we can take care of it.

The new bootloader only needs to do smallest init on CPU, DRAM and
understand NAND and SD Card, unlike U-Boot every other init like Glamo
video and LCM happens will happen first time in Linux driver.

- -Andy
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora -


More information about the openmoko-kernel mailing list