1 /*
2  * (C) Copyright 2009
3  * Vipin Kumar, STMicroelectronics, <vipin.kumar@st.com>
4  *
5  * SPDX-License-Identifier:	GPL-2.0+
6  */
7 
8 #ifndef __CONFIG_H
9 #define __CONFIG_H
10 
11 /*
12  * High Level Configuration Options
13  * (easy to change)
14  */
15 #if defined(CONFIG_spear300)
16 #define CONFIG_SPEAR3XX
17 #define CONFIG_SPEAR300
18 #elif defined(CONFIG_spear310)
19 #define CONFIG_SPEAR3XX
20 #define CONFIG_SPEAR310
21 #elif defined(CONFIG_spear320)
22 #define CONFIG_SPEAR3XX
23 #define CONFIG_SPEAR320
24 #endif
25 
26 #if defined(CONFIG_usbtty)
27 #define CONFIG_SPEAR_USBTTY
28 #endif
29 
30 #if defined(CONFIG_nand)
31 #define CONFIG_ENV_IS_IN_NAND
32 #else
33 #define CONFIG_ENV_IS_IN_FLASH
34 #endif
35 
36 #include <configs/spear-common.h>
37 
38 /* Ethernet driver configuration */
39 #define CONFIG_DW_ALTDESCRIPTOR
40 
41 #if defined(CONFIG_SPEAR310)
42 #define CONFIG_MACB
43 #define CONFIG_MACB0_PHY			0x01
44 #define CONFIG_MACB1_PHY			0x03
45 #define CONFIG_MACB2_PHY			0x05
46 #define CONFIG_MACB3_PHY			0x07
47 
48 #elif defined(CONFIG_SPEAR320)
49 #define CONFIG_MACB
50 #define CONFIG_MACB0_PHY			0x01
51 
52 #endif
53 
54 /* Serial Configuration (PL011) */
55 #define CONFIG_SYS_SERIAL0			0xD0000000
56 
57 #if defined(CONFIG_SPEAR300)
58 #define CONFIG_PL01x_PORTS			{(void *)CONFIG_SYS_SERIAL0}
59 
60 #elif defined(CONFIG_SPEAR310)
61 
62 #if (CONFIG_CONS_INDEX)
63 #undef  CONFIG_PL011_CLOCK
64 #define CONFIG_PL011_CLOCK			(83 * 1000 * 1000)
65 #endif
66 
67 #define CONFIG_SYS_SERIAL1			0xB2000000
68 #define CONFIG_SYS_SERIAL2			0xB2080000
69 #define CONFIG_SYS_SERIAL3			0xB2100000
70 #define CONFIG_SYS_SERIAL4			0xB2180000
71 #define CONFIG_SYS_SERIAL5			0xB2200000
72 #define CONFIG_PL01x_PORTS			{(void *)CONFIG_SYS_SERIAL0, \
73 						(void *)CONFIG_SYS_SERIAL1, \
74 						(void *)CONFIG_SYS_SERIAL2, \
75 						(void *)CONFIG_SYS_SERIAL3, \
76 						(void *)CONFIG_SYS_SERIAL4, \
77 						(void *)CONFIG_SYS_SERIAL5 }
78 #elif defined(CONFIG_SPEAR320)
79 
80 #if (CONFIG_CONS_INDEX)
81 #undef  CONFIG_PL011_CLOCK
82 #define CONFIG_PL011_CLOCK			(83 * 1000 * 1000)
83 #endif
84 
85 #define CONFIG_SYS_SERIAL1			0xA3000000
86 #define CONFIG_SYS_SERIAL2			0xA4000000
87 #define CONFIG_PL01x_PORTS			{(void *)CONFIG_SYS_SERIAL0, \
88 						(void *)CONFIG_SYS_SERIAL1, \
89 						(void *)CONFIG_SYS_SERIAL2 }
90 #endif
91 
92 #if defined(CONFIG_SPEAR_EMI)
93 
94 #define CONFIG_SYS_FLASH_CFI
95 #define CONFIG_FLASH_CFI_DRIVER
96 
97 #if defined(CONFIG_SPEAR310)
98 #define CONFIG_SYS_FLASH_PROTECTION
99 #define CONFIG_SYS_FLASH_BASE			0x50000000
100 #define CONFIG_SYS_CS1_FLASH_BASE		0x60000000
101 #define CONFIG_SYS_CS2_FLASH_BASE		0x70000000
102 #define CONFIG_SYS_CS3_FLASH_BASE		0x80000000
103 #define CONFIG_SYS_CS4_FLASH_BASE		0x90000000
104 #define CONFIG_SYS_CS5_FLASH_BASE		0xA0000000
105 #define CONFIG_SYS_FLASH_BANKS_LIST		{ CONFIG_SYS_FLASH_BASE,   \
106 						CONFIG_SYS_CS1_FLASH_BASE, \
107 						CONFIG_SYS_CS2_FLASH_BASE, \
108 						CONFIG_SYS_CS3_FLASH_BASE, \
109 						CONFIG_SYS_CS4_FLASH_BASE, \
110 						CONFIG_SYS_CS5_FLASH_BASE }
111 #define CONFIG_SYS_MAX_FLASH_BANKS		6
112 
113 #elif defined(CONFIG_SPEAR320)
114 #define CONFIG_SYS_FLASH_PROTECTION
115 #define CONFIG_SYS_FLASH_BASE			0x44000000
116 #define CONFIG_SYS_CS1_FLASH_BASE		0x45000000
117 #define CONFIG_SYS_CS2_FLASH_BASE		0x46000000
118 #define CONFIG_SYS_CS3_FLASH_BASE		0x47000000
119 #define CONFIG_SYS_FLASH_BANKS_LIST		{ CONFIG_SYS_FLASH_BASE,   \
120 						CONFIG_SYS_CS1_FLASH_BASE, \
121 						CONFIG_SYS_CS2_FLASH_BASE, \
122 						CONFIG_SYS_CS3_FLASH_BASE }
123 #define CONFIG_SYS_MAX_FLASH_BANKS		4
124 
125 #endif
126 
127 #define CONFIG_SYS_MAX_FLASH_SECT		(127 + 8)
128 #define CONFIG_SYS_FLASH_QUIET_TEST
129 
130 #endif
131 
132 /* NAND flash configuration */
133 #define CONFIG_SYS_FSMC_NAND_SP
134 #define CONFIG_SYS_FSMC_NAND_8BIT
135 
136 #if defined(CONFIG_SPEAR300)
137 #define CONFIG_SYS_NAND_BASE			0x80000000
138 
139 #elif defined(CONFIG_SPEAR310)
140 #define CONFIG_SYS_NAND_BASE			0x40000000
141 
142 #elif defined(CONFIG_SPEAR320)
143 #define CONFIG_SYS_NAND_BASE			0x50000000
144 
145 #endif
146 
147 /* Environment Settings */
148 #if defined(CONFIG_SPEAR300)
149 #define CONFIG_EXTRA_ENV_SETTINGS              CONFIG_EXTRA_ENV_USBTTY
150 
151 #elif defined(CONFIG_SPEAR310) || defined(CONFIG_SPEAR320)
152 #define CONFIG_EXTRA_ENV_UNLOCK                        "unlock=yes\0"
153 #define CONFIG_EXTRA_ENV_SETTINGS              CONFIG_EXTRA_ENV_USBTTY \
154 						CONFIG_EXTRA_ENV_UNLOCK
155 #endif
156 
157 #endif  /* __CONFIG_H */
158