From mboxrd@z Thu Jan 1 00:00:00 1970 From: Graeme Russ Date: Sat, 15 Dec 2012 09:15:21 +1100 Subject: [U-Boot] [PATCH 03/10] x86: Permit bootstage and timer data to be used prior to relocation In-Reply-To: <1355519594-5694-3-git-send-email-sjg@chromium.org> References: <1355519594-5694-1-git-send-email-sjg@chromium.org> <1355519594-5694-3-git-send-email-sjg@chromium.org> Message-ID: <50CBA4F9.2010102@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 Hi Simon, On 15/12/12 08:13, Simon Glass wrote: > It is useful to be able to access the timer before U-Boot has relocated > so that we can fully support bootstage. > > Move the relevant variables to the data region to support this. > > Signed-off-by: Simon Glass > --- > arch/x86/cpu/coreboot/coreboot.c | 4 ++-- > arch/x86/cpu/interrupts.c | 2 +- > arch/x86/lib/timer.c | 2 +- > 3 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c > index 9c9431e..22474f5 100644 > --- a/arch/x86/cpu/coreboot/coreboot.c > +++ b/arch/x86/cpu/coreboot/coreboot.c > @@ -68,8 +68,8 @@ int board_early_init_r(void) > void show_boot_progress(int val) > { > #if MIN_PORT80_KCLOCKS_DELAY > - static uint32_t prev_stamp; > - static uint32_t base; > + static uint32_t prev_stamp __attribute__((section(".data"))); > + static uint32_t base __attribute__((section(".data"))); NAK This may work for coreboot where SDRAM is already initialised and you've loaded U-Boot into RAM, but it will not work when U-Boot is in Flash as all sections (including .data) are read-only until after relocation. The stack and Global Data are the only guaranteed read/write locations prior to relocation Regards, Graeme