blob: 8c54250ec4a8c2ba4a0e663c5bd3098e8a6881e9 [file] [log] [blame]
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +02001#!/bin/sh
2# ---------------------------------------------------------
3# Set the platform defines
4# ---------------------------------------------------------
Wolfgang Denk88bd7432005-10-09 00:22:48 +02005echo -n "/* Integrator configuration implied " > tmp.fil
Wolfgang Denka1be4762008-05-20 16:00:29 +02006echo " by Makefile target */" >> tmp.fil
Wolfgang Denk88bd7432005-10-09 00:22:48 +02007echo -n "#define CONFIG_INTEGRATOR" >> tmp.fil
8echo " /* Integrator board */" >> tmp.fil
9echo -n "#define CONFIG_ARCH_INTEGRATOR" >> tmp.fil
10echo " 1 /* Integrator/AP */" >> tmp.fil
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +020011# ---------------------------------------------------------
Wolfgang Denk88bd7432005-10-09 00:22:48 +020012# Set the core module defines according to Core Module
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +020013# ---------------------------------------------------------
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +020014cpu="arm_intcm"
Wolfgang Denk88bd7432005-10-09 00:22:48 +020015variant="unknown core module"
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +020016
Wolfgang Denk111d6062008-01-02 15:54:45 +010017if [ "$1" = "" ]
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +020018then
Wolfgang Denk88bd7432005-10-09 00:22:48 +020019 echo "$0:: No parameters - using arm_intcm"
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +020020else
21 case "$1" in
Wolfgang Denk88bd7432005-10-09 00:22:48 +020022 ap7_config)
23 cpu="arm_intcm"
24 variant="unported core module CM7TDMI"
25 ;;
26
27 ap966)
28 cpu="arm_intcm"
29 variant="unported core module CM966E-S"
30 ;;
31
32 ap922_config)
33 cpu="arm_intcm"
34 variant="unported core module CM922T"
35 ;;
36
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +020037 integratorap_config | \
38 ap_config)
39 cpu="arm_intcm"
Wolfgang Denk88bd7432005-10-09 00:22:48 +020040 variant="unspecified core module"
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +020041 ;;
42
43 ap720t_config)
44 cpu="arm720t"
Wolfgang Denka1be4762008-05-20 16:00:29 +020045 echo -n "#define CONFIG_CM720T" >> tmp.fil
46 echo " 1 /* CPU core is ARM720T */ " >> tmp.fil
Wolfgang Denk88bd7432005-10-09 00:22:48 +020047 variant="Core module CM720T"
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +020048 ;;
49
50 ap922_XA10_config)
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +020051 cpu="arm_intcm"
Wolfgang Denk88bd7432005-10-09 00:22:48 +020052 variant="unported core module CM922T_XA10"
Wolfgang Denka1be4762008-05-20 16:00:29 +020053 echo -n "#define CONFIG_CM922T_XA10" >> tmp.fil
54 echo " 1 /* CPU core is ARM922T_XA10 */" >> tmp.fil
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +020055 ;;
56
57 ap920t_config)
58 cpu="arm920t"
Wolfgang Denk88bd7432005-10-09 00:22:48 +020059 variant="Core module CM920T"
Wolfgang Denka1be4762008-05-20 16:00:29 +020060 echo -n "#define CONFIG_CM920T" >> tmp.fil
Wolfgang Denk88bd7432005-10-09 00:22:48 +020061 echo " 1 /* CPU core is ARM920T */" >> tmp.fil
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +020062 ;;
63
64 ap926ejs_config)
65 cpu="arm926ejs"
Wolfgang Denk88bd7432005-10-09 00:22:48 +020066 variant="Core module CM926EJ-S"
67 echo -n "#define CONFIG_CM926EJ_S" >> tmp.fil
68 echo " 1 /* CPU core is ARM926EJ-S */ " >> tmp.fil
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +020069 ;;
70
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +020071 ap946es_config)
72 cpu="arm946es"
Wolfgang Denk88bd7432005-10-09 00:22:48 +020073 variant="Core module CM946E-S"
74 echo -n "#define CONFIG_CM946E_S" >> tmp.fil
75 echo " 1 /* CPU core is ARM946E-S */ " >> tmp.fil
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +020076 ;;
77
78 *)
Wolfgang Denk88bd7432005-10-09 00:22:48 +020079 echo "$0:: Unknown core module"
80 variant="unknown core module"
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +020081 cpu="arm_intcm"
82 ;;
83
84 esac
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +020085fi
86
Wolfgang Denk111d6062008-01-02 15:54:45 +010087if [ "$cpu" = "arm_intcm" ]
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +020088then
89 echo "/* Core module undefined/not ported */" >> tmp.fil
Wolfgang Denk88bd7432005-10-09 00:22:48 +020090 echo "#define CONFIG_ARM_INTCM 1" >> tmp.fil
91 echo -n "#undef CONFIG_CM_MULTIPLE_SSRAM" >> tmp.fil
Wolfgang Denka1be4762008-05-20 16:00:29 +020092 echo -n " /* CM may not have " >> tmp.fil
Wolfgang Denk88bd7432005-10-09 00:22:48 +020093 echo "multiple SSRAM mapping */" >> tmp.fil
Wolfgang Denka1be4762008-05-20 16:00:29 +020094 echo -n "#undef CONFIG_CM_SPD_DETECT " >> tmp.fil
95 echo -n " /* CM may not support SPD " >> tmp.fil
Wolfgang Denk88bd7432005-10-09 00:22:48 +020096 echo "query */" >> tmp.fil
Wolfgang Denka1be4762008-05-20 16:00:29 +020097 echo -n "#undef CONFIG_CM_REMAP " >> tmp.fil
Wolfgang Denk88bd7432005-10-09 00:22:48 +020098 echo -n " /* CM may not support " >> tmp.fil
Wolfgang Denka1be4762008-05-20 16:00:29 +020099 echo "remapping */" >> tmp.fil
100 echo -n "#undef CONFIG_CM_INIT " >> tmp.fil
Wolfgang Denk88bd7432005-10-09 00:22:48 +0200101 echo -n " /* CM may not have " >> tmp.fil
102 echo "initialization reg */" >> tmp.fil
Wolfgang Denka1be4762008-05-20 16:00:29 +0200103 echo -n "#undef CONFIG_CM_TCRAM " >> tmp.fil
104 echo " /* CM may not have TCRAM */" >> tmp.fil
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +0200105fi
Marian Balakowiczd62379d2006-09-01 19:49:50 +0200106
107mkdir -p ${obj}include
108mkdir -p ${obj}board/integratorap
109mv tmp.fil ${obj}include/config.h
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +0200110# ---------------------------------------------------------
Wolfgang Denk88bd7432005-10-09 00:22:48 +0200111# Ensure correct core object loaded first in U-Boot image
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +0200112# ---------------------------------------------------------
Marian Balakowiczd62379d2006-09-01 19:49:50 +0200113sed -r 's/CPU_FILE/cpu\/'$cpu'\/start.o/; s/#.*//' ${src}board/integratorap/u-boot.lds.template > ${obj}board/integratorap/u-boot.lds
Wolfgang Denk7f88a5e2005-10-06 17:08:18 +0200114# ---------------------------------------------------------
115# Complete the configuration
116# ---------------------------------------------------------
Marian Balakowiczd62379d2006-09-01 19:49:50 +0200117$MKCONFIG -a integratorap arm $cpu integratorap;
Wolfgang Denk88bd7432005-10-09 00:22:48 +0200118echo "Variant:: $variant with core $cpu"
119