X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=mkconfig;h=7c9aa74eb27ffc8274832fdb49b003229c10f24a;hb=39c7a2635227f5754393e954cb57249328e83cee;hp=ecb6d4ef4f064fd647c06e3bcce7f6ea70ee1107;hpb=0886eef9ba25b9e8da4bbaefc1a0b6da7a9567dc;p=platform%2Fkernel%2Fu-boot.git diff --git a/mkconfig b/mkconfig index ecb6d4e..7c9aa74 100755 --- 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 @@ -50,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 @@ -121,13 +131,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 @@ -152,12 +170,22 @@ for i in ${TARGETS} ; do 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 #include #include #include +#include +#include EOF exit 0