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
14 while [ $# -gt 0 ] ; do
17 -a) shift ; APPEND=yes ;;
18 -n) shift ; BOARD_NAME="${1%%_config}" ; shift ;;
23 [ "${BOARD_NAME}" ] || BOARD_NAME="$1"
25 [ $# -lt 4 ] && exit 1
26 [ $# -gt 6 ] && exit 1
28 echo "Configuring for ${BOARD_NAME} board..."
31 # Create link to architecture specific headers
33 if [ "$SRCTREE" != "$OBJTREE" ] ; then
34 mkdir -p ${OBJTREE}/include
35 mkdir -p ${OBJTREE}/include2
36 cd ${OBJTREE}/include2
38 ln -s ${SRCTREE}/include/asm-$2 asm
39 LNPREFIX="../../include2/asm/"
53 if [ -z "$6" -o "$6" = "NULL" ] ; then
54 ln -s ${LNPREFIX}arch-$3 asm-$2/arch
56 ln -s ${LNPREFIX}arch-$6 asm-$2/arch
59 if [ "$2" = "arm" ] ; then
61 ln -s ${LNPREFIX}proc-armv asm-$2/proc
65 # Create include file for Make
67 echo "ARCH = $2" > config.mk
68 echo "CPU = $3" >> config.mk
69 echo "BOARD = $4" >> config.mk
71 [ "$5" ] && [ "$5" != "NULL" ] && echo "VENDOR = $5" >> config.mk
73 [ "$6" ] && [ "$6" != "NULL" ] && echo "SOC = $6" >> config.mk
76 # Create board specific header file
78 if [ "$APPEND" = "yes" ] # Append to existing config file
82 > config.h # Create new config file
84 echo "/* Automatically generated - do not edit */" >>config.h
85 echo "#define CONFIG_MK_${BOARD_NAME} 1" >>config.h
86 echo "#include <configs/$1.h>" >>config.h
87 echo "#include <asm/config.h>" >>config.h