debug read nand(weekly report)
xiangfu at openmoko.org
Tue Jul 15 15:57:32 CEST 2008
Andy Green wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> 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
> | 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.
i do this now, but i don't think there are bad block(is too many).
so in next few days i will try to set up the serial console debug, find why.
> | 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)) &&
> + ;
> + /* 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
> | 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.
if the start.S and lowlevel.S is init enough for boot kboot-kernel?
More information about the openmoko-kernel