blob: 28f67e30d5d236906131bdf7e225478e6bbc0a7d [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Michal Simek76316a32007-03-11 13:42:58 +01002/*
Michal Simek4aecfb12010-08-02 14:20:28 +02003 * (C) Copyright 2007-2010 Michal Simek
Michal Simek76316a32007-03-11 13:42:58 +01004 *
Michal Simekcb1bc632007-09-24 00:30:42 +02005 * Michal SIMEK <monstr@monstr.eu>
Michal Simek76316a32007-03-11 13:42:58 +01006 */
7
8#ifndef __CONFIG_H
9#define __CONFIG_H
10
Michal Simek6c5828d2020-11-04 16:00:38 +010011/* Microblaze is microblaze_0 */
12#define XILINX_FSL_NUMBER 3
13
Michal Simek4aecfb12010-08-02 14:20:28 +020014/* MicroBlaze CPU */
Michal Simek1a50f1642007-05-08 14:52:52 +020015#define MICROBLAZE_V5 1
Michal Simek76316a32007-03-11 13:42:58 +010016
Michal Simek8272f312019-09-25 11:12:40 +020017#define CONFIG_SYS_BOOTM_LEN (64 * 1024 * 1024)
18
Michal Simek76316a32007-03-11 13:42:58 +010019/* uart */
Michal Simek67659e22015-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 Simeke945f6d2014-05-08 16:08:44 +020024/* Stack location before relocation */
Michal Simek4fcd0b332015-12-08 14:34:13 +010025#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_TEXT_BASE - \
26 CONFIG_SYS_MALLOC_F_LEN)
Michal Simek76316a32007-03-11 13:42:58 +010027
Michal Simek631a2412020-11-04 16:14:06 +010028#ifdef CONFIG_CFI_FLASH
Michal Simek4aecfb12010-08-02 14:20:28 +020029/* ?empty sector */
30# define CONFIG_SYS_FLASH_EMPTY_INFO 1
31/* max number of memory banks */
32# define CONFIG_SYS_MAX_FLASH_BANKS 1
33/* max number of sectors on one chip */
Michal Simek631a2412020-11-04 16:14:06 +010034# define CONFIG_SYS_MAX_FLASH_SECT 2048
35#endif
Michal Simek76316a32007-03-11 13:42:58 +010036
Michal Simek7556fa02020-11-04 15:58:04 +010037#define CONFIG_ICACHE
38#define CONFIG_DCACHE
Michal Simeke9b737d2009-01-05 13:29:32 +010039
Michal Simek58118302012-09-25 10:13:35 +020040#ifndef XILINX_DCACHE_BYTE_SIZE
41#define XILINX_DCACHE_BYTE_SIZE 32768
42#endif
43
Jon Loeliger5dc11a52007-07-04 22:33:01 -050044/*
Jon Loeliger079a1362007-07-10 10:12:10 -050045 * BOOTP options
46 */
47#define CONFIG_BOOTP_BOOTFILESIZE
Michal Simek76316a32007-03-11 13:42:58 +010048
Michal Simek4aecfb12010-08-02 14:20:28 +020049/* size of console buffer */
50#define CONFIG_SYS_CBSIZE 512
Michal Simek4aecfb12010-08-02 14:20:28 +020051/* max number of command args */
52#define CONFIG_SYS_MAXARGS 15
Michal Simek76316a32007-03-11 13:42:58 +010053
Mario Six5bc05432018-03-28 14:38:20 +020054#define CONFIG_HOSTNAME "microblaze-generic"
Michal Simek76316a32007-03-11 13:42:58 +010055
56/* architecture dependent code */
T Karthik Reddy44d2be82020-09-22 05:18:55 -060057#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
58#define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
59#else
60#define BOOT_TARGET_DEVICES_PXE(func)
61#endif
62
63#if defined(CONFIG_CMD_DHCP)
64#define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
65#else
66#define BOOT_TARGET_DEVICES_DHCP(func)
67#endif
68
69#if defined(CONFIG_SPI_FLASH)
70# define BOOT_TARGET_DEVICES_QSPI(func) func(QSPI, qspi, na)
71#else
72# define BOOT_TARGET_DEVICES_QSPI(func)
73#endif
74
T Karthik Reddy6b80de72020-12-17 03:15:56 -070075#if defined(CONFIG_MTD_NOR_FLASH)
76# define BOOT_TARGET_DEVICES_NOR(func) func(NOR, nor, na)
77#else
78# define BOOT_TARGET_DEVICES_NOR(func)
79#endif
80
81#define BOOTENV_DEV_NOR(devtypeu, devtypel, instance) \
82 "bootcmd_nor=cp.b ${script_offset_nor} ${scriptaddr} ${script_size_f} && " \
83 "echo NOR: Trying to boot script at ${scriptaddr} && " \
84 "source ${scriptaddr}; echo NOR: SCRIPT FAILED: continuing...;\0"
85
86#define BOOTENV_DEV_NAME_NOR(devtypeu, devtypel, instance) \
87 "nor "
88
T Karthik Reddy44d2be82020-09-22 05:18:55 -060089#define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \
90 "bootcmd_qspi=sf probe 0 0 0 && " \
91 "sf read ${scriptaddr} ${script_offset_f} ${script_size_f} && " \
92 "echo QSPI: Trying to boot script at ${scriptaddr} && " \
93 "source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;\0"
94
95#define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \
96 "qspi "
97
98#define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
99
100#define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
101 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
102 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
103
104#define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
105 "jtag "
106
107#define BOOT_TARGET_DEVICES(func) \
108 BOOT_TARGET_DEVICES_JTAG(func) \
T Karthik Reddy6b80de72020-12-17 03:15:56 -0700109 BOOT_TARGET_DEVICES_QSPI(func) \
110 BOOT_TARGET_DEVICES_NOR(func) \
T Karthik Reddy44d2be82020-09-22 05:18:55 -0600111 BOOT_TARGET_DEVICES_DHCP(func) \
112 BOOT_TARGET_DEVICES_PXE(func)
113
114#include <config_distro_bootcmd.h>
115
Michal Simek2902a9b2016-05-10 13:11:19 +0200116#ifndef CONFIG_EXTRA_ENV_SETTINGS
T Karthik Reddy581d6a62020-09-22 05:18:52 -0600117#define CONFIG_EXTRA_ENV_SETTINGS \
118 "unlock=yes\0"\
119 "nor0=flash-0\0"\
120 "mtdparts=mtdparts=flash-0:"\
121 "256k(u-boot),256k(env),3m(kernel),"\
122 "1m(romfs),1m(cramfs),-(jffs2)\0"\
123 "nc=setenv stdout nc;"\
124 "setenv stdin nc\0" \
125 "serial=setenv stdout serial;"\
T Karthik Reddy44d2be82020-09-22 05:18:55 -0600126 "setenv stdin serial\0"\
127 "script_size_f=0x40000\0"\
128 BOOTENV
Michal Simek2902a9b2016-05-10 13:11:19 +0200129#endif
Michal Simek144876a2007-04-24 23:01:02 +0200130
Michal Simek4632b1e2015-12-02 17:22:07 +0100131#if defined(CONFIG_XILINX_AXIEMAC)
Stephan Linzf5e5e1f2012-02-24 18:33:41 +0100132# define CONFIG_SYS_FAULT_ECHO_LINK_DOWN 1
Stephan Linzf5e5e1f2012-02-24 18:33:41 +0100133#endif
134
Michal Simek9d242742014-01-21 07:30:37 +0100135/* SPL part */
Michal Simek9d242742014-01-21 07:30:37 +0100136
Michal Simek09996b42020-11-04 16:12:20 +0100137#define CONFIG_SYS_UBOOT_BASE CONFIG_SYS_TEXT_BASE
Michal Simek9d242742014-01-21 07:30:37 +0100138
139/* for booting directly linux */
Michal Simek09996b42020-11-04 16:12:20 +0100140#define CONFIG_SYS_FDT_BASE (CONFIG_SYS_TEXT_BASE + \
141 0x40000)
Michal Simek9d242742014-01-21 07:30:37 +0100142
Michal Simek9d242742014-01-21 07:30:37 +0100143#define CONFIG_SYS_SPL_ARGS_ADDR (CONFIG_SYS_TEXT_BASE + \
144 0x1000000)
145
146/* SP location before relocation, must use scratch RAM */
147/* BRAM start */
148#define CONFIG_SYS_INIT_RAM_ADDR 0x0
149/* BRAM size - will be generated */
Michal Simekca7d2262015-02-03 16:24:48 +0100150#define CONFIG_SYS_INIT_RAM_SIZE 0x100000
151
152# define CONFIG_SPL_STACK_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
Ovidiu Panaitf5d8b1a2020-09-24 11:54:37 +0300153 CONFIG_SYS_INIT_RAM_SIZE)
Michal Simek9d242742014-01-21 07:30:37 +0100154
155/* Just for sure that there is a space for stack */
156#define CONFIG_SPL_STACK_SIZE 0x100
157
Michal Simek9d242742014-01-21 07:30:37 +0100158#define CONFIG_SPL_MAX_FOOTPRINT (CONFIG_SYS_INIT_RAM_SIZE - \
159 CONFIG_SYS_INIT_RAM_ADDR - \
Michal Simekca7d2262015-02-03 16:24:48 +0100160 CONFIG_SYS_MALLOC_F_LEN - \
Michal Simek9d242742014-01-21 07:30:37 +0100161 CONFIG_SPL_STACK_SIZE)
162
Michal Simek76316a32007-03-11 13:42:58 +0100163#endif /* __CONFIG_H */