microblaze: Get rid of xparameters.h
[platform/kernel/u-boot.git] / include / configs / microblaze-generic.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * (C) Copyright 2007-2010 Michal Simek
4  *
5  * Michal SIMEK <monstr@monstr.eu>
6  */
7
8 #ifndef __CONFIG_H
9 #define __CONFIG_H
10
11 /* Microblaze is microblaze_0 */
12 #define XILINX_FSL_NUMBER       3
13
14 /* Flash Memory is FLASH_2Mx32 */
15 #define XILINX_FLASH_START      0x2c000000
16 #define XILINX_FLASH_SIZE       0x00800000
17
18 /* MicroBlaze CPU */
19 #define MICROBLAZE_V5           1
20
21 #define CONFIG_SYS_BOOTM_LEN    (64 * 1024 * 1024)
22
23 /* linear and spi flash memory */
24 #ifdef XILINX_FLASH_START
25 #define FLASH
26 #undef  SPIFLASH
27 #undef  RAMENV  /* hold environment in flash */
28 #else
29 #undef  FLASH
30 #undef  SPIFLASH
31 #define RAMENV  /* hold environment in RAM */
32 #endif
33
34 /* uart */
35 /* The following table includes the supported baudrates */
36 # define CONFIG_SYS_BAUDRATE_TABLE \
37         {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400}
38
39 /* setting reset address */
40 /*#define       CONFIG_SYS_RESET_ADDRESS        CONFIG_SYS_TEXT_BASE*/
41
42 #define CONFIG_SYS_MALLOC_LEN   0xC0000
43
44 /* Stack location before relocation */
45 #define CONFIG_SYS_INIT_SP_OFFSET       (CONFIG_SYS_TEXT_BASE - \
46                                          CONFIG_SYS_MALLOC_F_LEN)
47
48 /*
49  * CFI flash memory layout - Example
50  * CONFIG_SYS_FLASH_BASE = 0x2200_0000;
51  * CONFIG_SYS_FLASH_SIZE = 0x0080_0000;   8MB
52  *
53  * SECT_SIZE = 0x20000;                 128kB is one sector
54  * CONFIG_ENV_SIZE = SECT_SIZE;         128kB environment store
55  *
56  * 0x2200_0000  CONFIG_SYS_FLASH_BASE
57  *                                      FREE            256kB
58  * 0x2204_0000  CONFIG_ENV_ADDR
59  *                                      ENV_AREA        128kB
60  * 0x2206_0000
61  *                                      FREE
62  * 0x2280_0000  CONFIG_SYS_FLASH_BASE + CONFIG_SYS_FLASH_SIZE
63  *
64  */
65
66 #ifdef FLASH
67 # define CONFIG_SYS_FLASH_BASE          XILINX_FLASH_START
68 # define CONFIG_SYS_FLASH_SIZE          XILINX_FLASH_SIZE
69 /* ?empty sector */
70 # define CONFIG_SYS_FLASH_EMPTY_INFO    1
71 /* max number of memory banks */
72 # define CONFIG_SYS_MAX_FLASH_BANKS     1
73 /* max number of sectors on one chip */
74 # define CONFIG_SYS_MAX_FLASH_SECT      512
75 #endif /* !FLASH */
76
77 #define CONFIG_ICACHE
78 #define CONFIG_DCACHE
79
80 #ifndef XILINX_DCACHE_BYTE_SIZE
81 #define XILINX_DCACHE_BYTE_SIZE 32768
82 #endif
83
84 /*
85  * BOOTP options
86  */
87 #define CONFIG_BOOTP_BOOTFILESIZE
88
89 /* size of console buffer */
90 #define CONFIG_SYS_CBSIZE       512
91 /* max number of command args */
92 #define CONFIG_SYS_MAXARGS      15
93 /* default load address */
94 #define CONFIG_SYS_LOAD_ADDR    0
95
96 #define CONFIG_HOSTNAME         "microblaze-generic"
97
98 /* architecture dependent code */
99 #define CONFIG_SYS_USR_EXCEP    /* user exception */
100
101 #if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
102 #define BOOT_TARGET_DEVICES_PXE(func)   func(PXE, pxe, na)
103 #else
104 #define BOOT_TARGET_DEVICES_PXE(func)
105 #endif
106
107 #if defined(CONFIG_CMD_DHCP)
108 #define BOOT_TARGET_DEVICES_DHCP(func)  func(DHCP, dhcp, na)
109 #else
110 #define BOOT_TARGET_DEVICES_DHCP(func)
111 #endif
112
113 #if defined(CONFIG_SPI_FLASH)
114 # define BOOT_TARGET_DEVICES_QSPI(func) func(QSPI, qspi, na)
115 #else
116 # define BOOT_TARGET_DEVICES_QSPI(func)
117 #endif
118
119 #define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \
120         "bootcmd_qspi=sf probe 0 0 0 && " \
121         "sf read ${scriptaddr} ${script_offset_f} ${script_size_f} && " \
122         "echo QSPI: Trying to boot script at ${scriptaddr} && " \
123         "source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;\0"
124
125 #define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \
126         "qspi "
127
128 #define BOOT_TARGET_DEVICES_JTAG(func)  func(JTAG, jtag, na)
129
130 #define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
131         "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
132                 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
133
134 #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
135         "jtag "
136
137 #define BOOT_TARGET_DEVICES(func) \
138         BOOT_TARGET_DEVICES_JTAG(func) \
139         BOOT_TARGET_DEVICES_QSPI(func)  \
140         BOOT_TARGET_DEVICES_DHCP(func) \
141         BOOT_TARGET_DEVICES_PXE(func)
142
143 #include <config_distro_bootcmd.h>
144
145 #ifndef CONFIG_EXTRA_ENV_SETTINGS
146 #define CONFIG_EXTRA_ENV_SETTINGS \
147         "unlock=yes\0"\
148         "nor0=flash-0\0"\
149         "mtdparts=mtdparts=flash-0:"\
150         "256k(u-boot),256k(env),3m(kernel),"\
151         "1m(romfs),1m(cramfs),-(jffs2)\0"\
152         "nc=setenv stdout nc;"\
153         "setenv stdin nc\0" \
154         "serial=setenv stdout serial;"\
155         "setenv stdin serial\0"\
156         "script_size_f=0x40000\0"\
157         BOOTENV
158 #endif
159
160 #if defined(CONFIG_XILINX_AXIEMAC)
161 # define CONFIG_SYS_FAULT_ECHO_LINK_DOWN        1
162 #endif
163
164 /* SPL part */
165
166 #ifdef CONFIG_SYS_FLASH_BASE
167 # define CONFIG_SYS_UBOOT_BASE          CONFIG_SYS_FLASH_BASE
168 #endif
169
170 /* for booting directly linux */
171
172 #define CONFIG_SYS_FDT_BASE             (CONFIG_SYS_FLASH_BASE + \
173                                          0x40000)
174 #define CONFIG_SYS_FDT_SIZE             (16 << 10)
175 #define CONFIG_SYS_SPL_ARGS_ADDR        (CONFIG_SYS_TEXT_BASE + \
176                                          0x1000000)
177
178 /* SP location before relocation, must use scratch RAM */
179 /* BRAM start */
180 #define CONFIG_SYS_INIT_RAM_ADDR        0x0
181 /* BRAM size - will be generated */
182 #define CONFIG_SYS_INIT_RAM_SIZE        0x100000
183
184 # define CONFIG_SPL_STACK_ADDR          (CONFIG_SYS_INIT_RAM_ADDR + \
185                                          CONFIG_SYS_INIT_RAM_SIZE)
186
187 /* Just for sure that there is a space for stack */
188 #define CONFIG_SPL_STACK_SIZE           0x100
189
190 #define CONFIG_SPL_MAX_FOOTPRINT        (CONFIG_SYS_INIT_RAM_SIZE - \
191                                          CONFIG_SYS_INIT_RAM_ADDR - \
192                                          CONFIG_SYS_MALLOC_F_LEN - \
193                                          CONFIG_SPL_STACK_SIZE)
194
195 #endif  /* __CONFIG_H */