wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 1 | #!/bin/sh -e |
| 2 | |
| 3 | # Script to create header files and links to configure |
| 4 | # U-Boot for a specific board. |
| 5 | # |
wdenk | f8e9a23 | 2004-10-09 22:21:29 +0000 | [diff] [blame] | 6 | # Parameters: Target Architecture CPU Board [VENDOR] [SOC] |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 7 | # |
| 8 | # (C) 2002 DENX Software Engineering, Wolfgang Denk <wd@denx.de> |
| 9 | # |
| 10 | |
| 11 | APPEND=no # Default: Create new config file |
Wolfgang Denk | 9975314 | 2006-07-21 11:16:34 +0200 | [diff] [blame] | 12 | BOARD_NAME="" # Name to print in make output |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 13 | |
| 14 | while [ $# -gt 0 ] ; do |
| 15 | case "$1" in |
| 16 | --) shift ; break ;; |
| 17 | -a) shift ; APPEND=yes ;; |
Wolfgang Denk | 9975314 | 2006-07-21 11:16:34 +0200 | [diff] [blame] | 18 | -n) shift ; BOARD_NAME="${1%%_config}" ; shift ;; |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 19 | *) break ;; |
| 20 | esac |
| 21 | done |
| 22 | |
Wolfgang Denk | 9975314 | 2006-07-21 11:16:34 +0200 | [diff] [blame] | 23 | [ "${BOARD_NAME}" ] || BOARD_NAME="$1" |
| 24 | |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 25 | [ $# -lt 4 ] && exit 1 |
wdenk | f8e9a23 | 2004-10-09 22:21:29 +0000 | [diff] [blame] | 26 | [ $# -gt 6 ] && exit 1 |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 27 | |
Wolfgang Denk | 9975314 | 2006-07-21 11:16:34 +0200 | [diff] [blame] | 28 | echo "Configuring for ${BOARD_NAME} board..." |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 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 |
wdenk | f9c57a2 | 2005-04-03 14:26:46 +0000 | [diff] [blame] | 38 | |
Wolfgang Denk | 31c939b | 2005-08-03 22:58:55 +0200 | [diff] [blame] | 39 | if [ -z "$6" -o "$6" = "NULL" ] ; then |
wdenk | f9c57a2 | 2005-04-03 14:26:46 +0000 | [diff] [blame] | 40 | ln -s arch-$3 asm-$2/arch |
| 41 | else |
| 42 | ln -s arch-$6 asm-$2/arch |
| 43 | fi |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 44 | |
wdenk | bb2d927 | 2003-06-25 22:26:29 +0000 | [diff] [blame] | 45 | if [ "$2" = "arm" ] ; then |
| 46 | rm -f asm-$2/proc |
| 47 | ln -s proc-armv asm-$2/proc |
| 48 | fi |
| 49 | |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 50 | # |
| 51 | # Create include file for Make |
| 52 | # |
wdenk | f8e9a23 | 2004-10-09 22:21:29 +0000 | [diff] [blame] | 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 |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 58 | |
wdenk | f8e9a23 | 2004-10-09 22:21:29 +0000 | [diff] [blame] | 59 | [ "$6" ] && [ "$6" != "NULL" ] && echo "SOC = $6" >> config.mk |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 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 |