* [U-Boot] [PATCH] mkconfig: add support for SPL CPU
@ 2012-04-19 17:58 Allen Martin
2012-08-09 20:38 ` Wolfgang Denk
0 siblings, 1 reply; 3+ messages in thread
From: Allen Martin @ 2012-04-19 17:58 UTC (permalink / raw)
To: u-boot
Add support for specifying a differnt CPU for main u-boot and SPL
u-boot builds. This is done by adding an optional SPL CPU after the
main CPU in boards.cfg as follows:
normal_cpu:spl_cpu
This this case CPU will be set to "normal_cpu" during the main u-boot
build and "spl_cpu" during the SPL build.
Signed-off-by: Allen Martin <amartin@nvidia.com>
---
This is part of my patch series to move all armv4t code out of tegra
u-boot to an SPL. I haven't heard any suggestions on how to resolve
having a different CPU for the SPL build, so this is my suggestion
as a possible solution.
boards.cfg | 5 +++++
doc/README.SPL | 12 ++++++++++++
mkconfig | 15 ++++++++++++++-
3 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/boards.cfg b/boards.cfg
index 3cf75c3..a58cd02 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -11,6 +11,11 @@
# Lines starting with '#' are comments.
# Blank lines are ignored.
#
+# The CPU field takes the form:
+# cpu[:spl_cpu]
+# If spl_cpu is specified the make variable CPU will be set to this
+# during the SPL build.
+#
# The options field takes the form:
# <board config name>[:comma separated config options]
# Each config option has the form (value defaults to "1"):
diff --git a/doc/README.SPL b/doc/README.SPL
index 0276953..e4a5ac3 100644
--- a/doc/README.SPL
+++ b/doc/README.SPL
@@ -66,3 +66,15 @@ CONFIG_SPL_DMA_SUPPORT (drivers/dma/libdma.o)
CONFIG_SPL_POST_MEM_SUPPORT (post/drivers/memory.o)
CONFIG_SPL_NAND_LOAD (drivers/mtd/nand/nand_spl_load.o)
CONFIG_SPL_SPI_LOAD (drivers/mtd/spi/spi_spl_load.o)
+
+
+Normally CPU is assumed to be the same between the SPL and normal
+u-boot build. However it is possible to specify a different CPU for
+the SPL build for cases where the SPL is expected to run on a
+different CPU model from the main u-boot. This is done by specifying
+an SPL CPU in boards.cfg as follows:
+
+ normal_cpu:spl_cpu
+
+This this case CPU will be set to "normal_cpu" during the main u-boot
+build and "spl_cpu" during the SPL build.
diff --git a/mkconfig b/mkconfig
index 438530b..82660a6 100755
--- a/mkconfig
+++ b/mkconfig
@@ -60,6 +60,11 @@ CONFIG_NAME="${1%_config}"
arch="$2"
cpu="$3"
+tmp="${cpu#*:}"
+if [ "$tmp" != "$cpu" ] ; then
+ spl_cpu=$tmp
+ cpu="${cpu%:*}"
+fi
if [ "$4" = "-" ] ; then
board=${BOARD_NAME}
else
@@ -131,7 +136,15 @@ fi
# Create include file for Make
#
echo "ARCH = ${arch}" > config.mk
-echo "CPU = ${cpu}" >> config.mk
+if [ ! -z "$spl_cpu" ] ; then
+ echo 'ifeq ($(CONFIG_SPL_BUILD),y)' >> config.mk
+ echo "CPU = ${spl_cpu}" >> config.mk
+ echo "else" >> config.mk
+ echo "CPU = ${cpu}" >> config.mk
+ echo "endif" >> config.mk
+else
+ echo "CPU = ${cpu}" >> config.mk
+fi
echo "BOARD = ${board}" >> config.mk
[ "${vendor}" ] && echo "VENDOR = ${vendor}" >> config.mk
--
1.7.5.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* [U-Boot] [PATCH] mkconfig: add support for SPL CPU
2012-04-19 17:58 [U-Boot] [PATCH] mkconfig: add support for SPL CPU Allen Martin
@ 2012-08-09 20:38 ` Wolfgang Denk
2012-08-15 21:47 ` Allen Martin
0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Denk @ 2012-08-09 20:38 UTC (permalink / raw)
To: u-boot
Dear Allen Martin,
In message <1334858337-2853-1-git-send-email-amartin@nvidia.com> you wrote:
> Add support for specifying a differnt CPU for main u-boot and SPL
> u-boot builds. This is done by adding an optional SPL CPU after the
> main CPU in boards.cfg as follows:
>
> normal_cpu:spl_cpu
>
> This this case CPU will be set to "normal_cpu" during the main u-boot
> build and "spl_cpu" during the SPL build.
>
> Signed-off-by: Allen Martin <amartin@nvidia.com>
> ---
> This is part of my patch series to move all armv4t code out of tegra
> u-boot to an SPL. I haven't heard any suggestions on how to resolve
> having a different CPU for the SPL build, so this is my suggestion
> as a possible solution.
>
> boards.cfg | 5 +++++
> doc/README.SPL | 12 ++++++++++++
> mkconfig | 15 ++++++++++++++-
> 3 files changed, 31 insertions(+), 1 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Beauty is transitory." "Beauty survives."
-- Spock and Kirk, "That Which Survives", stardate unknown
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] mkconfig: add support for SPL CPU
2012-08-09 20:38 ` Wolfgang Denk
@ 2012-08-15 21:47 ` Allen Martin
0 siblings, 0 replies; 3+ messages in thread
From: Allen Martin @ 2012-08-15 21:47 UTC (permalink / raw)
To: u-boot
On Thu, Aug 09, 2012 at 01:38:19PM -0700, Wolfgang Denk wrote:
> Dear Allen Martin,
>
> In message <1334858337-2853-1-git-send-email-amartin@nvidia.com> you wrote:
> > Add support for specifying a differnt CPU for main u-boot and SPL
> > u-boot builds. This is done by adding an optional SPL CPU after the
> > main CPU in boards.cfg as follows:
> >
> > normal_cpu:spl_cpu
> >
> > This this case CPU will be set to "normal_cpu" during the main u-boot
> > build and "spl_cpu" during the SPL build.
> >
> > Signed-off-by: Allen Martin <amartin@nvidia.com>
> > ---
> > This is part of my patch series to move all armv4t code out of tegra
> > u-boot to an SPL. I haven't heard any suggestions on how to resolve
> > having a different CPU for the SPL build, so this is my suggestion
> > as a possible solution.
> >
> > boards.cfg | 5 +++++
> > doc/README.SPL | 12 ++++++++++++
> > mkconfig | 15 ++++++++++++++-
> > 3 files changed, 31 insertions(+), 1 deletions(-)
>
> Applied, thanks.
>
Thanks. There's a newer version of this patch that we've been
carrying in the tegra tree. Tom I'll need to rebase that patch on
top of this or they will collide the next time tegra merges up.
-Allen
--
nvpublic
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-15 21:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-19 17:58 [U-Boot] [PATCH] mkconfig: add support for SPL CPU Allen Martin
2012-08-09 20:38 ` Wolfgang Denk
2012-08-15 21:47 ` Allen Martin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox