powerpc: Migrate HIGH_BATS to Kconfig
[platform/kernel/u-boot.git] / include / configs / ids8313.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * (C) Copyright 2013
4  * Heiko Schocher, DENX Software Engineering, hs@denx.de.
5  *
6  * Based on:
7  * Copyright (c) 2011 IDS GmbH, Germany
8  * Sergej Stepanov <ste@ids.de>
9  */
10
11 #ifndef __CONFIG_H
12 #define __CONFIG_H
13
14 /*
15  * High Level Configuration Options
16  */
17 #define CONFIG_FSL_ELBC
18
19 #define CONFIG_BOOT_RETRY_TIME          900
20 #define CONFIG_BOOT_RETRY_MIN           30
21 #define CONFIG_RESET_TO_RETRY
22
23 #define CONFIG_SYS_IMMR         0xF0000000
24
25 #define CONFIG_SYS_ACR_PIPE_DEP 3       /* Arbiter pipeline depth (0-3) */
26 #define CONFIG_SYS_ACR_RPTCNT           3       /* Arbiter repeat count (0-7) */
27
28 #define CONFIG_SYS_SICRH        0x00000000
29 #define CONFIG_SYS_SICRL        (SICRL_LBC | SICRL_SPI_D)
30
31 #define CONFIG_HWCONFIG
32
33 #define CONFIG_SYS_HID0_INIT    0x000000000
34 #define CONFIG_SYS_HID0_FINAL   (HID0_ENABLE_MACHINE_CHECK |\
35                                  HID0_ENABLE_INSTRUCTION_CACHE |\
36                                  HID0_DISABLE_DYNAMIC_POWER_MANAGMENT)
37
38 #define CONFIG_SYS_HID2 (HID2_HBE | 0x00020000)
39
40 /*
41  * Definitions for initial stack pointer and data area (in DCACHE )
42  */
43 #define CONFIG_SYS_INIT_RAM_LOCK
44 #define CONFIG_SYS_INIT_RAM_ADDR        0xFD000000
45 #define CONFIG_SYS_INIT_RAM_SIZE        0x1000  /* End of used area in DPRAM */
46 #define CONFIG_SYS_GBL_DATA_SIZE        0x100
47 #define CONFIG_SYS_GBL_DATA_OFFSET      (CONFIG_SYS_INIT_RAM_SIZE \
48                                          - CONFIG_SYS_GBL_DATA_SIZE)
49 #define CONFIG_SYS_INIT_SP_OFFSET       CONFIG_SYS_GBL_DATA_OFFSET
50
51 /*
52  * Local Bus LCRR and LBCR regs
53  */
54 #define CONFIG_SYS_LCRR_EADC            LCRR_EADC_1
55 #define CONFIG_SYS_LCRR_CLKDIV          LCRR_CLKDIV_2
56 #define CONFIG_SYS_LBC_LBCR             (0x00040000 |\
57                                          (0xFF << LBCR_BMT_SHIFT) |\
58                                          0xF)
59
60 #define CONFIG_SYS_LBC_MRTPR            0x20000000
61
62 /*
63  * Internal Definitions
64  */
65 /*
66  * DDR Setup
67  */
68 #define CONFIG_SYS_DDR_BASE             0x00000000
69 #define CONFIG_SYS_SDRAM_BASE           CONFIG_SYS_DDR_BASE
70 #define CONFIG_SYS_DDR_SDRAM_BASE       CONFIG_SYS_DDR_BASE
71
72 /*
73  * Manually set up DDR parameters,
74  * as this board has not the SPD connected to I2C.
75  */
76 #define CONFIG_SYS_DDR_SIZE             256             /* MB */
77 #define CONFIG_SYS_DDR_CONFIG           (CSCONFIG_EN |\
78                                          0x00010000 |\
79                                          CSCONFIG_ROW_BIT_13 |\
80                                          CSCONFIG_COL_BIT_10)
81
82 #define CONFIG_SYS_DDR_CONFIG_256       (CONFIG_SYS_DDR_CONFIG | \
83                                          CSCONFIG_BANK_BIT_3)
84
85 #define CONFIG_SYS_DDR_TIMING_3 (1 << 16)       /* ext refrec */
86 #define CONFIG_SYS_DDR_TIMING_0 ((3 << TIMING_CFG0_RWT_SHIFT) |\
87                                 (3 << TIMING_CFG0_WRT_SHIFT) |\
88                                 (3 << TIMING_CFG0_RRT_SHIFT) |\
89                                 (3 << TIMING_CFG0_WWT_SHIFT) |\
90                                 (6 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) |\
91                                 (2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) |\
92                                 (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \
93                                 (2 << TIMING_CFG0_MRS_CYC_SHIFT))
94 #define CONFIG_SYS_DDR_TIMING_1 ((4 << TIMING_CFG1_PRETOACT_SHIFT) |\
95                                 (12 << TIMING_CFG1_ACTTOPRE_SHIFT) |\
96                                 (4 << TIMING_CFG1_ACTTORW_SHIFT) |\
97                                 (7 << TIMING_CFG1_CASLAT_SHIFT) |\
98                                 (4 << TIMING_CFG1_REFREC_SHIFT) |\
99                                 (4 << TIMING_CFG1_WRREC_SHIFT) |\
100                                 (2 << TIMING_CFG1_ACTTOACT_SHIFT) |\
101                                 (2 << TIMING_CFG1_WRTORD_SHIFT))
102 #define CONFIG_SYS_DDR_TIMING_2 ((1 << TIMING_CFG2_ADD_LAT_SHIFT) |\
103                                 (5 << TIMING_CFG2_CPO_SHIFT) |\
104                                 (4 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) |\
105                                 (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) |\
106                                 (0 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) |\
107                                 (1 << TIMING_CFG2_CKE_PLS_SHIFT) |\
108                                 (6 << TIMING_CFG2_FOUR_ACT_SHIFT))
109
110 #define CONFIG_SYS_DDR_INTERVAL ((0x800 << SDRAM_INTERVAL_REFINT_SHIFT) |\
111                                 (0x800 << SDRAM_INTERVAL_BSTOPRE_SHIFT))
112
113 #define CONFIG_SYS_SDRAM_CFG            (SDRAM_CFG_SREN |\
114                                          SDRAM_CFG_2T_EN | SDRAM_CFG_HSE |\
115                                          SDRAM_CFG_DBW_32 |\
116                                          SDRAM_CFG_SDRAM_TYPE_DDR2)
117
118 #define CONFIG_SYS_SDRAM_CFG2           0x00401000
119 #define CONFIG_SYS_DDR_MODE             ((0x0448 << SDRAM_MODE_ESD_SHIFT) |\
120                                          (0x0242 << SDRAM_MODE_SD_SHIFT))
121 #define CONFIG_SYS_DDR_MODE_2           0x00000000
122 #define CONFIG_SYS_DDR_CLK_CNTL DDR_SDRAM_CLK_CNTL_CLK_ADJUST_075
123 #define CONFIG_SYS_DDRCDR_VALUE (DDRCDR_EN |\
124                                          DDRCDR_PZ_NOMZ |\
125                                          DDRCDR_NZ_NOMZ |\
126                                          DDRCDR_ODT |\
127                                          DDRCDR_M_ODR |\
128                                          DDRCDR_Q_DRN)
129
130 /*
131  * on-board devices
132  */
133 #define CONFIG_TSEC1
134 #define CONFIG_TSEC2
135
136 /*
137  * NOR FLASH setup
138  */
139 #define CONFIG_SYS_FLASH_CFI_WIDTH      FLASH_CFI_8BIT
140 #define CONFIG_FLASH_SHOW_PROGRESS      50
141
142 #define CONFIG_SYS_FLASH_BASE           0xFF800000
143 #define CONFIG_SYS_FLASH_SIZE           8
144
145 #define CONFIG_SYS_LBLAWBAR0_PRELIM     CONFIG_SYS_FLASH_BASE
146 #define CONFIG_SYS_LBLAWAR0_PRELIM      0x80000016
147
148 #define CONFIG_SYS_BR0_PRELIM           (CONFIG_SYS_FLASH_BASE |\
149                                          BR_PS_8 |\
150                                          BR_MS_GPCM |\
151                                          BR_V)
152
153 #define CONFIG_SYS_OR0_PRELIM           (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) |\
154                                          OR_GPCM_SCY_10 |\
155                                          OR_GPCM_EHTR |\
156                                          OR_GPCM_TRLX |\
157                                          OR_GPCM_CSNT |\
158                                          OR_GPCM_EAD)
159 #define CONFIG_SYS_MAX_FLASH_BANKS      1
160 #define CONFIG_SYS_MAX_FLASH_SECT       128
161
162 #define CONFIG_SYS_FLASH_ERASE_TOUT     60000
163 #define CONFIG_SYS_FLASH_WRITE_TOUT     500
164
165 /*
166  * NAND FLASH setup
167  */
168 #define CONFIG_SYS_NAND_BASE            0xE1000000
169 #define CONFIG_SYS_MAX_NAND_DEVICE      1
170 #define CONFIG_SYS_NAND_MAX_CHIPS       1
171 #define CONFIG_NAND_FSL_ELBC
172 #define CONFIG_SYS_NAND_PAGE_SIZE       (2048)
173 #define CONFIG_SYS_NAND_BLOCK_SIZE      (128 << 10)
174 #define NAND_CACHE_PAGES                64
175
176 #define CONFIG_SYS_LBLAWBAR1_PRELIM     CONFIG_SYS_NAND_BASE
177 #define CONFIG_SYS_LBLAWAR1_PRELIM      0x8000000E
178 #define CONFIG_SYS_NAND_LBLAWBAR_PRELIM CONFIG_SYS_LBLAWBAR1_PRELIM
179 #define CONFIG_SYS_NAND_LBLAWAR_PRELIM  CONFIG_SYS_LBLAWAR1_PRELIM
180
181 #define CONFIG_SYS_BR1_PRELIM   ((CONFIG_SYS_NAND_BASE) |\
182                                  (2<<BR_DECC_SHIFT) |\
183                                  BR_PS_8 |\
184                                  BR_MS_FCM |\
185                                  BR_V)
186
187 #define CONFIG_SYS_OR1_PRELIM   (0xFFFF8000 |\
188                                  OR_FCM_PGS |\
189                                  OR_FCM_CSCT |\
190                                  OR_FCM_CST |\
191                                  OR_FCM_CHT |\
192                                  OR_FCM_SCY_4 |\
193                                  OR_FCM_TRLX |\
194                                  OR_FCM_EHTR |\
195                                  OR_FCM_RST)
196
197 /*
198  * MRAM setup
199  */
200 #define CONFIG_SYS_MRAM_BASE            0xE2000000
201 #define CONFIG_SYS_MRAM_SIZE            0x20000 /* 128 Kb */
202 #define CONFIG_SYS_LBLAWBAR2_PRELIM     CONFIG_SYS_MRAM_BASE
203 #define CONFIG_SYS_LBLAWAR2_PRELIM      0x80000010      /* 128 Kb  */
204
205 #define CONFIG_SYS_OR_TIMING_MRAM
206
207 #define CONFIG_SYS_BR2_PRELIM           (CONFIG_SYS_MRAM_BASE |\
208                                          BR_PS_8 |\
209                                          BR_MS_GPCM |\
210                                          BR_V)
211
212 #define CONFIG_SYS_OR2_PRELIM           0xFFFE0C74
213
214 /*
215  * CPLD setup
216  */
217 #define CONFIG_SYS_CPLD_BASE            0xE3000000
218 #define CONFIG_SYS_CPLD_SIZE            0x8000
219 #define CONFIG_SYS_LBLAWBAR3_PRELIM     CONFIG_SYS_CPLD_BASE
220 #define CONFIG_SYS_LBLAWAR3_PRELIM      0x8000000E
221
222 #define CONFIG_SYS_OR_TIMING_MRAM
223
224 #define CONFIG_SYS_BR3_PRELIM           (CONFIG_SYS_CPLD_BASE |\
225                                          BR_PS_8 |\
226                                          BR_MS_GPCM |\
227                                          BR_V)
228
229 #define CONFIG_SYS_OR3_PRELIM           0xFFFF8814
230
231 /*
232  * HW-Watchdog
233  */
234 #define CONFIG_WATCHDOG         1
235 #define CONFIG_SYS_WATCHDOG_VALUE       0xFFFF
236
237 /*
238  * I2C setup
239  */
240 #define CONFIG_SYS_I2C
241 #define CONFIG_SYS_I2C_FSL
242 #define CONFIG_SYS_FSL_I2C_SPEED        400000
243 #define CONFIG_SYS_FSL_I2C_SLAVE        0x7F
244 #define CONFIG_SYS_FSL_I2C_OFFSET       0x3100
245 #define CONFIG_RTC_PCF8563
246 #define CONFIG_SYS_I2C_RTC_ADDR 0x51
247
248 /*
249  * Ethernet setup
250  */
251 #ifdef CONFIG_TSEC1
252 #define CONFIG_HAS_ETH0
253 #define CONFIG_TSEC1_NAME               "TSEC0"
254 #define CONFIG_SYS_TSEC1_OFFSET 0x24000
255 #define TSEC1_PHY_ADDR                  0x1
256 #define TSEC1_FLAGS                     TSEC_GIGABIT
257 #define TSEC1_PHYIDX                    0
258 #endif
259
260 #ifdef CONFIG_TSEC2
261 #define CONFIG_HAS_ETH1
262 #define CONFIG_TSEC2_NAME               "TSEC1"
263 #define CONFIG_SYS_TSEC2_OFFSET 0x25000
264 #define TSEC2_PHY_ADDR                  0x3
265 #define TSEC2_FLAGS                     TSEC_GIGABIT
266 #define TSEC2_PHYIDX                    0
267 #endif
268 #define CONFIG_ETHPRIME         "TSEC1"
269
270 /*
271  * Serial Port
272  */
273 #define CONFIG_SYS_NS16550_SERIAL
274 #define CONFIG_SYS_NS16550_REG_SIZE     1
275
276 #define CONFIG_SYS_BAUDRATE_TABLE       \
277         {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}
278 #define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_IMMR + 0x4500)
279 #define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_IMMR + 0x4600)
280 #define CONFIG_SYS_NS16550_CLK          (get_bus_freq(0))
281
282 #define CONFIG_HAS_FSL_DR_USB
283 #define CONFIG_SYS_SCCR_USBDRCM 3
284
285 /*
286  * BAT's
287  */
288
289 /* DDR @ 0x00000000 */
290 #define CONFIG_SYS_IBAT0L               (CONFIG_SYS_SDRAM_BASE |\
291                                          BATL_PP_10)
292 #define CONFIG_SYS_IBAT0U               (CONFIG_SYS_SDRAM_BASE |\
293                                          BATU_BL_256M |\
294                                          BATU_VS |\
295                                          BATU_VP)
296 #define CONFIG_SYS_DBAT0L               CONFIG_SYS_IBAT0L
297 #define CONFIG_SYS_DBAT0U               CONFIG_SYS_IBAT0U
298
299 /* Initial RAM @ 0xFD000000 */
300 #define CONFIG_SYS_IBAT1L               (CONFIG_SYS_INIT_RAM_ADDR |\
301                                          BATL_PP_10 |\
302                                          BATL_GUARDEDSTORAGE)
303 #define CONFIG_SYS_IBAT1U               (CONFIG_SYS_INIT_RAM_ADDR |\
304                                          BATU_BL_256K |\
305                                          BATU_VS |\
306                                          BATU_VP)
307 #define CONFIG_SYS_DBAT1L               CONFIG_SYS_IBAT1L
308 #define CONFIG_SYS_DBAT1U               CONFIG_SYS_IBAT1U
309
310 /* FLASH @ 0xFF800000 */
311 #define CONFIG_SYS_IBAT2L               (CONFIG_SYS_FLASH_BASE |\
312                                          BATL_PP_10 |\
313                                          BATL_GUARDEDSTORAGE)
314 #define CONFIG_SYS_IBAT2U               (CONFIG_SYS_FLASH_BASE |\
315                                          BATU_BL_8M |\
316                                          BATU_VS |\
317                                          BATU_VP)
318 #define CONFIG_SYS_DBAT2L               (CONFIG_SYS_FLASH_BASE |\
319                                          BATL_PP_10 |\
320                                          BATL_CACHEINHIBIT |\
321                                          BATL_GUARDEDSTORAGE)
322 #define CONFIG_SYS_DBAT2U               CONFIG_SYS_IBAT2U
323
324 #define CONFIG_SYS_IBAT3L               (0)
325 #define CONFIG_SYS_IBAT3U               (0)
326 #define CONFIG_SYS_DBAT3L               CONFIG_SYS_IBAT3L
327 #define CONFIG_SYS_DBAT3U               CONFIG_SYS_IBAT3U
328
329 #define CONFIG_SYS_IBAT4L               (0)
330 #define CONFIG_SYS_IBAT4U               (0)
331 #define CONFIG_SYS_DBAT4L               CONFIG_SYS_IBAT4L
332 #define CONFIG_SYS_DBAT4U               CONFIG_SYS_IBAT4U
333
334 /* IMMRBAR @ 0xF0000000 */
335 #define CONFIG_SYS_IBAT5L               (CONFIG_SYS_IMMR |\
336                                          BATL_PP_10 |\
337                                          BATL_CACHEINHIBIT |\
338                                          BATL_GUARDEDSTORAGE)
339 #define CONFIG_SYS_IBAT5U               (CONFIG_SYS_IMMR |\
340                                          BATU_BL_128M |\
341                                          BATU_VS |\
342                                          BATU_VP)
343 #define CONFIG_SYS_DBAT5L               CONFIG_SYS_IBAT5L
344 #define CONFIG_SYS_DBAT5U               CONFIG_SYS_IBAT5U
345
346 /* NAND-Flash @ 0xE1000000, MRAM @ 0xE2000000, CPLD @ 0xE3000000 */
347 #define CONFIG_SYS_IBAT6L               (0xE0000000 |\
348                                          BATL_PP_10 |\
349                                          BATL_GUARDEDSTORAGE)
350 #define CONFIG_SYS_IBAT6U               (0xE0000000 |\
351                                          BATU_BL_256M |\
352                                          BATU_VS |\
353                                          BATU_VP)
354 #define CONFIG_SYS_DBAT6L               CONFIG_SYS_IBAT6L
355 #define CONFIG_SYS_DBAT6U               CONFIG_SYS_IBAT6U
356
357 #define CONFIG_SYS_IBAT7L               (0)
358 #define CONFIG_SYS_IBAT7U               (0)
359 #define CONFIG_SYS_DBAT7L               CONFIG_SYS_IBAT7L
360 #define CONFIG_SYS_DBAT7U               CONFIG_SYS_IBAT7U
361
362 /*
363  * U-Boot environment setup
364  */
365 #define CONFIG_BOOTP_BOOTFILESIZE
366
367 /*
368  * The reserved memory
369  */
370 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
371 #define CONFIG_SYS_MONITOR_LEN          (768 * 1024)
372 #define CONFIG_SYS_MALLOC_LEN           (8 * 1024 * 1024)
373
374 /*
375  * Environment Configuration
376  */
377 #define CONFIG_ENV_ADDR         (CONFIG_SYS_MONITOR_BASE \
378                                 + CONFIG_SYS_MONITOR_LEN)
379 #define CONFIG_ENV_SIZE         0x20000
380 #define CONFIG_ENV_ADDR_REDUND  (CONFIG_ENV_ADDR + CONFIG_ENV_SIZE)
381 #define CONFIG_ENV_SIZE_REDUND  (CONFIG_ENV_SIZE)
382
383 #define CONFIG_NETDEV                   eth1
384 #define CONFIG_HOSTNAME         "ids8313"
385 #define CONFIG_ROOTPATH         "/opt/eldk-4.2/ppc_6xx"
386 #define CONFIG_BOOTFILE         "ids8313/uImage"
387 #define CONFIG_UBOOTPATH                "ids8313/u-boot.bin"
388 #define CONFIG_FDTFILE                  "ids8313/ids8313.dtb"
389 #define CONFIG_LOADADDR         0x400000
390 #define CONFIG_ENV_FLAGS_LIST_STATIC "ethaddr:mo,eth1addr:mo"
391
392 /* Initial Memory map for Linux*/
393 #define CONFIG_SYS_BOOTMAPSZ            (256 << 20)
394
395 /*
396  * Miscellaneous configurable options
397  */
398 #define CONFIG_SYS_CBSIZE               1024
399 #define CONFIG_SYS_BARGSIZE             CONFIG_SYS_CBSIZE
400
401 #define CONFIG_SYS_MEMTEST_START        0x00001000
402 #define CONFIG_SYS_MEMTEST_END          0x00C00000
403
404 #define CONFIG_SYS_LOAD_ADDR            0x100000
405 #define CONFIG_LOADS_ECHO
406 #define CONFIG_TIMESTAMP
407 #define CONFIG_PREBOOT                  "echo;" \
408                                         "echo Type \\\"run nfsboot\\\" " \
409                                         "to mount root filesystem over NFS;echo"
410 #define CONFIG_BOOTCOMMAND              "run boot_cramfs"
411 #undef  CONFIG_SYS_LOADS_BAUD_CHANGE
412
413 #define CONFIG_JFFS2_NAND
414 #define CONFIG_JFFS2_DEV                "0"
415
416 /* mtdparts command line support */
417
418 #define CONFIG_EXTRA_ENV_SETTINGS \
419         "netdev=" __stringify(CONFIG_NETDEV) "\0"                       \
420         "ethprime=TSEC1\0"                                              \
421         "uboot=" __stringify(CONFIG_UBOOTPATH) "\0"                     \
422         "tftpflash=tftpboot ${loadaddr} ${uboot}; "                     \
423                 "protect off " __stringify(CONFIG_SYS_TEXT_BASE)        \
424                 " +${filesize}; "                                       \
425                 "erase " __stringify(CONFIG_SYS_TEXT_BASE)              \
426                 " +${filesize}; "                                       \
427                 "cp.b ${loadaddr} " __stringify(CONFIG_SYS_TEXT_BASE)   \
428                 " ${filesize}; "                                        \
429                 "protect on " __stringify(CONFIG_SYS_TEXT_BASE)         \
430                 " +${filesize}; "                                       \
431                 "cmp.b ${loadaddr} " __stringify(CONFIG_SYS_TEXT_BASE)  \
432                 " ${filesize}\0"                                        \
433         "console=ttyS0\0"                                               \
434         "fdtaddr=0x780000\0"                                            \
435         "kernel_addr=ff800000\0"                                        \
436         "fdtfile=" __stringify(CONFIG_FDTFILE) "\0"                     \
437         "setbootargs=setenv bootargs "                                  \
438                 "root=${rootdev} rw console=${console},"                \
439                         "${baudrate} ${othbootargs}\0"                  \
440         "setipargs=setenv bootargs root=${rootdev} rw "                 \
441                         "nfsroot=${serverip}:${rootpath} "              \
442                         "ip=${ipaddr}:${serverip}:${gatewayip}:"        \
443                         "${netmask}:${hostname}:${netdev}:off "         \
444                         "console=${console},${baudrate} ${othbootargs}\0" \
445         "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0"              \
446         "mtdids=" CONFIG_MTDIDS_DEFAULT "\0"                                    \
447         "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"                                \
448         "\0"
449
450 #define CONFIG_NFSBOOTCOMMAND                                           \
451         "setenv rootdev /dev/nfs;"                                      \
452         "run setipargs;run addmtd;"                                     \
453         "tftp ${loadaddr} ${bootfile};"                         \
454         "tftp ${fdtaddr} ${fdtfile};"                                   \
455         "fdt addr ${fdtaddr};"                                          \
456         "bootm ${loadaddr} - ${fdtaddr}"
457
458 /* UBI Support */
459
460 #endif  /* __CONFIG_H */