Patchwork [U-Boot,v3,08/14] tegra20: add SPL config options for tegra20 boards

login
register
mail settings
Submitter Allen Martin
Date June 8, 2012, 9:16 p.m.
Message ID <1339190167-20320-9-git-send-email-amartin@nvidia.com>
Download mbox | patch
Permalink /patch/163859/
State Superseded
Headers show

Comments

Allen Martin - June 8, 2012, 9:16 p.m.
Add SPL options to tegra20 config files and enable SPL build for
tegra20 boards in boards.cfg

Signed-off-by: Allen Martin <amartin@nvidia.com>
---
 boards.cfg                            |   18 ++++-----
 include/configs/tegra20-common-post.h |   65 +++++++++++++++++++++++++++++++++
 include/configs/tegra20-common.h      |   18 ++++++++-
 3 files changed, 91 insertions(+), 10 deletions(-)
Stephen Warren - June 9, 2012, 5:19 a.m.
On 06/08/2012 03:16 PM, Allen Martin wrote:
> Add SPL options to tegra20 config files and enable SPL build for
> tegra20 boards in boards.cfg

> diff --git a/include/configs/tegra20-common.h b/include/configs/tegra20-common.h

> @@ -183,7 +183,7 @@
>  #define PHYS_SDRAM_1		TEGRA20_SDRC_CS0
>  #define PHYS_SDRAM_1_SIZE	0x20000000	/* 512M */
>  
> -#define CONFIG_SYS_TEXT_BASE	0x00108000
> +#define CONFIG_SYS_TEXT_BASE	0x00208000

Conceptually this change is fine, I just wonder if we need to move this
up as far as 0x00208000; doesn't that reserve an entire MiB of space for
the SPL, which means the U-Boot image as a whole will always grow an
entire MiB, hence there's another MiB of data to copy from flash when
booting? IIRC, the entire AVP+A9 U-Boot is only very roughly 256K and
presumably the SPL is much smaller, so can we bump this define down a bit?
Allen Martin - June 9, 2012, 6:30 a.m.
On Fri, Jun 08, 2012 at 10:19:02PM -0700, Stephen Warren wrote:
> On 06/08/2012 03:16 PM, Allen Martin wrote:
> > Add SPL options to tegra20 config files and enable SPL build for
> > tegra20 boards in boards.cfg
> 
> > diff --git a/include/configs/tegra20-common.h b/include/configs/tegra20-common.h
> 
> > @@ -183,7 +183,7 @@
> >  #define PHYS_SDRAM_1		TEGRA20_SDRC_CS0
> >  #define PHYS_SDRAM_1_SIZE	0x20000000	/* 512M */
> >  
> > -#define CONFIG_SYS_TEXT_BASE	0x00108000
> > +#define CONFIG_SYS_TEXT_BASE	0x00208000
> 
> Conceptually this change is fine, I just wonder if we need to move this
> up as far as 0x00208000; doesn't that reserve an entire MiB of space for
> the SPL, which means the U-Boot image as a whole will always grow an
> entire MiB, hence there's another MiB of data to copy from flash when
> booting? IIRC, the entire AVP+A9 U-Boot is only very roughly 256K and
> presumably the SPL is much smaller, so can we bump this define down a bit?

Good point.  Part of the problem is I use the gap between the SPL and
normal u-boot for the SPL heap and stack, but that's not really
necessary, I could move them down to before the beginning of the SPL
instead.  I'll try to tighten this up.

-Allen
Simon Glass - June 9, 2012, 6:35 p.m.
Hi Allen,

On Fri, Jun 8, 2012 at 2:16 PM, Allen Martin <amartin@nvidia.com> wrote:

> Add SPL options to tegra20 config files and enable SPL build for
> tegra20 boards in boards.cfg
>
> Signed-off-by: Allen Martin <amartin@nvidia.com>
> ---
>  boards.cfg                            |   18 ++++-----
>  include/configs/tegra20-common-post.h |   65
> +++++++++++++++++++++++++++++++++
>  include/configs/tegra20-common.h      |   18 ++++++++-
>  3 files changed, 91 insertions(+), 10 deletions(-)


> diff --git a/boards.cfg b/boards.cfg
> index 8958ba2..de59585 100644
> --- a/boards.cfg
> +++ b/boards.cfg
> @@ -233,10 +233,10 @@ s5pc210_universal            arm         armv7
> universal_c210      samsung
>  smdk5250                    arm         armv7       smdk5250
>  samsung        exynos
>  smdkv310                    arm         armv7       smdkv310
>  samsung        exynos
>  trats                        arm         armv7       trats
> samsung        exynos
> -harmony                      arm         armv7       harmony
> nvidia         tegra20
> -seaboard                     arm         armv7       seaboard
>  nvidia         tegra20
> -ventana                      arm         armv7       ventana
> nvidia         tegra20
> -whistler                     arm         armv7       whistler
>  nvidia         tegra20
> +harmony                      arm         armv7:arm720t harmony
> nvidia         tegra20
> +seaboard                     arm         armv7:arm720t seaboard
>  nvidia         tegra20
> +ventana                      arm         armv7:arm720t ventana
> nvidia         tegra20
> +whistler                     arm         armv7:arm720t whistler
>  nvidia         tegra20
>  u8500_href                   arm         armv7       u8500
> st-ericsson    u8500
>  actux1_4_16                  arm         ixp         actux1
>  -              -           actux1:FLASH2X2
>  actux1_4_32                  arm         ixp         actux1
>  -              -           actux1:FLASH2X2,RAM_32MB
> @@ -262,11 +262,11 @@ xaeniax                      arm         pxa
>  zipitz2                      arm         pxa
>  colibri_pxa270               arm         pxa         -
> toradex
>  jornada                      arm         sa1100
> -plutux                       arm         armv7       plutux
>  avionic-design tegra20
> -medcom                       arm         armv7       medcom
>  avionic-design tegra20
> -tec                          arm         armv7       tec
> avionic-design tegra20
> -paz00                        arm         armv7       paz00
> compal         tegra20
> -trimslice                    arm         armv7       trimslice
> compulab       tegra20
> +plutux                       arm         armv7:arm720t plutux
>  avionic-design tegra20
> +medcom                       arm         armv7:arm720t medcom
>  avionic-design tegra20
> +tec                          arm         armv7:arm720t tec
> avionic-design tegra20
> +paz00                        arm         armv7:arm720t paz00
> compal         tegra20
> +trimslice                    arm         armv7:arm720t trimslice
> compulab       tegra20
>  atngw100                     avr32       at32ap      -
> atmel          at32ap700x
>  atstk1002                    avr32       at32ap      atstk1000
> atmel          at32ap700x
>  atstk1003                    avr32       at32ap      atstk1000
> atmel          at32ap700x
> diff --git a/include/configs/tegra20-common-post.h
> b/include/configs/tegra20-common-post.h
> index b535934..6b046bd 100644
> --- a/include/configs/tegra20-common-post.h
> +++ b/include/configs/tegra20-common-post.h
> @@ -144,4 +144,69 @@
>        TEGRA20_DEVICE_SETTINGS \
>        BOOTCMDS_COMMON
>
> +/* overrides for SPL build here */
> +#ifdef CONFIG_SPL_BUILD
> +
> +/* remove devicetree support */
> +#ifdef CONFIG_OF_CONTROL
> +#undef CONFIG_OF_CONTROL
> +#endif
> +
> +/* remove SERIAL_MULTI */
> +#ifdef CONFIG_SERIAL_MULTI
> +#undef CONFIG_SERIAL_MULTI
> +#endif
> +
> +/* remove I2C support */
> +#ifdef CONFIG_TEGRA_I2C
> +#undef CONFIG_TEGRA_I2C
> +#endif
> +#ifdef CONFIG_CMD_I2C
> +#undef CONFIG_CMD_I2C
> +#endif
>

This stuff is pretty ugly - would it not be better to make boards not
define this in the CONFIG_SPL_BUILD case in the first place, rather than
overriding them? As an example, I2C might be useful in SPL, but here it
would be hard (or even uglier) to add.


