]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - mkconfig
Merge with /home/raj/git/u-boot
[karo-tx-uboot.git] / mkconfig
1 #!/bin/sh -e
2
3 # Script to create header files and links to configure
4 # U-Boot for a specific board.
5 #
6 # Parameters:  Target  Architecture  CPU  Board [VENDOR] [SOC]
7 #
8 # (C) 2002 DENX Software Engineering, Wolfgang Denk <wd@denx.de>
9 #
10
11 APPEND=no       # Default: Create new config file
12 BOARD_NAME=""   # Name to print in make output
13
14 while [ $# -gt 0 ] ; do
15         case "$1" in
16         --) shift ; break ;;
17         -a) shift ; APPEND=yes ;;
18         -n) shift ; BOARD_NAME="${1%%_config}" ; shift ;;
19         *)  break ;;
20         esac
21 done
22
23 [ "${BOARD_NAME}" ] || BOARD_NAME="$1"
24
25 [ $# -lt 4 ] && exit 1
26 [ $# -gt 6 ] && exit 1
27
28 echo "Configuring for ${BOARD_NAME} board..."
29
30 cd ./include
31
32 #
33 # Create link to architecture specific headers
34 #
35 rm -f asm
36 ln -s asm-$2 asm
37 rm -f asm-$2/arch
38
39 if [ -z "$6" -o "$6" = "NULL" ] ; then
40         ln -s arch-$3 asm-$2/arch
41 else
42         ln -s arch-$6 asm-$2/arch
43 fi
44
45 if [ "$2" = "arm" ] ; then
46         rm -f asm-$2/proc
47         ln -s proc-armv asm-$2/proc
48 fi
49
50 #
51 # Create include file for Make
52 #
53 echo "ARCH   = $2" >  config.mk
54 echo "CPU    = $3" >> config.mk
55 echo "BOARD  = $4" >> config.mk
56
57 [ "$5" ] && [ "$5" != "NULL" ] && echo "VENDOR = $5" >> config.mk
58
59 [ "$6" ] && [ "$6" != "NULL" ] && echo "SOC    = $6" >> config.mk
60
61 #
62 # Create board specific header file
63 #
64 if [ "$APPEND" = "yes" ]        # Append to existing config file
65 then
66         echo >> config.h
67 else
68         > config.h              # Create new config file
69 fi
70 echo "/* Automatically generated - do not edit */" >>config.h
71 echo "#include <configs/$1.h>" >>config.h
72
73 exit 0