blob: 2cfcace7b066b4c2928ce41b8f48149247f53277 [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
14/* Flash Memory is FLASH_2Mx32 */
15#define XILINX_FLASH_START 0x2c000000
16#define XILINX_FLASH_SIZE 0x00800000
Michal Simek952d5142007-03-11 13:42:58 +010017
Michal Simek04c379f2010-08-02 14:20:28 +020018/* MicroBlaze CPU */
Michal Simek3af398e2007-05-08 14:52:52 +020019#define MICROBLAZE_V5 1
Michal Simek952d5142007-03-11 13:42:58 +010020
Michal Simeka5910512019-09-25 11:12:40 +020021#define CONFIG_SYS_BOOTM_LEN (64 * 1024 * 1024)
22
Stephan Linz9f4b68e2012-07-29 00:25:36 +020023/* linear and spi flash memory */
Stephan Linzd6471312012-06-27 00:28:25 +020024#ifdef XILINX_FLASH_START
25#define FLASH
Stephan Linz9f4b68e2012-07-29 00:25:36 +020026#undef SPIFLASH
Stephan Linzd6471312012-06-27 00:28:25 +020027#undef RAMENV /* hold environment in flash */
28#else
Stephan Linz9f4b68e2012-07-29 00:25:36 +020029#undef FLASH
30#undef SPIFLASH
Stephan Linzd6471312012-06-27 00:28:25 +020031#define RAMENV /* hold environment in RAM */
32#endif
33
Michal Simek952d5142007-03-11 13:42:58 +010034/* uart */
Michal Simekc7ff40a2015-12-09 12:42:16 +010035/* The following table includes the supported baudrates */
36# define CONFIG_SYS_BAUDRATE_TABLE \
37 {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400}
38
Michal Simek952d5142007-03-11 13:42:58 +010039/* setting reset address */
Wolfgang Denk0708bc62010-10-07 21:51:12 +020040/*#define CONFIG_SYS_RESET_ADDRESS CONFIG_SYS_TEXT_BASE*/
Michal Simek952d5142007-03-11 13:42:58 +010041
Michal Simek65e915c2014-05-08 16:08:44 +020042#define CONFIG_SYS_MALLOC_LEN 0xC0000
Michal Simek952d5142007-03-11 13:42:58 +010043
Michal Simek65e915c2014-05-08 16:08:44 +020044/* Stack location before relocation */
Michal Simek7cb7ae72015-12-08 14:34:13 +010045#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_TEXT_BASE - \
46 CONFIG_SYS_MALLOC_F_LEN)
Michal Simek952d5142007-03-11 13:42:58 +010047
Stephan Linz61c229f2012-07-01 16:44:37 +020048/*
49 * CFI flash memory layout - Example
50 * CONFIG_SYS_FLASH_BASE = 0x2200_0000;
51 * CONFIG_SYS_FLASH_SIZE = 0x0080_0000; 8MB
52 *
53 * SECT_SIZE = 0x20000; 128kB is one sector
54 * CONFIG_ENV_SIZE = SECT_SIZE; 128kB environment store
55 *
56 * 0x2200_0000 CONFIG_SYS_FLASH_BASE
57 * FREE 256kB
58 * 0x2204_0000 CONFIG_ENV_ADDR
59 * ENV_AREA 128kB
60 * 0x2206_0000
61 * FREE
62 * 0x2280_0000 CONFIG_SYS_FLASH_BASE + CONFIG_SYS_FLASH_SIZE
63 *
64 */
65
Michal Simek952d5142007-03-11 13:42:58 +010066#ifdef FLASH
Michal Simek04c379f2010-08-02 14:20:28 +020067# define CONFIG_SYS_FLASH_BASE XILINX_FLASH_START
68# define CONFIG_SYS_FLASH_SIZE XILINX_FLASH_SIZE
Michal Simek04c379f2010-08-02 14:20:28 +020069/* ?empty sector */
70# define CONFIG_SYS_FLASH_EMPTY_INFO 1
71/* max number of memory banks */
72# define CONFIG_SYS_MAX_FLASH_BANKS 1
73/* max number of sectors on one chip */
74# define CONFIG_SYS_MAX_FLASH_SECT 512
Michal Simek952d5142007-03-11 13:42:58 +010075#endif /* !FLASH */
76
Michal Simek025e8cf2020-11-04 15:58:04 +010077#define CONFIG_ICACHE
78#define CONFIG_DCACHE
Michal Simekf95f6dc2009-01-05 13:29:32 +010079
Michal Simeke3aa3d52012-09-25 10:13:35 +020080#ifndef XILINX_DCACHE_BYTE_SIZE
81#define XILINX_DCACHE_BYTE_SIZE 32768
82#endif
83
Jon Loeliger316d2342007-07-04 22:33:01 -050084/*
Jon Loeliger5c4ddae2007-07-10 10:12:10 -050085 * BOOTP options
86 */
87#define CONFIG_BOOTP_BOOTFILESIZE
Michal Simek952d5142007-03-11 13:42:58 +010088
Michal Simek04c379f2010-08-02 14:20:28 +020089/* size of console buffer */
90#define CONFIG_SYS_CBSIZE 512
Michal Simek04c379f2010-08-02 14:20:28 +020091/* max number of command args */
92#define CONFIG_SYS_MAXARGS 15
Michal Simek04c379f2010-08-02 14:20:28 +020093/* default load address */
Michal Simek6a41aad2015-12-11 14:45:29 +010094#define CONFIG_SYS_LOAD_ADDR 0
Michal Simek952d5142007-03-11 13:42:58 +010095
Mario Six790d8442018-03-28 14:38:20 +020096#define CONFIG_HOSTNAME "microblaze-generic"
Michal Simek952d5142007-03-11 13:42:58 +010097
98/* architecture dependent code */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020099#define CONFIG_SYS_USR_EXCEP /* user exception */
Michal Simek952d5142007-03-11 13:42:58 +0100100
T Karthik Reddye539c262020-09-22 05:18:55 -0600101#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
102#define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
103#else
104#define BOOT_TARGET_DEVICES_PXE(func)
105#endif
106
107#if defined(CONFIG_CMD_DHCP)
108#define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
109#else
110#define BOOT_TARGET_DEVICES_DHCP(func)
111#endif
112
113#if defined(CONFIG_SPI_FLASH)
114# define BOOT_TARGET_DEVICES_QSPI(func) func(QSPI, qspi, na)
115#else
116# define BOOT_TARGET_DEVICES_QSPI(func)
117#endif
118
119#define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \
120 "bootcmd_qspi=sf probe 0 0 0 && " \
121 "sf read ${scriptaddr} ${script_offset_f} ${script_size_f} && " \
122 "echo QSPI: Trying to boot script at ${scriptaddr} && " \
123 "source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;\0"
124
125#define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \
126 "qspi "
127
128#define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
129
130#define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
131 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
132 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
133
134#define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
135 "jtag "
136
137#define BOOT_TARGET_DEVICES(func) \
138 BOOT_TARGET_DEVICES_JTAG(func) \
139 BOOT_TARGET_DEVICES_QSPI(func) \
140 BOOT_TARGET_DEVICES_DHCP(func) \
141 BOOT_TARGET_DEVICES_PXE(func)
142
143#include <config_distro_bootcmd.h>
144
Michal Simek31caa372016-05-10 13:11:19 +0200145#ifndef CONFIG_EXTRA_ENV_SETTINGS
T Karthik Reddya3627ee2020-09-22 05:18:52 -0600146#define CONFIG_EXTRA_ENV_SETTINGS \
147 "unlock=yes\0"\
148 "nor0=flash-0\0"\
149 "mtdparts=mtdparts=flash-0:"\
150 "256k(u-boot),256k(env),3m(kernel),"\
151 "1m(romfs),1m(cramfs),-(jffs2)\0"\
152 "nc=setenv stdout nc;"\
153 "setenv stdin nc\0" \
154 "serial=setenv stdout serial;"\
T Karthik Reddye539c262020-09-22 05:18:55 -0600155 "setenv stdin serial\0"\
156 "script_size_f=0x40000\0"\
157 BOOTENV
Michal Simek31caa372016-05-10 13:11:19 +0200158#endif
Michal Simekab340232007-04-24 23:01:02 +0200159
Michal Simek31627322015-12-02 17:22:07 +0100160#if defined(CONFIG_XILINX_AXIEMAC)
Stephan Linzbe0ea372012-02-24 18:33:41 +0100161# define CONFIG_SYS_FAULT_ECHO_LINK_DOWN 1
Stephan Linzbe0ea372012-02-24 18:33:41 +0100162#endif
163
Michal Simek26acb3e2014-01-21 07:30:37 +0100164/* SPL part */
Michal Simek26acb3e2014-01-21 07:30:37 +0100165
Michal Simek97c32202015-01-27 14:25:38 +0100166#ifdef CONFIG_SYS_FLASH_BASE
Michal Simek97c32202015-01-27 14:25:38 +0100167# define CONFIG_SYS_UBOOT_BASE CONFIG_SYS_FLASH_BASE
168#endif
Michal Simek26acb3e2014-01-21 07:30:37 +0100169
170/* for booting directly linux */
Michal Simek26acb3e2014-01-21 07:30:37 +0100171
Michal Simek26acb3e2014-01-21 07:30:37 +0100172#define CONFIG_SYS_FDT_BASE (CONFIG_SYS_FLASH_BASE + \
173 0x40000)
Shreenidhi Shediffced402018-07-15 02:34:35 +0530174#define CONFIG_SYS_FDT_SIZE (16 << 10)
Michal Simek26acb3e2014-01-21 07:30:37 +0100175#define CONFIG_SYS_SPL_ARGS_ADDR (CONFIG_SYS_TEXT_BASE + \
176 0x1000000)
177
178/* SP location before relocation, must use scratch RAM */
179/* BRAM start */
180#define CONFIG_SYS_INIT_RAM_ADDR 0x0
181/* BRAM size - will be generated */
Michal Simekfb8e3842015-02-03 16:24:48 +0100182#define CONFIG_SYS_INIT_RAM_SIZE 0x100000
Michal Simek26acb3e2014-01-21 07:30:37 +0100183
Michal Simekfb8e3842015-02-03 16:24:48 +0100184# define CONFIG_SPL_STACK_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
Ovidiu Panaite6dbb8b2020-09-24 11:54:37 +0300185 CONFIG_SYS_INIT_RAM_SIZE)
Michal Simek26acb3e2014-01-21 07:30:37 +0100186
187/* Just for sure that there is a space for stack */
188#define CONFIG_SPL_STACK_SIZE 0x100
189
Michal Simek26acb3e2014-01-21 07:30:37 +0100190#define CONFIG_SPL_MAX_FOOTPRINT (CONFIG_SYS_INIT_RAM_SIZE - \
191 CONFIG_SYS_INIT_RAM_ADDR - \
Michal Simekfb8e3842015-02-03 16:24:48 +0100192 CONFIG_SYS_MALLOC_F_LEN - \
Michal Simek26acb3e2014-01-21 07:30:37 +0100193 CONFIG_SPL_STACK_SIZE)
194
Michal Simek952d5142007-03-11 13:42:58 +0100195#endif /* __CONFIG_H */