[U-Boot] [PATCH 3/4] at91sam9261/g10: support relocation

Andreas Bießmann andreas.devel at googlemail.com
Mon Apr 18 11:32:48 CEST 2011


Dear Alessandro Rubini,

Am 18.04.2011 11:21, schrieb Alessandro Rubini:
> This adds support for relocation, but won't work for the default
> settings whereas AT91Boot loads u-boot to the last meg and it then
> tries to relocate slightly later, thus overwriting itself.
> 
> Signed-off-by: Alessandro Rubini <rubini at gnudd.com>
> ---
>  board/atmel/at91sam9261ek/at91sam9261ek.c |    3 +--
>  include/configs/at91sam9261ek.h           |    4 ++++
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/board/atmel/at91sam9261ek/at91sam9261ek.c b/board/atmel/at91sam9261ek/at91sam9261ek.c
> index de5cfae..ec1d2a3 100644
> --- a/board/atmel/at91sam9261ek/at91sam9261ek.c
> +++ b/board/atmel/at91sam9261ek/at91sam9261ek.c
> @@ -273,8 +273,7 @@ int board_eth_init(bd_t *bis)
>  
>  int dram_init(void)
>  {
> -	gd->bd->bi_dram[0].start = PHYS_SDRAM;
> -	gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
> +	gd->ram_size = get_ram_size(PHYS_SDRAM, PHYS_SDRAM_SIZE);

please stop using this PHYS_SDRAM macros. They where replaced by
CONFIG_SYS_SDRAM_(BASE|SIZE).

>  	return 0;
>  }
>  
> diff --git a/include/configs/at91sam9261ek.h b/include/configs/at91sam9261ek.h
> index 401478b..71a4357 100644
> --- a/include/configs/at91sam9261ek.h
> +++ b/include/configs/at91sam9261ek.h
> @@ -30,6 +30,7 @@
>  #define CONFIG_AT91_LEGACY
>  
>  /* ARM asynchronous clock */
> +#define CONFIG_AT91FAMILY

CONFIG_AT91FAMILY is defined in some asm/arch/hardware.h files. You will
get 'double definition' errors here. The best solution is currently to
include asm/hardware.h in board config right after the correct SoC
define. I have started a discussion on that problem yesterday evening ->
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/97903

>  #define CONFIG_SYS_AT91_MAIN_CLOCK	18432000	/* 18.432 MHz crystal */

I guess SLOW_CLOCK is missing here ...

>  #define CONFIG_SYS_HZ		1000
>  
> @@ -110,6 +111,9 @@
>  #define CONFIG_NR_DRAM_BANKS		1
>  #define PHYS_SDRAM			0x20000000
>  #define PHYS_SDRAM_SIZE			0x04000000	/* 64 megs */
> +#define CONFIG_SYS_SDRAM_BASE		0x20000000

just replace the PHYS_SDRAM defines by CONFIG_SYS_SDRAM defines.

> +#define CONFIG_SYS_INIT_SP_ADDR		0x20100000	/* within RAM is ok */
> +

I recommend to use SRAM here, see top900(0) header for example.


>  
>  /* DataFlash */
>  #define CONFIG_ATMEL_DATAFLASH_SPI

regards

Andreas Bießmann


More information about the U-Boot mailing list