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