public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Allen Martin <amartin@nvidia.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 06/13] mkconfig: add support for SPL CPU
Date: Thu, 21 Jun 2012 17:00:40 -0700	[thread overview]
Message-ID: <1340323247-15512-7-git-send-email-amartin@nvidia.com> (raw)
In-Reply-To: <1340323247-15512-1-git-send-email-amartin@nvidia.com>

Add support for specifying a different 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>
---
 boards.cfg     |    5 +++++
 doc/README.SPL |   12 ++++++++++++
 mkconfig       |   24 ++++++++++++++++--------
 3 files changed, 33 insertions(+), 8 deletions(-)

diff --git a/boards.cfg b/boards.cfg
index f7f1190..8958ba2 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 3e9c695..cc77a56 100755
--- a/mkconfig
+++ b/mkconfig
@@ -59,7 +59,8 @@ CONFIG_NAME="${1%_config}"
 [ "${BOARD_NAME}" ] || BOARD_NAME="${1%_config}"
 
 arch="$2"
-cpu="$3"
+cpu=`echo $3 | awk 'BEGIN {FS = ":"} ; {print $1}'`
+spl_cpu=`echo $3 | awk 'BEGIN {FS = ":"} ; {print $2}'`
 if [ "$4" = "-" ] ; then
 	board=${BOARD_NAME}
 else
@@ -130,13 +131,20 @@ fi
 #
 # Create include file for Make
 #
-echo "ARCH   = ${arch}"  >  config.mk
-echo "CPU    = ${cpu}"   >> config.mk
-echo "BOARD  = ${board}" >> config.mk
-
-[ "${vendor}" ] && echo "VENDOR = ${vendor}" >> config.mk
-
-[ "${soc}"    ] && echo "SOC    = ${soc}"    >> config.mk
+( echo "ARCH   = ${arch}"
+    if [ ! -z "$spl_cpu" ] ; then
+	echo 'ifeq ($(CONFIG_SPL_BUILD),y)'
+	echo "CPU    = ${spl_cpu}"
+	echo "else"
+	echo "CPU    = ${cpu}"
+	echo "endif"
+    else
+	echo "CPU    = ${cpu}"
+    fi
+    echo "BOARD  = ${board}"
+
+    [ "${vendor}" ] && echo "VENDOR = ${vendor}"
+    [ "${soc}"    ] && echo "SOC    = ${soc}" ) > config.mk
 
 # Assign board directory to BOARDIR variable
 if [ -z "${vendor}" ] ; then
-- 
1.7.9.5

  parent reply	other threads:[~2012-06-22  0:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-22  0:00 [U-Boot] [PATCH v4 0/13] split tegra20 arm7 code into separate SPL Allen Martin
2012-06-22  0:00 ` [U-Boot] [PATCH v4 01/13] tegra20: rename tegra2 -> tegra20 Allen Martin
2012-06-22 18:13   ` Stephen Warren
2012-06-22 18:41     ` Allen Martin
2012-06-22  0:00 ` [U-Boot] [PATCH v4 02/13] tegra20: move tegra20 SoC code to arch/arm/cpu/tegra20-common Allen Martin
2012-06-22 18:15   ` Stephen Warren
2012-06-22 18:43     ` Allen Martin
2012-06-22  0:00 ` [U-Boot] [PATCH v4 03/13] tegra20: rename CONFIG_MACH_TEGRA_GENERIC Allen Martin
2012-06-22  0:00 ` [U-Boot] [PATCH v4 04/13] tegra20: tec: add tegra20-common-post.h Allen Martin
2012-06-22  0:00 ` [U-Boot] [PATCH v4 05/13] tegra20: plutux: change obj directory mkdir commands Allen Martin
2012-06-25 17:39   ` Allen Martin
2012-06-22  0:00 ` Allen Martin [this message]
2012-06-22  0:00 ` [U-Boot] [PATCH v4 07/13] ARM: Fix arm720t SPL build Allen Martin
2012-06-22  0:00 ` [U-Boot] [PATCH v4 08/13] tegra20: remove timer_init from " Allen Martin
2012-06-22  0:00 ` [U-Boot] [PATCH v4 09/13] ARM: add tegra20 support to arm720t Allen Martin
2012-06-22  0:00 ` [U-Boot] [PATCH v4 10/13] tegra20: add u-boot-t2.bin target Allen Martin
2012-06-22  0:00 ` [U-Boot] [PATCH v4 11/13] tegra20: move SDRAM param save to later in boot Allen Martin
2012-06-22  0:00 ` [U-Boot] [PATCH v4 12/13] tegra20: enable SPL for tegra20 boards Allen Martin
2012-06-22  0:00 ` [U-Boot] [PATCH v4 13/13] tegra20: Remove armv4t build flags Allen Martin
2012-06-22 18:27   ` Stephen Warren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1340323247-15512-7-git-send-email-amartin@nvidia.com \
    --to=amartin@nvidia.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox