diff mbox

[U-Boot,v2,07/10] tegra20: add SPL config options for seaboard

Message ID 1338931225-12246-8-git-send-email-amartin@nvidia.com
State Superseded
Headers show

Commit Message

Allen Martin June 5, 2012, 9:20 p.m. UTC
Add SPL options to tegra20 config files and enable SPL build for
seaboard in boards.cfg

Signed-off-by: Allen Martin <amartin@nvidia.com>
---
 boards.cfg                      |    2 +-
 include/configs/seaboard.h      |    6 +++
 include/configs/tegra2-common.h |   17 ++++++++
 include/configs/tegra2-spl.h    |   87 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 111 insertions(+), 1 deletion(-)
 create mode 100644 include/configs/tegra2-spl.h

Comments

Stephen Warren June 6, 2012, 4:44 p.m. UTC | #1
On 06/05/2012 03:20 PM, Allen Martin wrote:
> Add SPL options to tegra20 config files and enable SPL build for
> seaboard in boards.cfg

> diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h

> +/* include overrides for SPL build */
> +#ifdef CONFIG_SPL_BUILD
> +#include "tegra2-spl.h"
> +#endif

Perhaps we should add that to include/configs/tegra2-common-post.h,
which I think all Tegra config headers now include at the end.

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

> +/* Defines for SPL */
> +#define CONFIG_SPL
> +#define CONFIG_SPL_NAND_SIMPLE
> +#define CONFIG_SPL_TEXT_BASE		0x00008000
> +#define CONFIG_SPL_MAX_SIZE		0x00078000
> +#define CONFIG_SYS_SPL_MALLOC_START	0x00080000
> +#define CONFIG_SYS_SPL_MALLOC_SIZE	0x00010000
> +#define CONFIG_SPL_STACK		0x0009fffc
> +
> +#define CONFIG_SPL_LIBCOMMON_SUPPORT
> +#define CONFIG_SPL_LIBGENERIC_SUPPORT
> +#define CONFIG_SPL_SERIAL_SUPPORT

> +#define CONFIG_SPL_POWER_SUPPORT

I'm not sure what that's for?

> +#define CONFIG_SPL_GPIO_SUPPORT

I believe only Seaboard needs that, not all boards. It'd be nice if we
could just ignore the crufy SPI/GPIO switch on Seaboard too and punt
this. Does anyone actually boot Seaboard using SPI? I use NAND and Tom
uses eMMC...

> diff --git a/include/configs/tegra2-spl.h b/include/configs/tegra2-spl.h

> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.

Being a new file, this should be GPLv2 not GPLv2+.

> +/* remove devicetree support */
> +#ifdef CONFIG_OF_CONTROL
> +#undef CONFIG_OF_CONTROL
> +#endif

I don't /think/ #undef complains if the define isn't defined?

Perhaps this (and the others) are better approached by not defining all
these if building SPL though - what if a particular board's SPL actually
wanted any of these?
Allen Martin June 6, 2012, 6:40 p.m. UTC | #2
On Wed, Jun 06, 2012 at 09:44:59AM -0700, Stephen Warren wrote:
> On 06/05/2012 03:20 PM, Allen Martin wrote:
> > Add SPL options to tegra20 config files and enable SPL build for
> > seaboard in boards.cfg
> 
> > diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h
> 
> > +/* include overrides for SPL build */
> > +#ifdef CONFIG_SPL_BUILD
> > +#include "tegra2-spl.h"
> > +#endif
> 
> Perhaps we should add that to include/configs/tegra2-common-post.h,
> which I think all Tegra config headers now include at the end.

Ok.

> 
> > diff --git a/include/configs/tegra2-common.h b/include/configs/tegra2-common.h
> 
> > +/* Defines for SPL */
> > +#define CONFIG_SPL
> > +#define CONFIG_SPL_NAND_SIMPLE
> > +#define CONFIG_SPL_TEXT_BASE		0x00008000
> > +#define CONFIG_SPL_MAX_SIZE		0x00078000
> > +#define CONFIG_SYS_SPL_MALLOC_START	0x00080000
> > +#define CONFIG_SYS_SPL_MALLOC_SIZE	0x00010000
> > +#define CONFIG_SPL_STACK		0x0009fffc
> > +
> > +#define CONFIG_SPL_LIBCOMMON_SUPPORT
> > +#define CONFIG_SPL_LIBGENERIC_SUPPORT
> > +#define CONFIG_SPL_SERIAL_SUPPORT
> 
> > +#define CONFIG_SPL_POWER_SUPPORT
> 
> I'm not sure what that's for?

Hm, I put it in for the PMU driver, but maybe that's not actually
needed in the SPL.  I'll take a look.


> > +#define CONFIG_SPL_GPIO_SUPPORT
> 
> I believe only Seaboard needs that, not all boards. It'd be nice if we
> could just ignore the crufy SPI/GPIO switch on Seaboard too and punt
> this. Does anyone actually boot Seaboard using SPI? I use NAND and Tom
> uses eMMC...

Well I use SPI on my Springbank, but maybe I'm in the minority :^)


> > diff --git a/include/configs/tegra2-spl.h b/include/configs/tegra2-spl.h
> 
> > + * published by the Free Software Foundation; either version 2 of
> > + * the License, or (at your option) any later version.
> 
> Being a new file, this should be GPLv2 not GPLv2+.

Ok.

> 
> > +/* remove devicetree support */
> > +#ifdef CONFIG_OF_CONTROL
> > +#undef CONFIG_OF_CONTROL
> > +#endif
> 
> I don't /think/ #undef complains if the define isn't defined?

I've seen compilers that do, so I was just trying to play it safe.

> 
> Perhaps this (and the others) are better approached by not defining all
> these if building SPL though - what if a particular board's SPL actually
> wanted any of these?

That's what I had in v1 of the patch series, but it ends up adding a
lot of #ifdefs sprinkled through each board config file.  I'd like to
keep the SPL as small and minimal as possible such that it doesn't
need a lot of board specific configuration, just unavoidable things
like UART.

-Allen
Sughosh Ganu June 7, 2012, 7:15 a.m. UTC | #3
On Wed Jun 06, 2012 at 10:44:59AM -0600, Stephen Warren wrote:
> On 06/05/2012 03:20 PM, Allen Martin wrote:

<snip>

> > diff --git a/include/configs/tegra2-spl.h b/include/configs/tegra2-spl.h
> 
> > + * published by the Free Software Foundation; either version 2 of
> > + * the License, or (at your option) any later version.
> 
> Being a new file, this should be GPLv2 not GPLv2+.

  u-boot uses GPLv2+.

http://www.denx.de/wiki/view/U-Boot/Patches#Attributing_Code_Copyrights_Sign
http://www.mail-archive.com/u-boot@lists.denx.de/msg26569.html

-sughosh
Stephen Warren June 7, 2012, 4:36 p.m. UTC | #4
On 06/07/2012 01:15 AM, Sughosh Ganu wrote:
> On Wed Jun 06, 2012 at 10:44:59AM -0600, Stephen Warren wrote:
>> On 06/05/2012 03:20 PM, Allen Martin wrote:
> 
> <snip>
> 
>>> diff --git a/include/configs/tegra2-spl.h b/include/configs/tegra2-spl.h
>>
>>> + * published by the Free Software Foundation; either version 2 of
>>> + * the License, or (at your option) any later version.
>>
>> Being a new file, this should be GPLv2 not GPLv2+.
> 
>   u-boot uses GPLv2+.
> 
> http://www.denx.de/wiki/view/U-Boot/Patches#Attributing_Code_Copyrights_Sign
> http://www.mail-archive.com/u-boot@lists.denx.de/msg26569.html

Sughosh,

I guess I'm a little confused here.

COPYING in the U-Boot source tree states the following:

>   U-Boot is Free Software.  It is copyrighted by Wolfgang Denk and
> many others who contributed code (see the actual source code for
> details).  You can redistribute U-Boot and/or modify it under the
> terms of version 2 of the GNU General Public License as published by
> the Free Software Foundation.  Most of it can also be distributed,
> at your option, under any later version of the GNU General Public
> License -- see individual files for exceptions.

... which explicitly allows for either GPLv2 or GPLv2+ code. There is
certainly GPLv2-only code already in U-Boot. Why do you say that
GPLv2-only code isn't allowed?
Sughosh Ganu June 7, 2012, 5:04 p.m. UTC | #5
On Thu Jun 07, 2012 at 10:36:53AM -0600, Stephen Warren wrote:
> On 06/07/2012 01:15 AM, Sughosh Ganu wrote:
> > On Wed Jun 06, 2012 at 10:44:59AM -0600, Stephen Warren wrote:
> >> On 06/05/2012 03:20 PM, Allen Martin wrote:
> > 
> > <snip>
> > 
> >>> diff --git a/include/configs/tegra2-spl.h b/include/configs/tegra2-spl.h
> >>
> >>> + * published by the Free Software Foundation; either version 2 of
> >>> + * the License, or (at your option) any later version.
> >>
> >> Being a new file, this should be GPLv2 not GPLv2+.
> > 
> >   u-boot uses GPLv2+.
> > 
> > http://www.denx.de/wiki/view/U-Boot/Patches#Attributing_Code_Copyrights_Sign
> > http://www.mail-archive.com/u-boot@lists.denx.de/msg26569.html
> 
> Sughosh,
> 
> I guess I'm a little confused here.
> 
> COPYING in the U-Boot source tree states the following:
> 
> >   U-Boot is Free Software.  It is copyrighted by Wolfgang Denk and
> > many others who contributed code (see the actual source code for
> > details).  You can redistribute U-Boot and/or modify it under the
> > terms of version 2 of the GNU General Public License as published by
> > the Free Software Foundation.  Most of it can also be distributed,
> > at your option, under any later version of the GNU General Public
> > License -- see individual files for exceptions.
> 
> ... which explicitly allows for either GPLv2 or GPLv2+ code. There is
> certainly GPLv2-only code already in U-Boot. Why do you say that
> GPLv2-only code isn't allowed?

  I guess that could be because some of the existing files in u-boot
  are released under GPLv2 only license -- hence a separate mention
  that most of the files can be distributed under any later version
  too . Both Wolfgang and Detlev have stated many a times on the
  mailing list earlier that all new files need to be released under
  GPLv2+, and not GPLv2 only.

-sughosh
Stephen Warren June 7, 2012, 8:02 p.m. UTC | #6
On 06/07/2012 11:04 AM, Sughosh Ganu wrote:
> On Thu Jun 07, 2012 at 10:36:53AM -0600, Stephen Warren wrote:
>> On 06/07/2012 01:15 AM, Sughosh Ganu wrote:
>>> On Wed Jun 06, 2012 at 10:44:59AM -0600, Stephen Warren wrote:
>>>> On 06/05/2012 03:20 PM, Allen Martin wrote:
>>>
>>> <snip>
>>>
>>>>> diff --git a/include/configs/tegra2-spl.h b/include/configs/tegra2-spl.h
>>>>
>>>>> + * published by the Free Software Foundation; either version 2 of
>>>>> + * the License, or (at your option) any later version.
>>>>
>>>> Being a new file, this should be GPLv2 not GPLv2+.
>>>
>>>   u-boot uses GPLv2+.
>>>
>>> http://www.denx.de/wiki/view/U-Boot/Patches#Attributing_Code_Copyrights_Sign
>>> http://www.mail-archive.com/u-boot@lists.denx.de/msg26569.html
>>
>> Sughosh,
>>
>> I guess I'm a little confused here.
>>
>> COPYING in the U-Boot source tree states the following:
>>
>>>   U-Boot is Free Software.  It is copyrighted by Wolfgang Denk and
>>> many others who contributed code (see the actual source code for
>>> details).  You can redistribute U-Boot and/or modify it under the
>>> terms of version 2 of the GNU General Public License as published by
>>> the Free Software Foundation.  Most of it can also be distributed,
>>> at your option, under any later version of the GNU General Public
>>> License -- see individual files for exceptions.
>>
>> ... which explicitly allows for either GPLv2 or GPLv2+ code. There is
>> certainly GPLv2-only code already in U-Boot. Why do you say that
>> GPLv2-only code isn't allowed?
> 
>   I guess that could be because some of the existing files in u-boot
>   are released under GPLv2 only license -- hence a separate mention
>   that most of the files can be distributed under any later version
>   too . Both Wolfgang and Detlev have stated many a times on the
>   mailing list earlier that all new files need to be released under
>   GPLv2+, and not GPLv2 only.

Hmmm. It seems like a good idea for COPYING to be updated to be explicit
re: why that exemption is there, to avoid future confusion.

I assume the requirement for GPLv2+ only applies to new code written for
U-Boot, not existing code that's being taken from or derived from some
other GPLv2-only project?
diff mbox

Patch

diff --git a/boards.cfg b/boards.cfg
index 0e571aa..056a022 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -234,7 +234,7 @@  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
+seaboard                     arm         armv7:arm720t seaboard          nvidia         tegra20
 ventana                      arm         armv7       ventana             nvidia         tegra20
 u8500_href                   arm         armv7       u8500               st-ericsson    u8500
 actux1_4_16                  arm         ixp         actux1              -              -           actux1:FLASH2X2
diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h
index 46d4228..826483d 100644
--- a/include/configs/seaboard.h
+++ b/include/configs/seaboard.h
@@ -108,4 +108,10 @@ 
 #define TEGRA2_DEVICE_SETTINGS	"stdin=serial,tegra-kbc\0" \
 					"stdout=serial\0" \
 					"stderr=serial\0"
+
+/* include overrides for SPL build */
+#ifdef CONFIG_SPL_BUILD
+#include "tegra2-spl.h"
+#endif
+
 #endif /* __CONFIG_H */
diff --git a/include/configs/tegra2-common.h b/include/configs/tegra2-common.h
index 068ce88..8e2732a 100644
--- a/include/configs/tegra2-common.h
+++ b/include/configs/tegra2-common.h
@@ -199,4 +199,21 @@ 
 
 #define CONFIG_TEGRA2_GPIO
 #define CONFIG_CMD_GPIO
+
+/* Defines for SPL */
+#define CONFIG_SPL
+#define CONFIG_SPL_NAND_SIMPLE
+#define CONFIG_SPL_TEXT_BASE		0x00008000
+#define CONFIG_SPL_MAX_SIZE		0x00078000
+#define CONFIG_SYS_SPL_MALLOC_START	0x00080000
+#define CONFIG_SYS_SPL_MALLOC_SIZE	0x00010000
+#define CONFIG_SPL_STACK		0x0009fffc
+
+#define CONFIG_SPL_LIBCOMMON_SUPPORT
+#define CONFIG_SPL_LIBGENERIC_SUPPORT
+#define CONFIG_SPL_SERIAL_SUPPORT
+#define CONFIG_SPL_POWER_SUPPORT
+#define CONFIG_SPL_GPIO_SUPPORT
+#define CONFIG_SPL_LDSCRIPT		"$(CPUDIR)/tegra2/u-boot-spl.lds"
+
 #endif /* __TEGRA2_COMMON_H */
diff --git a/include/configs/tegra2-spl.h b/include/configs/tegra2-spl.h
new file mode 100644
index 0000000..e1afa78
--- /dev/null
+++ b/include/configs/tegra2-spl.h
@@ -0,0 +1,87 @@ 
+/*
+ *  (C) Copyright 2012
+ *  NVIDIA Corporation <www.nvidia.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __TEGRA2_SPL_H
+#define __TEGRA2_SPL_H
+
+/* 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_TEGRA2_MMC
+#undef CONFIG_TEGRA2_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 /* __TEGRA2_SPL_H */