Convert CONFIG_SYS_LOAD_ADDR to Kconfig
[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 /* MicroBlaze CPU */
15 #define MICROBLAZE_V5           1
16
17 #define CONFIG_SYS_BOOTM_LEN    (64 * 1024 * 1024)
18
19 /* uart */
20 /* The following table includes the supported baudrates */
21 # define CONFIG_SYS_BAUDRATE_TABLE \
22         {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400}
23
24 /* setting reset address */
25 /*#define       CONFIG_SYS_RESET_ADDRESS        CONFIG_SYS_TEXT_BASE*/
26
27 #define CONFIG_SYS_MALLOC_LEN   0xC0000
28
29 /* Stack location before relocation */
30 #define CONFIG_SYS_INIT_SP_OFFSET       (CONFIG_SYS_TEXT_BASE - \
31                                          CONFIG_SYS_MALLOC_F_LEN)
32
33 #ifdef CONFIG_CFI_FLASH
34 /* ?empty sector */
35 # define CONFIG_SYS_FLASH_EMPTY_INFO    1
36 /* max number of memory banks */
37 # define CONFIG_SYS_MAX_FLASH_BANKS     1
38 /* max number of sectors on one chip */
39 # define CONFIG_SYS_MAX_FLASH_SECT      2048
40 #endif
41
42 #define CONFIG_ICACHE
43 #define CONFIG_DCACHE
44
45 #ifndef XILINX_DCACHE_BYTE_SIZE
46 #define XILINX_DCACHE_BYTE_SIZE 32768
47 #endif
48
49 /*
50  * BOOTP options
51  */
52 #define CONFIG_BOOTP_BOOTFILESIZE
53
54 /* size of console buffer */
55 #define CONFIG_SYS_CBSIZE       512
56 /* max number of command args */
57 #define CONFIG_SYS_MAXARGS      15
58
59 #define CONFIG_HOSTNAME         "microblaze-generic"
60
61 /* architecture dependent code */
62 #define CONFIG_SYS_USR_EXCEP    /* user exception */
63
64 #if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
65 #define BOOT_TARGET_DEVICES_PXE(func)   func(PXE, pxe, na)
66 #else
67 #define BOOT_TARGET_DEVICES_PXE(func)
68 #endif
69
70 #if defined(CONFIG_CMD_DHCP)
71 #define BOOT_TARGET_DEVICES_DHCP(func)  func(DHCP, dhcp, na)
72 #else
73 #define BOOT_TARGET_DEVICES_DHCP(func)
74 #endif
75
76 #if defined(CONFIG_SPI_FLASH)
77 # define BOOT_TARGET_DEVICES_QSPI(func) func(QSPI, qspi, na)
78 #else
79 # define BOOT_TARGET_DEVICES_QSPI(func)
80 #endif
81
82 #if defined(CONFIG_MTD_NOR_FLASH)
83 # define BOOT_TARGET_DEVICES_NOR(func)  func(NOR, nor, na)
84 #else
85 # define BOOT_TARGET_DEVICES_NOR(func)
86 #endif
87
88 #define BOOTENV_DEV_NOR(devtypeu, devtypel, instance) \
89         "bootcmd_nor=cp.b ${script_offset_nor} ${scriptaddr} ${script_size_f} && " \
90                 "echo NOR: Trying to boot script at ${scriptaddr} && " \
91                 "source ${scriptaddr}; echo NOR: SCRIPT FAILED: continuing...;\0"
92
93 #define BOOTENV_DEV_NAME_NOR(devtypeu, devtypel, instance) \
94         "nor "
95
96 #define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \
97         "bootcmd_qspi=sf probe 0 0 0 && " \
98         "sf read ${scriptaddr} ${script_offset_f} ${script_size_f} && " \
99         "echo QSPI: Trying to boot script at ${scriptaddr} && " \
100         "source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;\0"
101
102 #define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \
103         "qspi "
104
105 #define BOOT_TARGET_DEVICES_JTAG(func)  func(JTAG, jtag, na)
106
107 #define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
108         "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
109                 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
110
111 #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
112         "jtag "
113
114 #define BOOT_TARGET_DEVICES(func) \
115         BOOT_TARGET_DEVICES_JTAG(func) \
116         BOOT_TARGET_DEVICES_QSPI(func) \
117         BOOT_TARGET_DEVICES_NOR(func) \
118         BOOT_TARGET_DEVICES_DHCP(func) \
119         BOOT_TARGET_DEVICES_PXE(func)
120
121 #include <config_distro_bootcmd.h>
122
123 #ifndef CONFIG_EXTRA_ENV_SETTINGS
124 #define CONFIG_EXTRA_ENV_SETTINGS \
125         "unlock=yes\0"\
126         "nor0=flash-0\0"\
127         "mtdparts=mtdparts=flash-0:"\
128         "256k(u-boot),256k(env),3m(kernel),"\
129         "1m(romfs),1m(cramfs),-(jffs2)\0"\
130         "nc=setenv stdout nc;"\
131         "setenv stdin nc\0" \
132         "serial=setenv stdout serial;"\
133         "setenv stdin serial\0"\
134         "script_size_f=0x40000\0"\
135         BOOTENV
136 #endif
137
138 #if defined(CONFIG_XILINX_AXIEMAC)
139 # define CONFIG_SYS_FAULT_ECHO_LINK_DOWN        1
140 #endif
141
142 /* SPL part */
143
144 #define CONFIG_SYS_UBOOT_BASE           CONFIG_SYS_TEXT_BASE
145
146 /* for booting directly linux */
147 #define CONFIG_SYS_FDT_BASE             (CONFIG_SYS_TEXT_BASE + \
148                                         0x40000)
149
150 #define CONFIG_SYS_SPL_ARGS_ADDR        (CONFIG_SYS_TEXT_BASE + \
151                                          0x1000000)
152
153 /* SP location before relocation, must use scratch RAM */
154 /* BRAM start */
155 #define CONFIG_SYS_INIT_RAM_ADDR        0x0
156 /* BRAM size - will be generated */
157 #define CONFIG_SYS_INIT_RAM_SIZE        0x100000
158
159 # define CONFIG_SPL_STACK_ADDR          (CONFIG_SYS_INIT_RAM_ADDR + \
160                                          CONFIG_SYS_INIT_RAM_SIZE)
161
162 /* Just for sure that there is a space for stack */
163 #define CONFIG_SPL_STACK_SIZE           0x100
164
165 #define CONFIG_SPL_MAX_FOOTPRINT        (CONFIG_SYS_INIT_RAM_SIZE - \
166                                          CONFIG_SYS_INIT_RAM_ADDR - \
167                                          CONFIG_SYS_MALLOC_F_LEN - \
168                                          CONFIG_SPL_STACK_SIZE)
169
170 #endif  /* __CONFIG_H */