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