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