[U-Boot] [PATCH] arm: Allow u-boot to run from offset base address

Jeroen Hofstee dasuboot at myspectrum.nl
Thu May 15 00:41:05 CEST 2014


Hello Darwin,

On wo, 2014-05-14 at 15:05 -0700, Darwin Rambo wrote:

> +#ifdef CONFIG_ARM64
> +	/*
> +	 * Fix relocation if u-boot is not on an aligned address.
> +	 */
> +	{
> +		int offset = CONFIG_SYS_TEXT_BASE % 4096;
> +		if (offset) {
> +			addr += offset;
> +			debug("Relocation Addr bumped to 0x%08lx\n", addr);
> +		}
> +	}
> +#endif
> +

Do you really want to check a define at runtime? Placement is typically
at the end of RAM and allocation goes down, not up as in this patch.
Aren't you overlapping memory here?

>  
>  static int setup_reloc(void)
>  {
> +#ifdef CONFIG_ARM64
> +	/*
> +	 * Fix relocation if u-boot is not on an aligned address.
> +	 */
> +	int offset = CONFIG_SYS_TEXT_BASE % 4096;
> +	if (offset) {
> +		gd->relocaddr += offset;
> +		debug("Relocation Addr bumped to 0x%08lx\n", gd->relocaddr);
> +	}
> +#endif
>  	gd->reloc_off = gd->relocaddr - CONFIG_SYS_TEXT_BASE;
>  	memcpy(gd->new_gd, (char *)gd, sizeof(gd_t));
>  

This is a generic file, hell breaks loose if you start using arch /
board / pre bootloader specific workarounds here afaiac.

lucky for you, I am not a u-boot maintainer, but this looks at least a
bit weird, glancing at it.

Regards,
Jeroen



More information about the U-Boot mailing list