[U-Boot] [PATCH 12/26 v2][NEXT] ARM: add relocation support

Wolfgang Denk
2010-09-19T11:17:10Z

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.

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.

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The so-called "desktop metaphor" of today's workstations is instead
an "airplane-seat" metaphor. Anyone who has shuffled a lap full of
papers while seated between two portly passengers will recognize the
difference -- one can see only a very few things at once.
- Fred Brooks, Jr.