blob: dbda0cdc64cc59e7d9a5dc1b74eef4d30b720c1c [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#!/bin/sh -e
2
3# Script to create header files and links to configure
4# Z-Loader for a specific board.
5#
6# Parameters: Target Architecture CPU Board
7#
8# (C) 2013 ZTE Inc
9# (C) 2002 DENX Software Engineering, Wolfgang Denk <wd@denx.de>
10#
11
12APPEND=no # Default: Create new config file
13
14while [ $# -gt 0 ] ; do
15 case "$1" in
16 --) shift ; break ;;
17 -a) shift ; APPEND=yes ;;
18 *) break ;;
19 esac
20done
21
22[ $# -lt 4 ] && exit 1
23[ $# -gt 5 ] && exit 1
24
25echo "Configuring for $1 board..."
26
27cd ./include
28
29#
30# Create link to architecture specific headers
31#
32rm -f asm/arch
33ln -s arch-$3 asm/arch
34
35if [ "$2" = "arm" ] ; then
36 rm -f asm/proc
37 ln -s proc-armv asm/proc
38fi
39
40#
41# Create include file for Make
42#
43echo "ARCH = $2" > config.mk
44echo "CPU = $3" >> config.mk
45echo "BOARD = $4" >> config.mk
46
47[ "$5" ] && echo "VENDOR = $5" >> config.mk
48
49#
50# Create board specific header file
51#
52if [ "$APPEND" = "yes" ] # Append to existing config file
53then
54 echo >> config.h
55else
56 > config.h # Create new config file
57fi
58echo "/* Automatically generated - do not edit */" >>config.h
59echo "#include <configs/$1.h>" >>config.h
60
61exit 0