3 # Script to create header files and links to configure
4 # U-Boot for a specific board.
6 # Parameters: Target Architecture CPU Board [VENDOR] [SOC]
8 # (C) 2002-2006 DENX Software Engineering, Wolfgang Denk <wd@denx.de>
11 APPEND=no # Default: Create new config file
12 BOARD_NAME="" # Name to print in make output
15 while [ $# -gt 0 ] ; do
18 -a) shift ; APPEND=yes ;;
19 -n) shift ; BOARD_NAME="${1%%_config}" ; shift ;;
20 -t) shift ; TARGETS="`echo $1 | sed 's:_: :g'` ${TARGETS}" ; shift ;;
25 [ "${BOARD_NAME}" ] || BOARD_NAME="$1"
27 [ $# -lt 4 ] && exit 1
28 [ $# -gt 6 ] && exit 1
30 if [ "${ARCH}" -a "${ARCH}" != "$2" ]; then
31 echo "Failed: \$ARCH=${ARCH}, should be '$2' for ${BOARD_NAME}" 1>&2
35 echo "Configuring for ${BOARD_NAME} board..."
38 # Create link to architecture specific headers
40 if [ "$SRCTREE" != "$OBJTREE" ] ; then
41 mkdir -p ${OBJTREE}/include
42 mkdir -p ${OBJTREE}/include2
43 cd ${OBJTREE}/include2
45 ln -s ${SRCTREE}/include/asm-$2 asm
46 LNPREFIX="../../include2/asm/"
60 if [ -z "$6" -o "$6" = "NULL" ] ; then
61 ln -s ${LNPREFIX}arch-$3 asm-$2/arch
63 ln -s ${LNPREFIX}arch-$6 asm-$2/arch
66 if [ "$2" = "arm" ] ; then
68 ln -s ${LNPREFIX}proc-armv asm-$2/proc
72 # Create include file for Make
74 echo "ARCH = $2" > config.mk
75 echo "CPU = $3" >> config.mk
76 echo "BOARD = $4" >> config.mk
78 [ "$5" ] && [ "$5" != "NULL" ] && echo "VENDOR = $5" >> config.mk
80 [ "$6" ] && [ "$6" != "NULL" ] && echo "SOC = $6" >> config.mk
82 # Assign board directory to BOARDIR variable
83 if [ -z "$5" -o "$5" = "NULL" ] ; then
90 # Create board specific header file
92 if [ "$APPEND" = "yes" ] # Append to existing config file
96 > config.h # Create new config file
98 echo "/* Automatically generated - do not edit */" >>config.h
100 for i in ${TARGETS} ; do
101 echo "#define CONFIG_MK_${i} 1" >>config.h ;
104 cat << EOF >> config.h
105 #define CONFIG_BOARDDIR board/$BOARDDIR
106 #include <config_defaults.h>
107 #include <configs/$1.h>
108 #include <asm/config.h>