From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Holler Date: Sat, 30 Oct 2010 16:07:13 +0200 Subject: [U-Boot] arm: wrong Relocation and not cleared BSS In-Reply-To: <4CCC242C.8070303@free.fr> References: <4CCC18E7.8080708@ahsoftware.de> <4CCC1F6C.7040603@free.fr> <4CCC218E.706@ahsoftware.de> <4CCC242C.8070303@free.fr> Message-ID: <4CCC2691.4070903@ahsoftware.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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