mpc83xx: Migrate CONFIG_SYS_IMMR to Kconfig
[platform/kernel/u-boot.git] / include / configs / sbc8349.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * WindRiver SBC8349 U-Boot configuration file.
4  * Copyright (c) 2006, 2007 Wind River Systems, Inc.
5  *
6  * Paul Gortmaker <paul.gortmaker@windriver.com>
7  * Based on the MPC8349EMDS config.
8  */
9
10 /*
11  * sbc8349 board configuration file.
12  */
13
14 #ifndef __CONFIG_H
15 #define __CONFIG_H
16
17 /*
18  * High Level Configuration Options
19  */
20 #define CONFIG_E300             1       /* E300 Family */
21
22 /* Don't enable PCI2 on sbc834x - it doesn't exist physically. */
23 #undef CONFIG_MPC83XX_PCI2              /* support for 2nd PCI controller */
24
25 #undef CONFIG_SYS_DRAM_TEST             /* memory test, takes time */
26 #define CONFIG_SYS_MEMTEST_START        0x00000000      /* memtest region */
27 #define CONFIG_SYS_MEMTEST_END          0x00100000
28
29 /*
30  * DDR Setup
31  */
32 #undef CONFIG_DDR_ECC                   /* only for ECC DDR module */
33 #undef CONFIG_DDR_ECC_CMD               /* use DDR ECC user commands */
34 #define CONFIG_SPD_EEPROM               /* use SPD EEPROM for DDR setup*/
35 #define CONFIG_SYS_83XX_DDR_USES_CS0    /* WRS; Fsl board uses CS2/CS3 */
36
37 /*
38  * 32-bit data path mode.
39  *
40  * Please note that using this mode for devices with the real density of 64-bit
41  * effectively reduces the amount of available memory due to the effect of
42  * wrapping around while translating address to row/columns, for example in the
43  * 256MB module the upper 128MB get aliased with contents of the lower
44  * 128MB); normally this define should be used for devices with real 32-bit
45  * data path.
46  */
47 #undef CONFIG_DDR_32BIT
48
49 #define CONFIG_SYS_DDR_BASE             0x00000000 /* DDR is system memory*/
50 #define CONFIG_SYS_SDRAM_BASE           CONFIG_SYS_DDR_BASE
51 #define CONFIG_SYS_DDR_SDRAM_BASE       CONFIG_SYS_DDR_BASE
52 #define CONFIG_SYS_DDR_SDRAM_CLK_CNTL   (DDR_SDRAM_CLK_CNTL_SS_EN | \
53                                 DDR_SDRAM_CLK_CNTL_CLK_ADJUST_075)
54 #define CONFIG_DDR_2T_TIMING
55
56 #if defined(CONFIG_SPD_EEPROM)
57 /*
58  * Determine DDR configuration from I2C interface.
59  */
60 #define SPD_EEPROM_ADDRESS      0x52            /* DDR DIMM */
61
62 #else
63 /*
64  * Manually set up DDR parameters
65  * NB: manual DDR setup untested on sbc834x
66  */
67 #define CONFIG_SYS_DDR_SIZE             256             /* MB */
68 #define CONFIG_SYS_DDR_CS2_CONFIG       (CSCONFIG_EN \
69                                         | CSCONFIG_ROW_BIT_13 \
70                                         | CSCONFIG_COL_BIT_10)
71 #define CONFIG_SYS_DDR_TIMING_1 0x36332321
72 #define CONFIG_SYS_DDR_TIMING_2 0x00000800      /* P9-45,may need tuning */
73 #define CONFIG_SYS_DDR_CONTROL  0xc2000000      /* unbuffered,no DYN_PWR */
74 #define CONFIG_SYS_DDR_INTERVAL 0x04060100      /* autocharge,no open page */
75
76 #if defined(CONFIG_DDR_32BIT)
77 /* set burst length to 8 for 32-bit data path */
78                                 /* DLL,normal,seq,4/2.5, 8 burst len */
79 #define CONFIG_SYS_DDR_MODE     0x00000023
80 #else
81 /* the default burst length is 4 - for 64-bit data path */
82                                 /* DLL,normal,seq,4/2.5, 4 burst len */
83 #define CONFIG_SYS_DDR_MODE     0x00000022
84 #endif
85 #endif
86
87 /*
88  * SDRAM on the Local Bus
89  */
90 #define CONFIG_SYS_LBC_SDRAM_BASE       0xF0000000      /* Localbus SDRAM */
91 #define CONFIG_SYS_LBC_SDRAM_SIZE       64              /* LBC SDRAM is 64MB */
92
93 /*
94  * FLASH on the Local Bus
95  */
96 #define CONFIG_SYS_FLASH_BASE           0xFF800000      /* start of FLASH   */
97 #define CONFIG_SYS_FLASH_SIZE           8               /* flash size in MB */
98
99
100 #define CONFIG_SYS_MAX_FLASH_BANKS      1       /* number of banks */
101 #define CONFIG_SYS_MAX_FLASH_SECT       64      /* sectors per device */
102
103 #undef CONFIG_SYS_FLASH_CHECKSUM
104 #define CONFIG_SYS_FLASH_ERASE_TOUT     60000   /* Flash Erase Timeout (ms) */
105 #define CONFIG_SYS_FLASH_WRITE_TOUT     500     /* Flash Write Timeout (ms) */
106
107 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE    /* start of monitor */
108
109 #if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
110 #define CONFIG_SYS_RAMBOOT
111 #else
112 #undef  CONFIG_SYS_RAMBOOT
113 #endif
114
115 #define CONFIG_SYS_INIT_RAM_LOCK        1
116                                         /* Initial RAM address */
117 #define CONFIG_SYS_INIT_RAM_ADDR        0xFD000000
118                                         /* Size of used area in RAM*/
119 #define CONFIG_SYS_INIT_RAM_SIZE        0x1000
120
121 #define CONFIG_SYS_GBL_DATA_OFFSET      \
122                         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
123 #define CONFIG_SYS_INIT_SP_OFFSET       CONFIG_SYS_GBL_DATA_OFFSET
124
125 #define CONFIG_SYS_MONITOR_LEN  (256 * 1024)    /* Reserve 256 kB for Mon */
126 #define CONFIG_SYS_MALLOC_LEN   (256 * 1024)    /* Reserved for malloc */
127
128 /*
129  * Local Bus LCRR and LBCR regs
130  *    LCRR:  DLL bypass, Clock divider is 4
131  * External Local Bus rate is
132  *    CLKIN * HRCWL_CSB_TO_CLKIN / HRCWL_LCL_BUS_TO_SCB_CLK / LCRR_CLKDIV
133  */
134 #define CONFIG_SYS_LCRR_DBYP    LCRR_DBYP
135 #define CONFIG_SYS_LCRR_CLKDIV  LCRR_CLKDIV_4
136 #define CONFIG_SYS_LBC_LBCR     0x00000000
137
138 #undef CONFIG_SYS_LB_SDRAM      /* if board has SDRAM on local bus */
139
140 /*
141  * Serial Port
142  */
143 #define CONFIG_SYS_NS16550_SERIAL
144 #define CONFIG_SYS_NS16550_REG_SIZE    1
145 #define CONFIG_SYS_NS16550_CLK          get_bus_freq(0)
146
147 #define CONFIG_SYS_BAUDRATE_TABLE  \
148                 {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}
149
150 #define CONFIG_SYS_NS16550_COM1        (CONFIG_SYS_IMMR+0x4500)
151 #define CONFIG_SYS_NS16550_COM2        (CONFIG_SYS_IMMR+0x4600)
152
153 /* I2C */
154 #define CONFIG_SYS_I2C
155 #define CONFIG_SYS_I2C_FSL
156 #define CONFIG_SYS_FSL_I2C_SPEED        400000
157 #define CONFIG_SYS_FSL_I2C_SLAVE        0x7F
158 #define CONFIG_SYS_FSL_I2C_OFFSET       0x3000
159 #define CONFIG_SYS_FSL_I2C2_SPEED       400000
160 #define CONFIG_SYS_FSL_I2C2_SLAVE       0x7F
161 #define CONFIG_SYS_FSL_I2C2_OFFSET      0x3100
162 #define CONFIG_SYS_I2C_NOPROBES         { {0, 0x69}, {1, 0x69} }
163 /* could also use CONFIG_I2C_MULTI_BUS and CONFIG_SYS_SPD_BUS_NUM... */
164
165 /* TSEC */
166 #define CONFIG_SYS_TSEC1_OFFSET 0x24000
167 #define CONFIG_SYS_TSEC1        (CONFIG_SYS_IMMR+CONFIG_SYS_TSEC1_OFFSET)
168 #define CONFIG_SYS_TSEC2_OFFSET 0x25000
169 #define CONFIG_SYS_TSEC2        (CONFIG_SYS_IMMR+CONFIG_SYS_TSEC2_OFFSET)
170
171 /*
172  * General PCI
173  * Addresses are mapped 1-1.
174  */
175 #define CONFIG_SYS_PCI1_MEM_BASE        0x80000000
176 #define CONFIG_SYS_PCI1_MEM_PHYS        CONFIG_SYS_PCI1_MEM_BASE
177 #define CONFIG_SYS_PCI1_MEM_SIZE        0x10000000      /* 256M */
178 #define CONFIG_SYS_PCI1_MMIO_BASE       0x90000000
179 #define CONFIG_SYS_PCI1_MMIO_PHYS       CONFIG_SYS_PCI1_MMIO_BASE
180 #define CONFIG_SYS_PCI1_MMIO_SIZE       0x10000000      /* 256M */
181 #define CONFIG_SYS_PCI1_IO_BASE         0x00000000
182 #define CONFIG_SYS_PCI1_IO_PHYS         0xE2000000
183 #define CONFIG_SYS_PCI1_IO_SIZE         0x00100000      /* 1M */
184
185 #define CONFIG_SYS_PCI2_MEM_BASE        0xA0000000
186 #define CONFIG_SYS_PCI2_MEM_PHYS        CONFIG_SYS_PCI2_MEM_BASE
187 #define CONFIG_SYS_PCI2_MEM_SIZE        0x10000000      /* 256M */
188 #define CONFIG_SYS_PCI2_MMIO_BASE       0xB0000000
189 #define CONFIG_SYS_PCI2_MMIO_PHYS       CONFIG_SYS_PCI2_MMIO_BASE
190 #define CONFIG_SYS_PCI2_MMIO_SIZE       0x10000000      /* 256M */
191 #define CONFIG_SYS_PCI2_IO_BASE         0x00000000
192 #define CONFIG_SYS_PCI2_IO_PHYS         0xE2100000
193 #define CONFIG_SYS_PCI2_IO_SIZE         0x00100000      /* 1M */
194
195 #if defined(CONFIG_PCI)
196
197 #undef CONFIG_EEPRO100
198 #undef CONFIG_TULIP
199
200 #if !defined(CONFIG_PCI_PNP)
201         #define PCI_ENET0_IOADDR        0xFIXME
202         #define PCI_ENET0_MEMADDR       0xFIXME
203         #define PCI_IDSEL_NUMBER        0xFIXME
204 #endif
205
206 #undef CONFIG_PCI_SCAN_SHOW             /* show pci devices on startup */
207 #define CONFIG_SYS_PCI_SUBSYS_VENDORID 0x1057  /* Motorola */
208
209 #endif  /* CONFIG_PCI */
210
211 /*
212  * TSEC configuration
213  */
214
215 #if defined(CONFIG_TSEC_ENET)
216
217 #define CONFIG_TSEC1    1
218 #define CONFIG_TSEC1_NAME       "TSEC0"
219 #define CONFIG_TSEC2    1
220 #define CONFIG_TSEC2_NAME       "TSEC1"
221 #define CONFIG_PHY_BCM5421S     1
222 #define TSEC1_PHY_ADDR          0x19
223 #define TSEC2_PHY_ADDR          0x1a
224 #define TSEC1_PHYIDX            0
225 #define TSEC2_PHYIDX            0
226 #define TSEC1_FLAGS             TSEC_GIGABIT
227 #define TSEC2_FLAGS             TSEC_GIGABIT
228
229 /* Options are: TSEC[0-1] */
230 #define CONFIG_ETHPRIME         "TSEC0"
231
232 #endif  /* CONFIG_TSEC_ENET */
233
234 /*
235  * Environment
236  */
237 #ifndef CONFIG_SYS_RAMBOOT
238         #define CONFIG_ENV_ADDR         (CONFIG_SYS_MONITOR_BASE + 0x40000)
239         #define CONFIG_ENV_SECT_SIZE    0x20000 /* 128K(one sector) for env */
240         #define CONFIG_ENV_SIZE         0x2000
241
242 /* Address and size of Redundant Environment Sector     */
243 #define CONFIG_ENV_ADDR_REDUND  (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
244 #define CONFIG_ENV_SIZE_REDUND  (CONFIG_ENV_SIZE)
245
246 #else
247         #define CONFIG_ENV_ADDR         (CONFIG_SYS_MONITOR_BASE - 0x1000)
248         #define CONFIG_ENV_SIZE         0x2000
249 #endif
250
251 #define CONFIG_LOADS_ECHO       1       /* echo on for serial download */
252 #define CONFIG_SYS_LOADS_BAUD_CHANGE    1       /* allow baudrate change */
253
254 /*
255  * BOOTP options
256  */
257 #define CONFIG_BOOTP_BOOTFILESIZE
258
259 /*
260  * Command line configuration.
261  */
262
263 #undef CONFIG_WATCHDOG                  /* watchdog disabled */
264
265 /*
266  * Miscellaneous configurable options
267  */
268 #define CONFIG_SYS_LOAD_ADDR    0x2000000       /* default load address */
269
270 /*
271  * For booting Linux, the board info and command line data
272  * have to be in the first 256 MB of memory, since this is
273  * the maximum mapped by the Linux kernel during initialization.
274  */
275                                 /* Initial Memory map for Linux*/
276 #define CONFIG_SYS_BOOTMAPSZ    (256 << 20)
277
278 #define CONFIG_SYS_RCWH_PCIHOST 0x80000000 /* PCIHOST  */
279
280 /* System IO Config */
281 #define CONFIG_SYS_SICRH 0
282 #define CONFIG_SYS_SICRL SICRL_LDP_A
283
284 #ifdef CONFIG_PCI
285 #define CONFIG_PCI_INDIRECT_BRIDGE
286 #endif
287
288 #if defined(CONFIG_CMD_KGDB)
289 #define CONFIG_KGDB_BAUDRATE    230400  /* speed of kgdb serial port */
290 #endif
291
292 /*
293  * Environment Configuration
294  */
295 #define CONFIG_ENV_OVERWRITE
296
297 #if defined(CONFIG_TSEC_ENET)
298 #define CONFIG_HAS_ETH0
299 #define CONFIG_HAS_ETH1
300 #endif
301
302 #define CONFIG_HOSTNAME         "SBC8349"
303 #define CONFIG_ROOTPATH         "/tftpboot/rootfs"
304 #define CONFIG_BOOTFILE         "uImage"
305
306                                 /* default location for tftp and bootm */
307 #define CONFIG_LOADADDR         800000
308
309 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
310         "netdev=eth0\0"                                                 \
311         "hostname=sbc8349\0"                                            \
312         "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
313                 "nfsroot=${serverip}:${rootpath}\0"                     \
314         "ramargs=setenv bootargs root=/dev/ram rw\0"                    \
315         "addip=setenv bootargs ${bootargs} "                            \
316                 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
317                 ":${hostname}:${netdev}:off panic=1\0"                  \
318         "addtty=setenv bootargs ${bootargs} console=ttyS0,${baudrate}\0"\
319         "flash_nfs=run nfsargs addip addtty;"                           \
320                 "bootm ${kernel_addr}\0"                                \
321         "flash_self=run ramargs addip addtty;"                          \
322                 "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
323         "net_nfs=tftp 200000 ${bootfile};run nfsargs addip addtty;"     \
324                 "bootm\0"                                               \
325         "load=tftp 100000 /tftpboot/sbc8349/u-boot.bin\0"               \
326         "update=protect off ff800000 ff83ffff; "                        \
327                 "era ff800000 ff83ffff; cp.b 100000 ff800000 ${filesize}\0" \
328         "upd=run load update\0"                                         \
329         "fdtaddr=780000\0"                                              \
330         "fdtfile=sbc8349.dtb\0"                                         \
331         ""
332
333 #define CONFIG_NFSBOOTCOMMAND                                           \
334         "setenv bootargs root=/dev/nfs rw "                             \
335                 "nfsroot=$serverip:$rootpath "                          \
336                 "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:"   \
337                                                         "$netdev:off "  \
338                 "console=$consoledev,$baudrate $othbootargs;"           \
339         "tftp $loadaddr $bootfile;"                                     \
340         "tftp $fdtaddr $fdtfile;"                                       \
341         "bootm $loadaddr - $fdtaddr"
342
343 #define CONFIG_RAMBOOTCOMMAND                                           \
344         "setenv bootargs root=/dev/ram rw "                             \
345                 "console=$consoledev,$baudrate $othbootargs;"           \
346         "tftp $ramdiskaddr $ramdiskfile;"                               \
347         "tftp $loadaddr $bootfile;"                                     \
348         "tftp $fdtaddr $fdtfile;"                                       \
349         "bootm $loadaddr $ramdiskaddr $fdtaddr"
350
351 #define CONFIG_BOOTCOMMAND      "run flash_self"
352
353 #endif  /* __CONFIG_H */