blob: 59b20cf116a838e6161dbbe5a57a68e0e4170bae [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Michal Simek952d5142007-03-11 13:42:58 +01002/*
Michal Simek04c379f2010-08-02 14:20:28 +02003 * (C) Copyright 2007-2010 Michal Simek
Michal Simek952d5142007-03-11 13:42:58 +01004 *
Michal Simekd83d07e2007-09-24 00:30:42 +02005 * Michal SIMEK <monstr@monstr.eu>
Michal Simek952d5142007-03-11 13:42:58 +01006 */
7
8#ifndef __CONFIG_H
9#define __CONFIG_H
10
Michal Simekb1395032020-11-04 16:00:38 +010011/* Microblaze is microblaze_0 */
12#define XILINX_FSL_NUMBER 3
13
Michal Simek04c379f2010-08-02 14:20:28 +020014/* MicroBlaze CPU */
Michal Simek3af398e2007-05-08 14:52:52 +020015#define MICROBLAZE_V5 1
Michal Simek952d5142007-03-11 13:42:58 +010016
Michal Simeka5910512019-09-25 11:12:40 +020017#define CONFIG_SYS_BOOTM_LEN (64 * 1024 * 1024)
18
Michal Simek952d5142007-03-11 13:42:58 +010019/* uart */
Michal Simekc7ff40a2015-12-09 12:42:16 +010020/* 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
Michal Simek952d5142007-03-11 13:42:58 +010024/* setting reset address */
Wolfgang Denk0708bc62010-10-07 21:51:12 +020025/*#define CONFIG_SYS_RESET_ADDRESS CONFIG_SYS_TEXT_BASE*/
Michal Simek952d5142007-03-11 13:42:58 +010026
Michal Simek65e915c2014-05-08 16:08:44 +020027#define CONFIG_SYS_MALLOC_LEN 0xC0000
Michal Simek952d5142007-03-11 13:42:58 +010028
Michal Simek65e915c2014-05-08 16:08:44 +020029/* Stack location before relocation */
Michal Simek7cb7ae72015-12-08 14:34:13 +010030#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_TEXT_BASE - \
31 CONFIG_SYS_MALLOC_F_LEN)
Michal Simek952d5142007-03-11 13:42:58 +010032
Michal Simekf3e2c9d2020-11-04 16:14:06 +010033#ifdef CONFIG_CFI_FLASH
Michal Simek04c379f2010-08-02 14:20:28 +020034/* ?empty sector */
35# define CONFIG_SYS_FLASH_EMPTY_INFO 1
36/* max number of memory banks */
37# define CONFIG_SYS_MAX_FLASH_BANKS 1
38/* max number of sectors on one chip */
Michal Simekf3e2c9d2020-11-04 16:14:06 +010039# define CONFIG_SYS_MAX_FLASH_SECT 2048
40#endif
Michal Simek952d5142007-03-11 13:42:58 +010041
Michal Simek025e8cf2020-11-04 15:58:04 +010042#define CONFIG_ICACHE
43#define CONFIG_DCACHE
Michal Simekf95f6dc2009-01-05 13:29:32 +010044
Michal Simeke3aa3d52012-09-25 10:13:35 +020045#ifndef XILINX_DCACHE_BYTE_SIZE
46#define XILINX_DCACHE_BYTE_SIZE 32768
47#endif
48
Jon Loeliger316d2342007-07-04 22:33:01 -050049/*
Jon Loeliger5c4ddae2007-07-10 10:12:10 -050050 * BOOTP options
51 */
52#define CONFIG_BOOTP_BOOTFILESIZE
Michal Simek952d5142007-03-11 13:42:58 +010053
Michal Simek04c379f2010-08-02 14:20:28 +020054/* size of console buffer */
55#define CONFIG_SYS_CBSIZE 512
Michal Simek04c379f2010-08-02 14:20:28 +020056/* max number of command args */
57#define CONFIG_SYS_MAXARGS 15
Michal Simek04c379f2010-08-02 14:20:28 +020058/* default load address */
Michal Simek6a41aad2015-12-11 14:45:29 +010059#define CONFIG_SYS_LOAD_ADDR 0
Michal Simek952d5142007-03-11 13:42:58 +010060
Mario Six790d8442018-03-28 14:38:20 +020061#define CONFIG_HOSTNAME "microblaze-generic"
Michal Simek952d5142007-03-11 13:42:58 +010062
63/* architecture dependent code */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020064#define CONFIG_SYS_USR_EXCEP /* user exception */
Michal Simek952d5142007-03-11 13:42:58 +010065
T Karthik Reddye539c262020-09-22 05:18:55 -060066#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
67#define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
68#else
69#define BOOT_TARGET_DEVICES_PXE(func)
70#endif
71
72#if defined(CONFIG_CMD_DHCP)
73#define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
74#else
75#define BOOT_TARGET_DEVICES_DHCP(func)
76#endif
77
78#if defined(CONFIG_SPI_FLASH)
79# define BOOT_TARGET_DEVICES_QSPI(func) func(QSPI, qspi, na)
80#else
81# define BOOT_TARGET_DEVICES_QSPI(func)
82#endif
83
T Karthik Reddy885f2312020-12-17 03:15:56 -070084#if defined(CONFIG_MTD_NOR_FLASH)
85# define BOOT_TARGET_DEVICES_NOR(func) func(NOR, nor, na)
86#else
87# define BOOT_TARGET_DEVICES_NOR(func)
88#endif
89
90#define BOOTENV_DEV_NOR(devtypeu, devtypel, instance) \
91 "bootcmd_nor=cp.b ${script_offset_nor} ${scriptaddr} ${script_size_f} && " \
92 "echo NOR: Trying to boot script at ${scriptaddr} && " \
93 "source ${scriptaddr}; echo NOR: SCRIPT FAILED: continuing...;\0"
94
95#define BOOTENV_DEV_NAME_NOR(devtypeu, devtypel, instance) \
96 "nor "
97
T Karthik Reddye539c262020-09-22 05:18:55 -060098#define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \
99 "bootcmd_qspi=sf probe 0 0 0 && " \
100 "sf read ${scriptaddr} ${script_offset_f} ${script_size_f} && " \
101 "echo QSPI: Trying to boot script at ${scriptaddr} && " \
102 "source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;\0"
103
104#define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \
105 "qspi "
106
107#define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
108
109#define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
110 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
111 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
112
113#define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
114 "jtag "
115
116#define BOOT_TARGET_DEVICES(func) \
117 BOOT_TARGET_DEVICES_JTAG(func) \
T Karthik Reddy885f2312020-12-17 03:15:56 -0700118 BOOT_TARGET_DEVICES_QSPI(func) \
119 BOOT_TARGET_DEVICES_NOR(func) \
T Karthik Reddye539c262020-09-22 05:18:55 -0600120 BOOT_TARGET_DEVICES_DHCP(func) \
121 BOOT_TARGET_DEVICES_PXE(func)
122
123#include <config_distro_bootcmd.h>
124
Michal Simek31caa372016-05-10 13:11:19 +0200125#ifndef CONFIG_EXTRA_ENV_SETTINGS
T Karthik Reddya3627ee2020-09-22 05:18:52 -0600126#define CONFIG_EXTRA_ENV_SETTINGS \
127 "unlock=yes\0"\
128 "nor0=flash-0\0"\
129 "mtdparts=mtdparts=flash-0:"\
130 "256k(u-boot),256k(env),3m(kernel),"\
131 "1m(romfs),1m(cramfs),-(jffs2)\0"\
132 "nc=setenv stdout nc;"\
133 "setenv stdin nc\0" \
134 "serial=setenv stdout serial;"\
T Karthik Reddye539c262020-09-22 05:18:55 -0600135 "setenv stdin serial\0"\
136 "script_size_f=0x40000\0"\
137 BOOTENV
Michal Simek31caa372016-05-10 13:11:19 +0200138#endif
Michal Simekab340232007-04-24 23:01:02 +0200139
Michal Simek31627322015-12-02 17:22:07 +0100140#if defined(CONFIG_XILINX_AXIEMAC)
Stephan Linzbe0ea372012-02-24 18:33:41 +0100141# define CONFIG_SYS_FAULT_ECHO_LINK_DOWN 1
Stephan Linzbe0ea372012-02-24 18:33:41 +0100142#endif
143
Michal Simek26acb3e2014-01-21 07:30:37 +0100144/* SPL part */
Michal Simek26acb3e2014-01-21 07:30:37 +0100145
Michal Simek736c1e642020-11-04 16:12:20 +0100146#define CONFIG_SYS_UBOOT_BASE CONFIG_SYS_TEXT_BASE
Michal Simek26acb3e2014-01-21 07:30:37 +0100147
148/* for booting directly linux */
Michal Simek736c1e642020-11-04 16:12:20 +0100149#define CONFIG_SYS_FDT_BASE (CONFIG_SYS_TEXT_BASE + \
150 0x40000)
Michal Simek26acb3e2014-01-21 07:30:37 +0100151
Michal Simek26acb3e2014-01-21 07:30:37 +0100152#define CONFIG_SYS_SPL_ARGS_ADDR (CONFIG_SYS_TEXT_BASE + \
153 0x1000000)
154
155/* SP location before relocation, must use scratch RAM */
156/* BRAM start */
157#define CONFIG_SYS_INIT_RAM_ADDR 0x0
158/* BRAM size - will be generated */
Michal Simekfb8e3842015-02-03 16:24:48 +0100159#define CONFIG_SYS_INIT_RAM_SIZE 0x100000
Michal Simek26acb3e2014-01-21 07:30:37 +0100160
Michal Simekfb8e3842015-02-03 16:24:48 +0100161# define CONFIG_SPL_STACK_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
Ovidiu Panaite6dbb8b2020-09-24 11:54:37 +0300162 CONFIG_SYS_INIT_RAM_SIZE)
Michal Simek26acb3e2014-01-21 07:30:37 +0100163
164/* Just for sure that there is a space for stack */
165#define CONFIG_SPL_STACK_SIZE 0x100
166
Michal Simek26acb3e2014-01-21 07:30:37 +0100167#define CONFIG_SPL_MAX_FOOTPRINT (CONFIG_SYS_INIT_RAM_SIZE - \
168 CONFIG_SYS_INIT_RAM_ADDR - \
Michal Simekfb8e3842015-02-03 16:24:48 +0100169 CONFIG_SYS_MALLOC_F_LEN - \
Michal Simek26acb3e2014-01-21 07:30:37 +0100170 CONFIG_SPL_STACK_SIZE)
171
Michal Simek952d5142007-03-11 13:42:58 +0100172#endif /* __CONFIG_H */