[U-Boot] arm: wrong Relocation and not cleared BSS

Alexander Holler holler at ahsoftware.de
Sat Oct 30 16:07:13 CEST 2010


Am 30.10.2010 15:57, schrieb Albert ARIBAUD:
> Le 30/10/2010 15:45, Alexander Holler a écrit :

>> If the code in u-boot would not assume that bss is zero, I don't
>> understand why clear_bss in start.S exists.
>
> As I said, out of courtesy.
>
> Still, BSS zeroing does not seem to relate to what you witness. You're
> not reading a variable that you think should be zero; you're writing
> then reading a BSS variable, and find that you read something different
> from what you read.

I'm not doing anything. Thats just what I've cloncluded reading existing 
code. First, clear_bss exists, Second, code in u-boot seems to assume 
that bss is cleared.

I've run into this problem because the following check in 
nand_set_defaults() in nand_base.c:
-------------
        /* check, if a user supplied command function given */ 
 

         if (chip->cmdfunc == NULL) 
 

                 chip->cmdfunc = nand_command; 
 

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

But the board-specific function which presets those values doesn't touch 
chip->cmdfunc (kirkwood_nand.c):

------------------
   int board_nand_init(struct nand_chip *nand) 
 

{ 
 

         nand->options = NAND_COPYBACK | NAND_CACHEPRG | 
NAND_NO_PADDING; 

         nand->ecc.mode = NAND_ECC_SOFT; 
 

         nand->cmd_ctrl = kw_nand_hwcontrol; 
 

         nand->chip_delay = 30; 
 

         nand->select_chip = kw_nand_select_chip; 
 

         return 0; 
 

}
------------------

And nothing else touches those nand_chip structures before they are used.

Regards,

Alexander



More information about the U-Boot mailing list