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