> +
> +/* remove MMC support */
> +#ifdef CONFIG_MMC
> +#undef CONFIG_MMC
> +#endif
> +#ifdef CONFIG_GENERIC_MMC
> +#undef CONFIG_GENERIC_MMC
> +#endif
> +#ifdef CONFIG_TEGRA20_MMC
> +#undef CONFIG_TEGRA20_MMC
> +#endif
> +#ifdef CONFIG_CMD_MMC
> +#undef CONFIG_CMD_MMC
> +#endif
> +
> +/* remove partitions/filesystems */
> +#ifdef CONFIG_DOS_PARTITION
> +#undef CONFIG_DOS_PARTITION
> +#endif
> +#ifdef CONFIG_EFI_PARTITION
> +#undef CONFIG_EFI_PARTITION
> +#endif
> +#ifdef CONFIG_CMD_EXT2
> +#undef CONFIG_CMD_EXT2
> +#endif
> +#ifdef CONFIG_CMD_FAT
> +#undef CONFIG_CMD_FAT
> +#endif
> +
> +/* remove USB */
> +#ifdef CONFIG_USB_EHCI
> +#undef CONFIG_USB_EHCI
> +#endif
> +#ifdef CONFIG_USB_EHCI_TEGRA
> +#undef CONFIG_USB_EHCI_TEGRA
> +#endif
> +#ifdef CONFIG_USB_STORAGE
> +#undef CONFIG_USB_STORAGE
> +#endif
> +#ifdef CONFIG_CMD_USB
> +#undef CONFIG_CMD_USB
> +#endif
> +
> +#endif /* CONFIG_SPL_BUILD */
> +
>  #endif /* __TEGRA20_COMMON_POST_H */
> diff --git a/include/configs/tegra20-common.h
> b/include/configs/tegra20-common.h
> index 731ab52..17c710e 100644
> --- a/include/configs/tegra20-common.h
> +++ b/include/configs/tegra20-common.h
> @@ -183,7 +183,7 @@
>  #define PHYS_SDRAM_1           TEGRA20_SDRC_CS0
>  #define PHYS_SDRAM_1_SIZE      0x20000000      /* 512M */
>
> -#define CONFIG_SYS_TEXT_BASE   0x00108000
> +#define CONFIG_SYS_TEXT_BASE   0x00208000
>

Just a question: can/should SPL be loaded to the internal SRAM instead of
DRAM?


>  #define CONFIG_SYS_SDRAM_BASE  PHYS_SDRAM_1
>
>  #define CONFIG_SYS_INIT_RAM_ADDR       CONFIG_STACKBASE
> @@ -195,4 +195,20 @@
>  #define CONFIG_TEGRA_GPIO
>  #define CONFIG_CMD_GPIO
>  #define CONFIG_CMD_ENTERRCM
> +
> +/* Defines for SPL */
> +#define CONFIG_SPL
> +#define CONFIG_SPL_NAND_SIMPLE
> +#define CONFIG_SPL_TEXT_BASE           0x00108000
> +#define CONFIG_SPL_MAX_SIZE            0x00078000
> +#define CONFIG_SYS_SPL_MALLOC_START    0x00180000
> +#define CONFIG_SYS_SPL_MALLOC_SIZE     0x00010000
> +#define CONFIG_SPL_STACK               0x0019fffc
> +
> +#define CONFIG_SPL_LIBCOMMON_SUPPORT
> +#define CONFIG_SPL_LIBGENERIC_SUPPORT
> +#define CONFIG_SPL_SERIAL_SUPPORT
> +#define CONFIG_SPL_GPIO_SUPPORT
> +#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/tegra20/u-boot-spl.lds"
> +
>  #endif /* __TEGRA20_COMMON_H */
> --
> 1.7.9.5
>
> Regards,
Simon
Allen Martin - June 11, 2012, 7:05 p.m.
On Sat, Jun 09, 2012 at 11:35:29AM -0700, Simon Glass wrote:
> Hi Allen,
> 
> diff --git a/include/configs/tegra20-common-post.h b/include/configs/tegra20-common-post.h
> index b535934..6b046bd 100644
> --- a/include/configs/tegra20-common-post.h
> +++ b/include/configs/tegra20-common-post.h
> @@ -144,4 +144,69 @@
>        TEGRA20_DEVICE_SETTINGS \
>        BOOTCMDS_COMMON
> 
> +/* overrides for SPL build here */
> +#ifdef CONFIG_SPL_BUILD
> +
> +/* remove devicetree support */
> +#ifdef CONFIG_OF_CONTROL
> +#undef CONFIG_OF_CONTROL
> +#endif
> +
> +/* remove SERIAL_MULTI */
> +#ifdef CONFIG_SERIAL_MULTI
> +#undef CONFIG_SERIAL_MULTI
> +#endif
> +
> +/* remove I2C support */
> +#ifdef CONFIG_TEGRA_I2C
> +#undef CONFIG_TEGRA_I2C
> +#endif
> +#ifdef CONFIG_CMD_I2C
> +#undef CONFIG_CMD_I2C
> +#endif
> 
> This stuff is pretty ugly - would it not be better to make boards not define this in the CONFIG_SPL_BUILD case in the first place, rather than overriding them? As an example, I2C might be useful in SPL, but here it would be hard (or even uglier) to add.

That's what I had in previous versions of this series, but it seemed
even uglier, because it requires sprinkling "#ifndef CONFIG_SPL_BUILD"
through each of the tegra20 board configs.

-Allen
Simon Glass - June 11, 2012, 8:17 p.m.
Hi Allen,

On Mon, Jun 11, 2012 at 12:05 PM, Allen Martin <amartin@nvidia.com> wrote:

> On Sat, Jun 09, 2012 at 11:35:29AM -0700, Simon Glass wrote:
> > Hi Allen,
> >
> > diff --git a/include/configs/tegra20-common-post.h
> b/include/configs/tegra20-common-post.h
> > index b535934..6b046bd 100644
> > --- a/include/configs/tegra20-common-post.h
> > +++ b/include/configs/tegra20-common-post.h
> > @@ -144,4 +144,69 @@
> >        TEGRA20_DEVICE_SETTINGS \
> >        BOOTCMDS_COMMON
> >
> > +/* overrides for SPL build here */
> > +#ifdef CONFIG_SPL_BUILD
> > +
> > +/* remove devicetree support */
> > +#ifdef CONFIG_OF_CONTROL
> > +#undef CONFIG_OF_CONTROL
> > +#endif
> > +
> > +/* remove SERIAL_MULTI */
> > +#ifdef CONFIG_SERIAL_MULTI
> > +#undef CONFIG_SERIAL_MULTI
> > +#endif
> > +
> > +/* remove I2C support */
> > +#ifdef CONFIG_TEGRA_I2C
> > +#undef CONFIG_TEGRA_I2C
> > +#endif
> > +#ifdef CONFIG_CMD_I2C
> > +#undef CONFIG_CMD_I2C
> > +#endif
> >
> > This stuff is pretty ugly - would it not be better to make boards not
> define this in the CONFIG_SPL_BUILD case in the first place, rather than
> overriding them? As an example, I2C might be useful in SPL, but here it
> would be hard (or even uglier) to add.
>
> That's what I had in previous versions of this series, but it seemed
> even uglier, because it requires sprinkling "#ifndef CONFIG_SPL_BUILD"
> through each of the tegra20 board configs.
>

Yes, understood.

That is what other boards so, but I suppose there is no requirement to
follow that. So it is fine with me. We can always change it later if we
need to.

Regards
Simon


>
> -Allen
> --
> nvpublic
>

Patch

diff --git a/boards.cfg b/boards.cfg
index 8958ba2..de59585 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -233,10 +233,10 @@  s5pc210_universal            arm         armv7       universal_c210      samsung
 smdk5250		     arm	 armv7	     smdk5250		 samsung	exynos
 smdkv310		     arm	 armv7	     smdkv310		 samsung	exynos
 trats                        arm         armv7       trats               samsung        exynos
-harmony                      arm         armv7       harmony             nvidia         tegra20
-seaboard                     arm         armv7       seaboard            nvidia         tegra20
-ventana                      arm         armv7       ventana             nvidia         tegra20
-whistler                     arm         armv7       whistler            nvidia         tegra20
+harmony                      arm         armv7:arm720t harmony           nvidia         tegra20
+seaboard                     arm         armv7:arm720t seaboard          nvidia         tegra20
+ventana                      arm         armv7:arm720t ventana           nvidia         tegra20
+whistler                     arm         armv7:arm720t whistler          nvidia         tegra20
 u8500_href                   arm         armv7       u8500               st-ericsson    u8500
 actux1_4_16                  arm         ixp         actux1              -              -           actux1:FLASH2X2
 actux1_4_32                  arm         ixp         actux1              -              -           actux1:FLASH2X2,RAM_32MB
@@ -262,11 +262,11 @@  xaeniax                      arm         pxa
 zipitz2                      arm         pxa
 colibri_pxa270               arm         pxa         -                   toradex
 jornada                      arm         sa1100
-plutux                       arm         armv7       plutux              avionic-design tegra20
-medcom                       arm         armv7       medcom              avionic-design tegra20
-tec                          arm         armv7       tec                 avionic-design tegra20
-paz00                        arm         armv7       paz00               compal         tegra20
-trimslice                    arm         armv7       trimslice           compulab       tegra20
+plutux                       arm         armv7:arm720t plutux            avionic-design tegra20
+medcom                       arm         armv7:arm720t medcom            avionic-design tegra20
+tec                          arm         armv7:arm720t tec               avionic-design tegra20
+paz00                        arm         armv7:arm720t paz00             compal         tegra20
+trimslice                    arm         armv7:arm720t trimslice         compulab       tegra20
 atngw100                     avr32       at32ap      -                   atmel          at32ap700x
 atstk1002                    avr32       at32ap      atstk1000           atmel          at32ap700x
 atstk1003                    avr32       at32ap      atstk1000           atmel          at32ap700x
