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