]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - mkconfig
sc_sps_1: Adjust board config to use 'mxs' SoC code
[karo-tx-uboot.git] / mkconfig
index 2fda1d4c416032f41f6fed997a6aaf4356dc8c40..9e1a7e64cc81399085a1530360d54b761f9d2233 100755 (executable)
--- a/mkconfig
+++ b/mkconfig
@@ -29,6 +29,15 @@ if [ \( $# -eq 2 \) -a \( "$1" = "-A" \) ] ; then
        set ${line}
        # add default board name if needed
        [ $# = 3 ] && set ${line} ${1}
+elif [ "${MAKEFLAGS+set}${MAKELEVEL+set}" = "setset" ] ; then
+       # only warn when using a config target in the Makefile
+       cat <<-EOF
+
+       warning: Please migrate to boards.cfg.  Failure to do so will
+                mean removal of your board in the next release.
+
+       EOF
+       sleep 5
 fi
 
 while [ $# -gt 0 ] ; do
@@ -51,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
@@ -98,8 +112,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
@@ -123,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
@@ -149,15 +170,25 @@ 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>
 EOF
 
 exit 0