diff --git a/include/configs/tegra20-common-post.h b/include/configs/tegra20-common-post.h
index b535934..6b046bd 100644
--- a/include/configs/tegra20-common-post.h
+++ b/include/configs/tegra20-common-post.h
@@ -144,4 +144,69 @@ 
 	TEGRA20_DEVICE_SETTINGS \
 	BOOTCMDS_COMMON
 
+/* overrides for SPL build here */
+#ifdef CONFIG_SPL_BUILD
+
+/* remove devicetree support */
+#ifdef CONFIG_OF_CONTROL
+#undef CONFIG_OF_CONTROL
+#endif
+
+/* remove SERIAL_MULTI */
+#ifdef CONFIG_SERIAL_MULTI
+#undef CONFIG_SERIAL_MULTI
+#endif
+
+/* remove I2C support */
+#ifdef CONFIG_TEGRA_I2C
+#undef CONFIG_TEGRA_I2C
+#endif
+#ifdef CONFIG_CMD_I2C
+#undef CONFIG_CMD_I2C
+#endif
+
+/* remove MMC support */
+#ifdef CONFIG_MMC
+#undef CONFIG_MMC
+#endif
+#ifdef CONFIG_GENERIC_MMC
+#undef CONFIG_GENERIC_MMC
+#endif
+#ifdef CONFIG_TEGRA20_MMC
+#undef CONFIG_TEGRA20_MMC
+#endif
+#ifdef CONFIG_CMD_MMC
+#undef CONFIG_CMD_MMC
+#endif
+
+/* remove partitions/filesystems */
+#ifdef CONFIG_DOS_PARTITION
+#undef CONFIG_DOS_PARTITION
+#endif
+#ifdef CONFIG_EFI_PARTITION
+#undef CONFIG_EFI_PARTITION
+#endif
+#ifdef CONFIG_CMD_EXT2
+#undef CONFIG_CMD_EXT2
+#endif
+#ifdef CONFIG_CMD_FAT
+#undef CONFIG_CMD_FAT
+#endif
+
+/* remove USB */
+#ifdef CONFIG_USB_EHCI
+#undef CONFIG_USB_EHCI
+#endif
+#ifdef CONFIG_USB_EHCI_TEGRA
+#undef CONFIG_USB_EHCI_TEGRA
+#endif
+#ifdef CONFIG_USB_STORAGE
+#undef CONFIG_USB_STORAGE
+#endif
+#ifdef CONFIG_CMD_USB
+#undef CONFIG_CMD_USB
+#endif
+
+#endif /* CONFIG_SPL_BUILD */
+
 #endif /* __TEGRA20_COMMON_POST_H */
diff --git a/include/configs/tegra20-common.h b/include/configs/tegra20-common.h
index 731ab52..17c710e 100644
--- a/include/configs/tegra20-common.h
+++ b/include/configs/tegra20-common.h
@@ -183,7 +183,7 @@ 
 #define PHYS_SDRAM_1		TEGRA20_SDRC_CS0
 #define PHYS_SDRAM_1_SIZE	0x20000000	/* 512M */
 
-#define CONFIG_SYS_TEXT_BASE	0x00108000
+#define CONFIG_SYS_TEXT_BASE	0x00208000
 #define CONFIG_SYS_SDRAM_BASE	PHYS_SDRAM_1
 
 #define CONFIG_SYS_INIT_RAM_ADDR	CONFIG_STACKBASE
@@ -195,4 +195,20 @@ 
 #define CONFIG_TEGRA_GPIO
 #define CONFIG_CMD_GPIO
 #define CONFIG_CMD_ENTERRCM
+
+/* Defines for SPL */
+#define CONFIG_SPL
+#define CONFIG_SPL_NAND_SIMPLE
+#define CONFIG_SPL_TEXT_BASE		0x00108000
+#define CONFIG_SPL_MAX_SIZE		0x00078000
+#define CONFIG_SYS_SPL_MALLOC_START	0x00180000
+#define CONFIG_SYS_SPL_MALLOC_SIZE	0x00010000
+#define CONFIG_SPL_STACK		0x0019fffc
+
+#define CONFIG_SPL_LIBCOMMON_SUPPORT
+#define CONFIG_SPL_LIBGENERIC_SUPPORT
+#define CONFIG_SPL_SERIAL_SUPPORT
+#define CONFIG_SPL_GPIO_SUPPORT
+#define CONFIG_SPL_LDSCRIPT		"$(CPUDIR)/tegra20/u-boot-spl.lds"
+
 #endif /* __TEGRA20_COMMON_H */