From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Sun, 19 Sep 2010 13:56:30 +0200 Subject: [U-Boot] [PATCH 12/26 v2][NEXT] ARM: add relocation support In-Reply-To: <20100919111710.BFF8F157D71@gemini.denx.de> References: <4C62E8C3.8050006@denx.de> <1284721853-8298-1-git-send-email-hs@denx.de> <1284721853-8298-2-git-send-email-hs@denx.de> <1284721853-8298-3-git-send-email-hs@denx.de> <1284721853-8298-4-git-send-email-hs@denx.de> <1284721853-8298-5-git-send-email-hs@denx.de> <1284721853-8298-6-git-send-email-hs@denx.de> <1284721853-8298-7-git-send-email-hs@denx.de> <1284721853-8298-8-git-send-email-hs@denx.de> <1284721853-8298-9-git-send-email-hs@denx.de> <1284721853-8298-10-git-send-email-hs@denx.de> <1284721853-8298-11-git-send-email-hs@denx.de> <1284721853-8298-12-git-send-email-hs@denx.de> <1284721853-8298-13-git-send-email-hs@denx.de> <20100919111710.BFF8F157D71@gemini.denx.de> Message-ID: <4C95FA6E.8030809@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Wolfgang, Wolfgang Denk wrote: > Dear Heiko Schocher, > > In message <1284721853-8298-13-git-send-email-hs@denx.de> you wrote: >> !! This breaks support for all arm boards !! > > Not only that... > > ... >> diff --git a/nand_spl/nand_boot.c b/nand_spl/nand_boot.c >> index b9fd6f5..18ecbe1 100644 >> --- a/nand_spl/nand_boot.c >> +++ b/nand_spl/nand_boot.c >> @@ -221,6 +221,13 @@ static int nand_load(struct mtd_info *mtd, unsigned int offs, >> return 0; >> } >> >> +#if !defined(CONFIG_SYS_ARM_WITHOUT_RELOC) >> +void board_init_f (ulong bootflag) >> +{ >> + relocate_code (TEXT_BASE - TOTAL_MALLOC_LEN, NULL, TEXT_BASE); >> +} >> +#endif >> + >> /* >> * The main entry for NAND booting. It's necessary that SDRAM is already >> * configured and available since this code loads the main U-Boot image >> diff --git a/nand_spl/nand_boot_fsl_nfc.c b/nand_spl/nand_boot_fsl_nfc.c >> index ea3566b..3105657 100644 >> --- a/nand_spl/nand_boot_fsl_nfc.c >> +++ b/nand_spl/nand_boot_fsl_nfc.c >> @@ -263,6 +263,13 @@ static int nand_load(unsigned int from, unsigned int size, unsigned char *buf) >> return 0; >> } >> >> +#if !defined(CONFIG_SYS_ARM_WITHOUT_RELOC) >> +void board_init_f (ulong bootflag) >> +{ >> + relocate_code (TEXT_BASE - TOTAL_MALLOC_LEN, NULL, TEXT_BASE); >> +} >> +#endif > > This is global code, which is used not only on ARM systems. The > changes break more or less all NAND-booting PowerPC board > configurations. Argh, you are right, thanks for finding this! > I'm currently testing this change: > > -#if !defined(CONFIG_SYS_ARM_WITHOUT_RELOC) > +#if defined(CONFIG_ARM) && !defined(CONFIG_SYS_ARM_WITHOUT_RELOC) > > > If this works, and you are OK with it, I will insert this into the > commit when checking in. I am fine with that, if it works ... but actually I am thinking why this is not needed on PowerPC boards! If I don; t oversee something, they jump in the nand_spl code to board_init_f() from arch/powerpc/lib/board.c, and how fit this in the first nand page? Ahh! ... they(PowerPc boards) have their "own" board_init_f() in nand_spl/board/* code for example like the mpc8313erdb ... Hmm.. don;t know if this is possible for all PowerPc boards, but I think, this should be also possible to move this board_init_f() to a common place, like I did this for arm boards ... Ah, all of this boards have board specific things to initialize in their board_init_f() and then call relocate_code() ... Hmm... So, in the end, I am fine with your suggested change! bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany