mpc83xx: Kconfig: Migrate HRCW 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 #define CONFIG_HIGH_BATS
289
290 /* DDR @ 0x00000000 */
291 #define CONFIG_SYS_IBAT0L               (CONFIG_SYS_SDRAM_BASE |\
292                                          BATL_PP_10)
293 #define CONFIG_SYS_IBAT0U               (CONFIG_SYS_SDRAM_BASE |\
294                                          BATU_BL_256M |\
295                                          BATU_VS |\
296                                          BATU_VP)
297 #define CONFIG_SYS_DBAT0L               CONFIG_SYS_IBAT0L
298 #define CONFIG_SYS_DBAT0U               CONFIG_SYS_IBAT0U
299
300 /* Initial RAM @ 0xFD000000 */
301 #define CONFIG_SYS_IBAT1L               (CONFIG_SYS_INIT_RAM_ADDR |\
302                                          BATL_PP_10 |\
303                                          BATL_GUARDEDSTORAGE)
304 #define CONFIG_SYS_IBAT1U               (CONFIG_SYS_INIT_RAM_ADDR |\
305                                          BATU_BL_256K |\
306                                          BATU_VS |\
307                                          BATU_VP)
308 #define CONFIG_SYS_DBAT1L               CONFIG_SYS_IBAT1L
309 #define CONFIG_SYS_DBAT1U               CONFIG_SYS_IBAT1U
310
311 /* FLASH @ 0xFF800000 */
312 #define CONFIG_SYS_IBAT2L               (CONFIG_SYS_FLASH_BASE |\
313                                          BATL_PP_10 |\
314                                          BATL_GUARDEDSTORAGE)
315 #define CONFIG_SYS_IBAT2U               (CONFIG_SYS_FLASH_BASE |\
316                                          BATU_BL_8M |\
317                                          BATU_VS |\
318                                          BATU_VP)
319 #define CONFIG_SYS_DBAT2L               (CONFIG_SYS_FLASH_BASE |\
320                                          BATL_PP_10 |\
321                                          BATL_CACHEINHIBIT |\
322                                          BATL_GUARDEDSTORAGE)
323 #define CONFIG_SYS_DBAT2U               CONFIG_SYS_IBAT2U
324
325 #define CONFIG_SYS_IBAT3L               (0)
326 #define CONFIG_SYS_IBAT3U               (0)
327 #define CONFIG_SYS_DBAT3L               CONFIG_SYS_IBAT3L
328 #define CONFIG_SYS_DBAT3U               CONFIG_SYS_IBAT3U
329
330 #define CONFIG_SYS_IBAT4L               (0)
331 #define CONFIG_SYS_IBAT4U               (0)
332 #define CONFIG_SYS_DBAT4L               CONFIG_SYS_IBAT4L
333 #define CONFIG_SYS_DBAT4U               CONFIG_SYS_IBAT4U
334
335 /* IMMRBAR @ 0xF0000000 */
336 #define CONFIG_SYS_IBAT5L               (CONFIG_SYS_IMMR |\
337                                          BATL_PP_10 |\
338                                          BATL_CACHEINHIBIT |\
339                                          BATL_GUARDEDSTORAGE)
340 #define CONFIG_SYS_IBAT5U               (CONFIG_SYS_IMMR |\
341                                          BATU_BL_128M |\
342                                          BATU_VS |\
343                                          BATU_VP)
344 #define CONFIG_SYS_DBAT5L               CONFIG_SYS_IBAT5L
345 #define CONFIG_SYS_DBAT5U               CONFIG_SYS_IBAT5U
346
347 /* NAND-Flash @ 0xE1000000, MRAM @ 0xE2000000, CPLD @ 0xE3000000 */
348 #define CONFIG_SYS_IBAT6L               (0xE0000000 |\
349                                          BATL_PP_10 |\
350                                          BATL_GUARDEDSTORAGE)
351 #define CONFIG_SYS_IBAT6U               (0xE0000000 |\
352                                          BATU_BL_256M |\
353                                          BATU_VS |\
354                                          BATU_VP)
355 #define CONFIG_SYS_DBAT6L               CONFIG_SYS_IBAT6L
356 #define CONFIG_SYS_DBAT6U               CONFIG_SYS_IBAT6U
357
358 #define CONFIG_SYS_IBAT7L               (0)
359 #define CONFIG_SYS_IBAT7U               (0)
360 #define CONFIG_SYS_DBAT7L               CONFIG_SYS_IBAT7L
361 #define CONFIG_SYS_DBAT7U               CONFIG_SYS_IBAT7U
362
363 /*
364  * U-Boot environment setup
365  */
366 #define CONFIG_BOOTP_BOOTFILESIZE
367
368 /*
369  * The reserved memory
370  */
371 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
372 #define CONFIG_SYS_MONITOR_LEN          (768 * 1024)
373 #define CONFIG_SYS_MALLOC_LEN           (8 * 1024 * 1024)
374
375 /*
376  * Environment Configuration
377  */
378 #define CONFIG_ENV_ADDR         (CONFIG_SYS_MONITOR_BASE \
379                                 + CONFIG_SYS_MONITOR_LEN)
380 #define CONFIG_ENV_SIZE         0x20000
381 #define CONFIG_ENV_ADDR_REDUND  (CONFIG_ENV_ADDR + CONFIG_ENV_SIZE)
382 #define CONFIG_ENV_SIZE_REDUND  (CONFIG_ENV_SIZE)
383
384 #define CONFIG_NETDEV                   eth1
385 #define CONFIG_HOSTNAME         "ids8313"
386 #define CONFIG_ROOTPATH         "/opt/eldk-4.2/ppc_6xx"
387 #define CONFIG_BOOTFILE         "ids8313/uImage"
388 #define CONFIG_UBOOTPATH                "ids8313/u-boot.bin"
389 #define CONFIG_FDTFILE                  "ids8313/ids8313.dtb"
390 #define CONFIG_LOADADDR         0x400000
391 #define CONFIG_ENV_FLAGS_LIST_STATIC "ethaddr:mo,eth1addr:mo"
392
393 /* Initial Memory map for Linux*/
394 #define CONFIG_SYS_BOOTMAPSZ            (256 << 20)
395
396 /*
397  * Miscellaneous configurable options
398  */
399 #define CONFIG_SYS_CBSIZE               1024
400 #define CONFIG_SYS_BARGSIZE             CONFIG_SYS_CBSIZE
401
402 #define CONFIG_SYS_MEMTEST_START        0x00001000
403 #define CONFIG_SYS_MEMTEST_END          0x00C00000
404
405 #define CONFIG_SYS_LOAD_ADDR            0x100000
406 #define CONFIG_LOADS_ECHO
407 #define CONFIG_TIMESTAMP
408 #define CONFIG_PREBOOT                  "echo;" \
409                                         "echo Type \\\"run nfsboot\\\" " \
410                                         "to mount root filesystem over NFS;echo"
411 #define CONFIG_BOOTCOMMAND              "run boot_cramfs"
412 #undef  CONFIG_SYS_LOADS_BAUD_CHANGE
413
414 #define CONFIG_JFFS2_NAND
415 #define CONFIG_JFFS2_DEV                "0"
416
417 /* mtdparts command line support */
418
419 #define CONFIG_EXTRA_ENV_SETTINGS \
420         "netdev=" __stringify(CONFIG_NETDEV) "\0"                       \
421         "ethprime=TSEC1\0"                                              \
422         "uboot=" __stringify(CONFIG_UBOOTPATH) "\0"                     \
423         "tftpflash=tftpboot ${loadaddr} ${uboot}; "                     \
424                 "protect off " __stringify(CONFIG_SYS_TEXT_BASE)        \
425                 " +${filesize}; "                                       \
426                 "erase " __stringify(CONFIG_SYS_TEXT_BASE)              \
427                 " +${filesize}; "                                       \
428                 "cp.b ${loadaddr} " __stringify(CONFIG_SYS_TEXT_BASE)   \
429                 " ${filesize}; "                                        \
430                 "protect on " __stringify(CONFIG_SYS_TEXT_BASE)         \
431                 " +${filesize}; "                                       \
432                 "cmp.b ${loadaddr} " __stringify(CONFIG_SYS_TEXT_BASE)  \
433                 " ${filesize}\0"                                        \
434         "console=ttyS0\0"                                               \
435         "fdtaddr=0x780000\0"                                            \
436         "kernel_addr=ff800000\0"                                        \
437         "fdtfile=" __stringify(CONFIG_FDTFILE) "\0"                     \
438         "setbootargs=setenv bootargs "                                  \
439                 "root=${rootdev} rw console=${console},"                \
440                         "${baudrate} ${othbootargs}\0"                  \
441         "setipargs=setenv bootargs root=${rootdev} rw "                 \
442                         "nfsroot=${serverip}:${rootpath} "              \
443                         "ip=${ipaddr}:${serverip}:${gatewayip}:"        \
444                         "${netmask}:${hostname}:${netdev}:off "         \
445                         "console=${console},${baudrate} ${othbootargs}\0" \
446         "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0"              \
447         "mtdids=" CONFIG_MTDIDS_DEFAULT "\0"                                    \
448         "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"                                \
449         "\0"
450
451 #define CONFIG_NFSBOOTCOMMAND                                           \
452         "setenv rootdev /dev/nfs;"                                      \
453         "run setipargs;run addmtd;"                                     \
454         "tftp ${loadaddr} ${bootfile};"                         \
455         "tftp ${fdtaddr} ${fdtfile};"                                   \
456         "fdt addr ${fdtaddr};"                                          \
457         "bootm ${loadaddr} - ${fdtaddr}"
458
459 /* UBI Support */
460
461 #endif  /* __CONFIG_H */