]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/glsdk-u-boot.git/blobdiff - mkconfig
ARM: DRA7xx: Lock DPLL_GMAC
[glsdk/glsdk-u-boot.git] / mkconfig
index 2fda1d4c416032f41f6fed997a6aaf4356dc8c40..73f852ed8adb977af32f988142a0c245d77b6363 100755 (executable)
--- a/mkconfig
+++ b/mkconfig
@@ -50,7 +50,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
@@ -98,8 +99,7 @@ if [ "$SRCTREE" != "$OBJTREE" ] ; then
        ln -s ${SRCTREE}/arch/${arch}/include/asm asm
        LNPREFIX=${SRCTREE}/arch/${arch}/include/asm/
        cd ../include
-       rm -f asm
-       ln -s ${SRCTREE}/arch/${arch}/include/asm asm
+       mkdir -p asm
 else
        cd ./include
        rm -f asm
@@ -122,13 +122,21 @@ 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}"
+    exit 0 ) > config.mk
 
 # Assign board directory to BOARDIR variable
 if [ -z "${vendor}" ] ; then
@@ -149,15 +157,26 @@ fi
 echo "/* Automatically generated - do not edit */" >>config.h
 
 for i in ${TARGETS} ; do
-       i="`echo ${i} | sed '/=/ {s/=/\t/;q } ; { s/$/\t1/ }'`"
+       i="`echo ${i} | sed '/=/ {s/=/  /;q; } ; { s/$/ 1/; }'`"
        echo "#define CONFIG_${i}" >>config.h ;
 done
 
+echo "#define CONFIG_SYS_ARCH  \"${arch}\""  >> config.h
+echo "#define CONFIG_SYS_CPU   \"${cpu}\""   >> config.h
+echo "#define CONFIG_SYS_BOARD \"${board}\"" >> config.h
+
+[ "${vendor}" ] && echo "#define CONFIG_SYS_VENDOR \"${vendor}\"" >> config.h
+
+[ "${soc}"    ] && echo "#define CONFIG_SYS_SOC    \"${soc}\""    >> config.h
+
 cat << EOF >> config.h
 #define CONFIG_BOARDDIR board/$BOARDDIR
+#include <config_cmd_defaults.h>
 #include <config_defaults.h>
 #include <configs/${CONFIG_NAME}.h>
 #include <asm/config.h>
+#include <config_fallbacks.h>
+#include <config_uncmd_spl.h>
 EOF
 
 exit 0