[U-Boot] [PATCH v2 0/3] Clean out SPL ready for driver model

This series includes a few more patches aimed at getting rid of gdata, the parallel global_data structure introduced on some ARM boards.
This series relies on this patch:
https://patchwork.ozlabs.org/patch/423789/
Changes in v2: - Remove gdata definition from ARM spl header file also
Simon Glass (3): ti: davinci: Remove unnecessary stack and global_data fiddles Revert "Revert "ARM: SPL: do not set gd again"" arm: spl: Avoid setting up a duplicate global data structure
arch/arm/cpu/arm926ejs/davinci/spl.c | 6 +----- arch/arm/include/asm/spl.h | 2 -- arch/arm/lib/spl.c | 12 ------------ 3 files changed, 1 insertion(+), 19 deletions(-)

The stack is already set to CONFIG_SPL_STACK immediately before board_init_f() is called, so this should not be needed.
Also global_data has already been set up so we don't want to mess with it.
Signed-off-by: Simon Glass sjg@chromium.org ---
Changes in v2: None
arch/arm/cpu/arm926ejs/davinci/spl.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c b/arch/arm/cpu/arm926ejs/davinci/spl.c index 59b304e..f8caf2a 100644 --- a/arch/arm/cpu/arm926ejs/davinci/spl.c +++ b/arch/arm/cpu/arm926ejs/davinci/spl.c @@ -36,9 +36,6 @@ void putc(char c)
void board_init_f(ulong dummy) { - /* First, setup our stack pointer. */ - asm volatile("mov sp, %0\n" : : "r"(CONFIG_SPL_STACK)); - /* Second, perform our low-level init. */ #ifdef CONFIG_SOC_DM365 dm36x_lowlevel_init(0); @@ -50,8 +47,7 @@ void board_init_f(ulong dummy) /* Third, we clear the BSS. */ memset(__bss_start, 0, __bss_end - __bss_start);
- /* Finally, setup gd and move to the next step. */ - gd = &gdata; + /* Finally, move to the next step. */ board_init_r(NULL, 0); }

On Mon, Jan 26, 2015 at 09:55:26AM -0700, Simon Glass wrote:
The stack is already set to CONFIG_SPL_STACK immediately before board_init_f() is called, so this should not be needed.
Also global_data has already been set up so we don't want to mess with it.
Signed-off-by: Simon Glass sjg@chromium.org
Changes in v2: None
We should drop this one in favor of the 2 I posted that fixes some other problems and gets the boards booting too (and as a bonus drops the custom board_init_f() func). :)

Hi Tom,
On 26 January 2015 at 10:10, Tom Rini trini@ti.com wrote:
On Mon, Jan 26, 2015 at 09:55:26AM -0700, Simon Glass wrote:
The stack is already set to CONFIG_SPL_STACK immediately before board_init_f() is called, so this should not be needed.
Also global_data has already been set up so we don't want to mess with it.
Signed-off-by: Simon Glass sjg@chromium.org
Changes in v2: None
We should drop this one in favor of the 2 I posted that fixes some other problems and gets the boards booting too (and as a bonus drops the custom board_init_f() func). :)
Yes that's fine, thanks. Please go ahead. One way or another we will get rid of gdata.
Regards, Simon

This reverts commit 1ee30aeed47724eb7c8f145f064b8d03cd294808.
We should now be able to avoid the global_data fiddling that was previously required for some boards. So re-apply this patch that was reverted.
Signed-off-by: Simon Glass sjg@chromium.org ---
Changes in v2: None
arch/arm/lib/spl.c | 3 --- 1 file changed, 3 deletions(-)
diff --git a/arch/arm/lib/spl.c b/arch/arm/lib/spl.c index c41850a..7c9afbd 100644 --- a/arch/arm/lib/spl.c +++ b/arch/arm/lib/spl.c @@ -33,9 +33,6 @@ void __weak board_init_f(ulong dummy) /* Clear the BSS. */ memset(__bss_start, 0, __bss_end - __bss_start);
- /* TODO: Remove settings of the global data pointer here */ - gd = &gdata; - board_init_r(NULL, 0); }

This is already set up in crt0.S. We don't need a new structure and don't really want one in the 'data' section of the image, since it will be empty and crt0.S's changes will be ignored.
Signed-off-by: Simon Glass sjg@chromium.org ---
Changes in v2: - Remove gdata definition from ARM spl header file also
arch/arm/include/asm/spl.h | 2 -- arch/arm/lib/spl.c | 9 --------- 2 files changed, 11 deletions(-)
diff --git a/arch/arm/include/asm/spl.h b/arch/arm/include/asm/spl.h index 8acd7cd..e5dbab0 100644 --- a/arch/arm/include/asm/spl.h +++ b/arch/arm/include/asm/spl.h @@ -33,6 +33,4 @@ enum { /* Linker symbols. */ extern char __bss_start[], __bss_end[];
-extern gd_t gdata; - #endif diff --git a/arch/arm/lib/spl.c b/arch/arm/lib/spl.c index 7c9afbd..6361a62 100644 --- a/arch/arm/lib/spl.c +++ b/arch/arm/lib/spl.c @@ -13,15 +13,6 @@ #include <image.h> #include <linux/compiler.h>
-/* Pointer to as well as the global data structure for SPL */ -DECLARE_GLOBAL_DATA_PTR; - -/* - * WARNING: This is going away very soon. Don't use it and don't submit - * pafches that rely on it. The global_data area is set up in crt0.S. - */ -gd_t gdata __attribute__ ((section(".data"))); - /* * In the context of SPL, board_init_f must ensure that any clocks/etc for * DDR are enabled, ensure that the stack pointer is valid, clear the BSS

Hello Simon,
I'm a bit (read: almost completely) lost re all the gdata removal stuff; seems like there is/was this series, and there is the 9-patch series too, and possibly others... Right now, what patch( seri)es should be applied exactly?
Amicalement,

Hi Albert,
On 24 February 2015 at 23:28, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
Hello Simon,
I'm a bit (read: almost completely) lost re all the gdata removal stuff; seems like there is/was this series, and there is the 9-patch series too, and possibly others... Right now, what patch( seri)es should be applied exactly?
I picked up everything I thought was relevant and sent a v4 series starting here:
http://patchwork.ozlabs.org/patch/438581/
The cover letter is here:
http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/211429
So that is all now.
Regards, Simon

Hi Albert,
On 25 February 2015 at 06:27, Simon Glass sjg@chromium.org wrote:
Hi Albert,
On 24 February 2015 at 23:28, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
Hello Simon,
I'm a bit (read: almost completely) lost re all the gdata removal stuff; seems like there is/was this series, and there is the 9-patch series too, and possibly others... Right now, what patch( seri)es should be applied exactly?
I picked up everything I thought was relevant and sent a v4 series starting here:
http://patchwork.ozlabs.org/patch/438581/
The cover letter is here:
http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/211429
So that is all now.
It does need a rebase due to the mach-tegra file move, but the conflict is trivial. Just in case, I have updated u-boo-dm/spl-working with a rebased version. Let me know if I should send v5.
Regards, Simon

Hello Simon,
On Wed, 25 Feb 2015 07:00:23 -0700, Simon Glass sjg@chromium.org wrote:
Hi Albert,
On 25 February 2015 at 06:27, Simon Glass sjg@chromium.org wrote:
Hi Albert,
On 24 February 2015 at 23:28, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
Hello Simon,
I'm a bit (read: almost completely) lost re all the gdata removal stuff; seems like there is/was this series, and there is the 9-patch series too, and possibly others... Right now, what patch( seri)es should be applied exactly?
I picked up everything I thought was relevant and sent a v4 series starting here:
http://patchwork.ozlabs.org/patch/438581/
The cover letter is here:
http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/211429
So that is all now.
It does need a rebase due to the mach-tegra file move, but the conflict is trivial. Just in case, I have updated u-boo-dm/spl-working with a rebased version. Let me know if I should send v5.
No need for a v5 just for the mach-* move IMO. I'll look at v4.
Regards, Simon
Amicalement,

Hello Albert,
On Wed, 25 Feb 2015 21:57:36 +0100, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
Hello Simon,
On Wed, 25 Feb 2015 07:00:23 -0700, Simon Glass sjg@chromium.org wrote:
Hi Albert,
On 25 February 2015 at 06:27, Simon Glass sjg@chromium.org wrote:
Hi Albert,
On 24 February 2015 at 23:28, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
Hello Simon,
I'm a bit (read: almost completely) lost re all the gdata removal stuff; seems like there is/was this series, and there is the 9-patch series too, and possibly others... Right now, what patch( seri)es should be applied exactly?
I picked up everything I thought was relevant and sent a v4 series starting here:
http://patchwork.ozlabs.org/patch/438581/
The cover letter is here:
http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/211429
So that is all now.
It does need a rebase due to the mach-tegra file move, but the conflict is trivial. Just in case, I have updated u-boo-dm/spl-working with a rebased version. Let me know if I should send v5.
No need for a v5 just for the mach-* move IMO. I'll look at v4.
V4 seems not to apply properly on u-boot[-arm]/master ATM. I'll give a try at u-boot-dm/spl-working.
Amicalement,

Hi Albert,
On 26 February 2015 at 03:34, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
Hello Albert,
On Wed, 25 Feb 2015 21:57:36 +0100, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
Hello Simon,
On Wed, 25 Feb 2015 07:00:23 -0700, Simon Glass sjg@chromium.org wrote:
Hi Albert,
On 25 February 2015 at 06:27, Simon Glass sjg@chromium.org wrote:
Hi Albert,
On 24 February 2015 at 23:28, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
Hello Simon,
I'm a bit (read: almost completely) lost re all the gdata removal stuff; seems like there is/was this series, and there is the 9-patch series too, and possibly others... Right now, what patch( seri)es should be applied exactly?
I picked up everything I thought was relevant and sent a v4 series starting here:
http://patchwork.ozlabs.org/patch/438581/
The cover letter is here:
http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/211429
So that is all now.
It does need a rebase due to the mach-tegra file move, but the conflict is trivial. Just in case, I have updated u-boo-dm/spl-working with a rebased version. Let me know if I should send v5.
No need for a v5 just for the mach-* move IMO. I'll look at v4.
V4 seems not to apply properly on u-boot[-arm]/master ATM. I'll give a try at u-boot-dm/spl-working.
OK, I used mainline and also I rebased so git may have tidied something up. I can resend if you like.
Regards, Simon

Hello Simon,
On Thu, 26 Feb 2015 08:57:05 -0700, Simon Glass sjg@chromium.org wrote:
Hi Albert,
On 26 February 2015 at 03:34, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
Hello Albert,
On Wed, 25 Feb 2015 21:57:36 +0100, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
Hello Simon,
On Wed, 25 Feb 2015 07:00:23 -0700, Simon Glass sjg@chromium.org wrote:
Hi Albert,
On 25 February 2015 at 06:27, Simon Glass sjg@chromium.org wrote:
Hi Albert,
On 24 February 2015 at 23:28, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
Hello Simon,
I'm a bit (read: almost completely) lost re all the gdata removal stuff; seems like there is/was this series, and there is the 9-patch series too, and possibly others... Right now, what patch( seri)es should be applied exactly?
I picked up everything I thought was relevant and sent a v4 series starting here:
http://patchwork.ozlabs.org/patch/438581/
The cover letter is here:
http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/211429
So that is all now.
It does need a rebase due to the mach-tegra file move, but the conflict is trivial. Just in case, I have updated u-boo-dm/spl-working with a rebased version. Let me know if I should send v5.
No need for a v5 just for the mach-* move IMO. I'll look at v4.
V4 seems not to apply properly on u-boot[-arm]/master ATM. I'll give a try at u-boot-dm/spl-working.
OK, I used mainline and also I rebased so git may have tidied something up. I can resend if you like.
Well, if you can re-send rebase over current u-boot[-arm]/master, that would be nice. :)
Regards, Simon
Amicalement,

Hi Albert,
On 26 February 2015 at 10:06, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
Hello Simon,
On Thu, 26 Feb 2015 08:57:05 -0700, Simon Glass sjg@chromium.org wrote:
Hi Albert,
On 26 February 2015 at 03:34, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
Hello Albert,
On Wed, 25 Feb 2015 21:57:36 +0100, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
Hello Simon,
On Wed, 25 Feb 2015 07:00:23 -0700, Simon Glass sjg@chromium.org wrote:
Hi Albert,
On 25 February 2015 at 06:27, Simon Glass sjg@chromium.org wrote:
Hi Albert,
On 24 February 2015 at 23:28, Albert ARIBAUD albert.u.boot@aribaud.net wrote: > Hello Simon, > > I'm a bit (read: almost completely) lost re all the gdata removal stuff; > seems like there is/was this series, and there is the 9-patch series > too, and possibly others... Right now, what patch( seri)es should be > applied exactly?
I picked up everything I thought was relevant and sent a v4 series starting here:
http://patchwork.ozlabs.org/patch/438581/
The cover letter is here:
http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/211429
So that is all now.
It does need a rebase due to the mach-tegra file move, but the conflict is trivial. Just in case, I have updated u-boo-dm/spl-working with a rebased version. Let me know if I should send v5.
No need for a v5 just for the mach-* move IMO. I'll look at v4.
V4 seems not to apply properly on u-boot[-arm]/master ATM. I'll give a try at u-boot-dm/spl-working.
OK, I used mainline and also I rebased so git may have tidied something up. I can resend if you like.
Well, if you can re-send rebase over current u-boot[-arm]/master, that would be nice. :)
But that doesn't include Masahiro's SPL config change, so it doesn't build.
Can you either resync to mainline, or I can apply via the driver model tree if you add your Ack.
I will send v5 just so that it is clean.
Regards, Simon
participants (3)
-
Albert ARIBAUD
-
Simon Glass
-
Tom Rini