From: Fundu Date: Wed, 23 Jul 2008 08:46:12 -0700 (PDT) Subject: [U-Boot-Users] [patch 1/1] Set GD_FLG_RELOC for boards skipping relocation to RAM In-Reply-To: <20080723172042.414f8df0@hskinnemo-gx745.norway.atmel.com> Message-ID: <157120.54003.qm@web63407.mail.re1.yahoo.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de when would you not want to relocate ? my understanding was when the bootldr come up it first runs the monitor and then relocates to ram and shoots off from there. right ? any clarification would be appreciated. TIA ! > Date: Tue, 22 Jul 2008 14:20:15 +0200 > From: linux at bohmer.net > To: u-boot-users at lists.sourceforge.net; wd at denx.de > CC: joakim.tjernlund at transmode.se > Subject: [U-Boot-Users] [patch 1/1] Set GD_FLG_RELOC for boards skipping relocation to RAM > > If CONFIG_SKIP_RELOCATE_UBOOT is set the flag GD_FLG_RELOC is usually never > set, because relocation to RAM is actually never done by U-boot itself. > However, several pieces of code check if this flag is set at some time. > > So, to make sure this flag is set on boards skipping relocation, this > is added to the initialisation of U-boot at a moment where it is safe > to do so. > > Signed-off-by: Remy Bohmer > --- > lib_arm/board.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > Index: u-boot-git-almost-1.3.4/lib_arm/board.c > =================================================================== > --- u-boot-git-almost-1.3.4.orig/lib_arm/board.c 2008-07-21 11:53:23.000000000 +0200 > +++ u-boot-git-almost-1.3.4/lib_arm/board.c 2008-07-21 12:25:32.000000000 +0200 > @@ -233,6 +233,17 @@ static int init_func_i2c (void) > } > #endif > > +#ifdef CONFIG_SKIP_RELOCATE_UBOOT > +/* > + * This routine sets the relocation done flag, because even if > + * relocation is skipped, the flag is used by other generic code. > + */ > +static int reloc_init(void) > +{ > + gd->flags |= GD_FLG_RELOC; > +} > +#endif > + > /* > * Breathe some life into the board... > * > @@ -262,6 +273,11 @@ int print_cpuinfo (void); /* test-only * > > init_fnc_t *init_sequence[] = { > cpu_init, /* basic cpu dependent setup */ > +#if defined(CONFIG_SKIP_RELOCATE_UBOOT) > + reloc_init, /* Set the relocation done flag, must > + do this AFTER cpu_init(), but as soon > + as possible */ > +#endif > board_init, /* basic board dependent setup */ > interrupt_init, /* set up exceptions */ > env_init, /* initialize environment */ > > -- > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > U-Boot-Users mailing list > U-Boot-Users at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/u-boot-users