From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Andreas_Bie=DFmann?= Date: Mon, 18 Apr 2011 11:32:48 +0200 Subject: [U-Boot] [PATCH 3/4] at91sam9261/g10: support relocation In-Reply-To: <479c17df224bd1f1d8e5c1e19fa428f6cb802137.1303118067.git.rubini@gnudd.com> References: <82e06e94bd8fce0bb50e7e4347dfaffa43c4b2d3.1303118067.git.rubini@gnudd.com> <479c17df224bd1f1d8e5c1e19fa428f6cb802137.1303118067.git.rubini@gnudd.com> Message-ID: <4DAC0540.9070904@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > --- > 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