* [U-Boot] [PATCH] Revert "ARM: SPL: do not set gd again"
@ 2014-09-17 0:27 Tom Rini
2014-09-17 0:47 ` Tom Rini
0 siblings, 1 reply; 7+ messages in thread
From: Tom Rini @ 2014-09-17 0:27 UTC (permalink / raw)
To: u-boot
At the high level, the problem is that we set gd multiple times (and
still do, even after the commit we're reverting). We set important
parts of gd to the copy which is not above stack but rather in the data
section. For the release, we're going to revert this change and for the
next release we shall correct things to only, really, set gd once to an
appropriate location and ensure that comments about it are correct too.
This reverts commit f0c3a6c4ad09210d5d4aeafe87685ee75e5683d6.
Acked-by: Albert Aribaud <albert.u.boot@aribaud.net>
Signed-off-by: Tom Rini <trini@ti.com>
---
arch/arm/lib/spl.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm/lib/spl.c b/arch/arm/lib/spl.c
index 75ab546..dfcc596 100644
--- a/arch/arm/lib/spl.c
+++ b/arch/arm/lib/spl.c
@@ -28,6 +28,9 @@ void __weak board_init_f(ulong dummy)
/* Clear the BSS. */
memset(__bss_start, 0, __bss_end - __bss_start);
+ /* Set global data pointer. */
+ gd = &gdata;
+
board_init_r(NULL, 0);
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] Revert "ARM: SPL: do not set gd again"
2014-09-17 0:27 [U-Boot] [PATCH] Revert "ARM: SPL: do not set gd again" Tom Rini
@ 2014-09-17 0:47 ` Tom Rini
2014-11-10 22:13 ` Simon Glass
0 siblings, 1 reply; 7+ messages in thread
From: Tom Rini @ 2014-09-17 0:47 UTC (permalink / raw)
To: u-boot
On Tue, Sep 16, 2014 at 08:27:23PM -0400, Tom Rini wrote:
> At the high level, the problem is that we set gd multiple times (and
> still do, even after the commit we're reverting). We set important
> parts of gd to the copy which is not above stack but rather in the data
> section. For the release, we're going to revert this change and for the
> next release we shall correct things to only, really, set gd once to an
> appropriate location and ensure that comments about it are correct too.
>
> This reverts commit f0c3a6c4ad09210d5d4aeafe87685ee75e5683d6.
>
> Acked-by: Albert Aribaud <albert.u.boot@aribaud.net>
> Signed-off-by: Tom Rini <trini@ti.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140916/99f7cd63/attachment.pgp>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] Revert "ARM: SPL: do not set gd again"
2014-09-17 0:47 ` Tom Rini
@ 2014-11-10 22:13 ` Simon Glass
2014-11-11 21:57 ` Tom Rini
0 siblings, 1 reply; 7+ messages in thread
From: Simon Glass @ 2014-11-10 22:13 UTC (permalink / raw)
To: u-boot
+Albert
Hi Tom,
On 16 September 2014 18:47, Tom Rini <trini@ti.com> wrote:
>
> On Tue, Sep 16, 2014 at 08:27:23PM -0400, Tom Rini wrote:
>
> > At the high level, the problem is that we set gd multiple times (and
> > still do, even after the commit we're reverting). We set important
> > parts of gd to the copy which is not above stack but rather in the data
> > section. For the release, we're going to revert this change and for the
> > next release we shall correct things to only, really, set gd once to an
> > appropriate location and ensure that comments about it are correct too.
> >
> > This reverts commit f0c3a6c4ad09210d5d4aeafe87685ee75e5683d6.
> >
> > Acked-by: Albert Aribaud <albert.u.boot@aribaud.net>
> > Signed-off-by: Tom Rini <trini@ti.com>
>
> Applied to u-boot/master, thanks!
Is this going to be un-reverted? I will need this done to apply the
driver model SPL series.
Regards,
Simon
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] Revert "ARM: SPL: do not set gd again"
2014-11-10 22:13 ` Simon Glass
@ 2014-11-11 21:57 ` Tom Rini
2014-11-12 0:59 ` Simon Glass
2014-11-28 21:48 ` Jeroen Hofstee
0 siblings, 2 replies; 7+ messages in thread
From: Tom Rini @ 2014-11-11 21:57 UTC (permalink / raw)
To: u-boot
On Mon, Nov 10, 2014 at 03:13:44PM -0700, Simon Glass wrote:
> +Albert
>
> Hi Tom,
>
> On 16 September 2014 18:47, Tom Rini <trini@ti.com> wrote:
> >
> > On Tue, Sep 16, 2014 at 08:27:23PM -0400, Tom Rini wrote:
> >
> > > At the high level, the problem is that we set gd multiple times (and
> > > still do, even after the commit we're reverting). We set important
> > > parts of gd to the copy which is not above stack but rather in the data
> > > section. For the release, we're going to revert this change and for the
> > > next release we shall correct things to only, really, set gd once to an
> > > appropriate location and ensure that comments about it are correct too.
> > >
> > > This reverts commit f0c3a6c4ad09210d5d4aeafe87685ee75e5683d6.
> > >
> > > Acked-by: Albert Aribaud <albert.u.boot@aribaud.net>
> > > Signed-off-by: Tom Rini <trini@ti.com>
> >
> > Applied to u-boot/master, thanks!
>
> Is this going to be un-reverted? I will need this done to apply the
> driver model SPL series.
So I've got am335x working again locally and now I'm trying to see if we
need to introduce a SoC-specific board_init_f for SPL here or not or if
I can shove save_omap_boot_params() into spl_board_init() and add
preloader_console_init rather generically to the ARM board_init_f SPL
function. Once I've got this clean enough I need to dust off some
davinci and omap3 targets, do similar changes and then see if Hans was
right about why my olimex Allwinner board was behaving badly, and if so,
test the changes there too. That'll cover most of the ARM boards that
re-set gd themselves when they can't with the above change
re-introduced.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141111/a2149796/attachment.pgp>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] Revert "ARM: SPL: do not set gd again"
2014-11-11 21:57 ` Tom Rini
@ 2014-11-12 0:59 ` Simon Glass
2014-11-28 21:48 ` Jeroen Hofstee
1 sibling, 0 replies; 7+ messages in thread
From: Simon Glass @ 2014-11-12 0:59 UTC (permalink / raw)
To: u-boot
Hi Tom,
On 11 November 2014 14:57, Tom Rini <trini@ti.com> wrote:
> On Mon, Nov 10, 2014 at 03:13:44PM -0700, Simon Glass wrote:
>> +Albert
>>
>> Hi Tom,
>>
>> On 16 September 2014 18:47, Tom Rini <trini@ti.com> wrote:
>> >
>> > On Tue, Sep 16, 2014 at 08:27:23PM -0400, Tom Rini wrote:
>> >
>> > > At the high level, the problem is that we set gd multiple times (and
>> > > still do, even after the commit we're reverting). We set important
>> > > parts of gd to the copy which is not above stack but rather in the data
>> > > section. For the release, we're going to revert this change and for the
>> > > next release we shall correct things to only, really, set gd once to an
>> > > appropriate location and ensure that comments about it are correct too.
>> > >
>> > > This reverts commit f0c3a6c4ad09210d5d4aeafe87685ee75e5683d6.
>> > >
>> > > Acked-by: Albert Aribaud <albert.u.boot@aribaud.net>
>> > > Signed-off-by: Tom Rini <trini@ti.com>
>> >
>> > Applied to u-boot/master, thanks!
>>
>> Is this going to be un-reverted? I will need this done to apply the
>> driver model SPL series.
>
> So I've got am335x working again locally and now I'm trying to see if we
> need to introduce a SoC-specific board_init_f for SPL here or not or if
> I can shove save_omap_boot_params() into spl_board_init() and add
> preloader_console_init rather generically to the ARM board_init_f SPL
> function. Once I've got this clean enough I need to dust off some
> davinci and omap3 targets, do similar changes and then see if Hans was
> right about why my olimex Allwinner board was behaving badly, and if so,
> test the changes there too. That'll cover most of the ARM boards that
> re-set gd themselves when they can't with the above change
> re-introduced.
OK thanks. I might pull in some of the non-dependent patches in the meantime.
Regards,
Simon
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] Revert "ARM: SPL: do not set gd again"
2014-11-11 21:57 ` Tom Rini
2014-11-12 0:59 ` Simon Glass
@ 2014-11-28 21:48 ` Jeroen Hofstee
2014-12-04 14:16 ` Tom Rini
1 sibling, 1 reply; 7+ messages in thread
From: Jeroen Hofstee @ 2014-11-28 21:48 UTC (permalink / raw)
To: u-boot
Hi all,
On 11-11-14 22:57, Tom Rini wrote:
> On Mon, Nov 10, 2014 at 03:13:44PM -0700, Simon Glass wrote:
>> +Albert
>>
>> Hi Tom,
>>
>> On 16 September 2014 18:47, Tom Rini <trini@ti.com> wrote:
>>> On Tue, Sep 16, 2014 at 08:27:23PM -0400, Tom Rini wrote:
>>>
>>>> At the high level, the problem is that we set gd multiple times (and
>>>> still do, even after the commit we're reverting). We set important
>>>> parts of gd to the copy which is not above stack but rather in the data
>>>> section. For the release, we're going to revert this change and for the
>>>> next release we shall correct things to only, really, set gd once to an
>>>> appropriate location and ensure that comments about it are correct too.
>>>>
>>>> This reverts commit f0c3a6c4ad09210d5d4aeafe87685ee75e5683d6.
>>>>
>>>> Acked-by: Albert Aribaud <albert.u.boot@aribaud.net>
>>>> Signed-off-by: Tom Rini <trini@ti.com>
>>> Applied to u-boot/master, thanks!
>> Is this going to be un-reverted? I will need this done to apply the
>> driver model SPL series.
> So I've got am335x working again locally and now I'm trying to see if we
> need to introduce a SoC-specific board_init_f for SPL here or not or if
> I can shove save_omap_boot_params() into spl_board_init() and add
> preloader_console_init rather generically to the ARM board_init_f SPL
> function. Once I've got this clean enough I need to dust off some
> davinci and omap3 targets, do similar changes and then see if Hans was
> right about why my olimex Allwinner board was behaving badly, and if so,
> test the changes there too. That'll cover most of the ARM boards that
> re-set gd themselves when they can't with the above change
> re-introduced.
>
>
Any progress on this?
Regards,
Jeroen
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] Revert "ARM: SPL: do not set gd again"
2014-11-28 21:48 ` Jeroen Hofstee
@ 2014-12-04 14:16 ` Tom Rini
0 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2014-12-04 14:16 UTC (permalink / raw)
To: u-boot
On Fri, Nov 28, 2014 at 10:48:37PM +0100, Jeroen Hofstee wrote:
> Hi all,
>
> On 11-11-14 22:57, Tom Rini wrote:
> >On Mon, Nov 10, 2014 at 03:13:44PM -0700, Simon Glass wrote:
> >>+Albert
> >>
> >>Hi Tom,
> >>
> >>On 16 September 2014 18:47, Tom Rini <trini@ti.com> wrote:
> >>>On Tue, Sep 16, 2014 at 08:27:23PM -0400, Tom Rini wrote:
> >>>
> >>>>At the high level, the problem is that we set gd multiple times (and
> >>>>still do, even after the commit we're reverting). We set important
> >>>>parts of gd to the copy which is not above stack but rather in the data
> >>>>section. For the release, we're going to revert this change and for the
> >>>>next release we shall correct things to only, really, set gd once to an
> >>>>appropriate location and ensure that comments about it are correct too.
> >>>>
> >>>>This reverts commit f0c3a6c4ad09210d5d4aeafe87685ee75e5683d6.
> >>>>
> >>>>Acked-by: Albert Aribaud <albert.u.boot@aribaud.net>
> >>>>Signed-off-by: Tom Rini <trini@ti.com>
> >>>Applied to u-boot/master, thanks!
> >>Is this going to be un-reverted? I will need this done to apply the
> >>driver model SPL series.
> >So I've got am335x working again locally and now I'm trying to see if we
> >need to introduce a SoC-specific board_init_f for SPL here or not or if
> >I can shove save_omap_boot_params() into spl_board_init() and add
> >preloader_console_init rather generically to the ARM board_init_f SPL
> >function. Once I've got this clean enough I need to dust off some
> >davinci and omap3 targets, do similar changes and then see if Hans was
> >right about why my olimex Allwinner board was behaving badly, and if so,
> >test the changes there too. That'll cover most of the ARM boards that
> >re-set gd themselves when they can't with the above change
> >re-introduced.
>
> Any progress on this?
Not really. I got as far as the following (which of course breaks
non-TI ARMv7 boards):
diff --git a/arch/arm/cpu/armv7/am33xx/board.c b/arch/arm/cpu/armv7/am33xx/board.c
index 29b1d73..7681025 100644
--- a/arch/arm/cpu/armv7/am33xx/board.c
+++ b/arch/arm/cpu/armv7/am33xx/board.c
@@ -302,9 +302,6 @@ void s_init(void)
gd->baudrate = CONFIG_BAUDRATE;
serial_init();
gd->have_console = 1;
-#elif defined(CONFIG_SPL_BUILD)
- gd = &gdata;
- preloader_console_init();
#endif
#if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC)
/* Enable RTC32K clock */
diff --git a/arch/arm/lib/spl.c b/arch/arm/lib/spl.c
index dfcc596..1e0be2a 100644
--- a/arch/arm/lib/spl.c
+++ b/arch/arm/lib/spl.c
@@ -28,8 +28,16 @@ void __weak board_init_f(ulong dummy)
/* Clear the BSS. */
memset(__bss_start, 0, __bss_end - __bss_start);
- /* Set global data pointer. */
- gd = &gdata;
+ /*
+ * Save the boot parameters passed from romcode.
+ * We cannot delay the saving further than this,
+ * to prevent overwrites.
+ */
+#ifdef CONFIG_SPL_BUILD
+ save_omap_boot_params();
+#endif
+
+ preloader_console_init();
board_init_r(NULL, 0);
}
It needs testing on more TI boards to make sure there's nothing else
missing (and there's probably some similar tweaks needed on other TI
platforms even). That we can move the save_omap_boot_params call later
(and duplicate calling it, even) bodes fairly well for an easy
conversion to perphaps spl_board_init() on these boards.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141204/920919a1/attachment.pgp>
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-12-04 14:16 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-17 0:27 [U-Boot] [PATCH] Revert "ARM: SPL: do not set gd again" Tom Rini
2014-09-17 0:47 ` Tom Rini
2014-11-10 22:13 ` Simon Glass
2014-11-11 21:57 ` Tom Rini
2014-11-12 0:59 ` Simon Glass
2014-11-28 21:48 ` Jeroen Hofstee
2014-12-04 14:16 ` Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox