]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
mkconfig: add support for SPL CPU
authorAllen Martin <amartin@nvidia.com>
Thu, 19 Apr 2012 07:58:57 +0000 (07:58 +0000)
committerWolfgang Denk <wd@denx.de>
Thu, 9 Aug 2012 20:37:42 +0000 (22:37 +0200)
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>
boards.cfg
doc/README.SPL
mkconfig

index 05987632f455d513ccd90cff6531c01614713ce6..becf258e490ab07848e04cc83274743e65c3a53e 100644 (file)
 #      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"):
index 0276953db634159e417c55e93b17b1738886f30c..e4a5ac31f38330b7cd68cdd8ec706e3e7a823c1d 100644 (file)
@@ -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.
index 801f9212965dfb8d624fc0f71a51902f8692e05b..9e1a7e64cc81399085a1530360d54b761f9d2233 100755 (executable)
--- 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