blob: 663837f33dc4fb58eeb11e8f3cb3fe00227cda2f [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 Simeka5910512019-09-25 11:12:40 +020014#define CONFIG_SYS_BOOTM_LEN (64 * 1024 * 1024)
15
Michal Simek952d5142007-03-11 13:42:58 +010016/* uart */
Michal Simekc7ff40a2015-12-09 12:42:16 +010017/* 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
Michal Simek65e915c2014-05-08 16:08:44 +020021/* Stack location before relocation */
Michal Simek7cb7ae72015-12-08 14:34:13 +010022#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_TEXT_BASE - \
23 CONFIG_SYS_MALLOC_F_LEN)
Michal Simek952d5142007-03-11 13:42:58 +010024
Michal Simekf3e2c9d2020-11-04 16:14:06 +010025#ifdef CONFIG_CFI_FLASH
Michal Simek04c379f2010-08-02 14:20:28 +020026/* ?empty sector */
27# define CONFIG_SYS_FLASH_EMPTY_INFO 1
28/* max number of memory banks */
Michal Simek04c379f2010-08-02 14:20:28 +020029/* max number of sectors on one chip */
Michal Simekf3e2c9d2020-11-04 16:14:06 +010030# define CONFIG_SYS_MAX_FLASH_SECT 2048
31#endif
Michal Simek952d5142007-03-11 13:42:58 +010032
Michal Simeke3aa3d52012-09-25 10:13:35 +020033#ifndef XILINX_DCACHE_BYTE_SIZE
34#define XILINX_DCACHE_BYTE_SIZE 32768
35#endif
36
Michal Simek04c379f2010-08-02 14:20:28 +020037/* size of console buffer */
38#define CONFIG_SYS_CBSIZE 512
Michal Simek04c379f2010-08-02 14:20:28 +020039/* max number of command args */
40#define CONFIG_SYS_MAXARGS 15
Michal Simek952d5142007-03-11 13:42:58 +010041
Mario Six790d8442018-03-28 14:38:20 +020042#define CONFIG_HOSTNAME "microblaze-generic"
Michal Simek952d5142007-03-11 13:42:58 +010043
44/* architecture dependent code */
T Karthik Reddye539c262020-09-22 05:18:55 -060045#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
46#define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
47#else
48#define BOOT_TARGET_DEVICES_PXE(func)
49#endif
50
51#if defined(CONFIG_CMD_DHCP)
52#define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
53#else
54#define BOOT_TARGET_DEVICES_DHCP(func)
55#endif
56
57#if defined(CONFIG_SPI_FLASH)
58# define BOOT_TARGET_DEVICES_QSPI(func) func(QSPI, qspi, na)
59#else
60# define BOOT_TARGET_DEVICES_QSPI(func)
61#endif
62
T Karthik Reddy885f2312020-12-17 03:15:56 -070063#if defined(CONFIG_MTD_NOR_FLASH)
64# define BOOT_TARGET_DEVICES_NOR(func) func(NOR, nor, na)
65#else
66# define BOOT_TARGET_DEVICES_NOR(func)
67#endif
68
69#define BOOTENV_DEV_NOR(devtypeu, devtypel, instance) \
70 "bootcmd_nor=cp.b ${script_offset_nor} ${scriptaddr} ${script_size_f} && " \
71 "echo NOR: Trying to boot script at ${scriptaddr} && " \
72 "source ${scriptaddr}; echo NOR: SCRIPT FAILED: continuing...;\0"
73
74#define BOOTENV_DEV_NAME_NOR(devtypeu, devtypel, instance) \
75 "nor "
76
T Karthik Reddye539c262020-09-22 05:18:55 -060077#define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \
78 "bootcmd_qspi=sf probe 0 0 0 && " \
79 "sf read ${scriptaddr} ${script_offset_f} ${script_size_f} && " \
80 "echo QSPI: Trying to boot script at ${scriptaddr} && " \
81 "source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;\0"
82
83#define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \
84 "qspi "
85
86#define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
87
88#define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
89 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
90 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
91
92#define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
93 "jtag "
94
95#define BOOT_TARGET_DEVICES(func) \
96 BOOT_TARGET_DEVICES_JTAG(func) \
T Karthik Reddy885f2312020-12-17 03:15:56 -070097 BOOT_TARGET_DEVICES_QSPI(func) \
98 BOOT_TARGET_DEVICES_NOR(func) \
T Karthik Reddye539c262020-09-22 05:18:55 -060099 BOOT_TARGET_DEVICES_DHCP(func) \
100 BOOT_TARGET_DEVICES_PXE(func)
101
102#include <config_distro_bootcmd.h>
103
Michal Simek31caa372016-05-10 13:11:19 +0200104#ifndef CONFIG_EXTRA_ENV_SETTINGS
T Karthik Reddya3627ee2020-09-22 05:18:52 -0600105#define CONFIG_EXTRA_ENV_SETTINGS \
106 "unlock=yes\0"\
107 "nor0=flash-0\0"\
108 "mtdparts=mtdparts=flash-0:"\
109 "256k(u-boot),256k(env),3m(kernel),"\
110 "1m(romfs),1m(cramfs),-(jffs2)\0"\
111 "nc=setenv stdout nc;"\
112 "setenv stdin nc\0" \
113 "serial=setenv stdout serial;"\
T Karthik Reddye539c262020-09-22 05:18:55 -0600114 "setenv stdin serial\0"\
115 "script_size_f=0x40000\0"\
116 BOOTENV
Michal Simek31caa372016-05-10 13:11:19 +0200117#endif
Michal Simekab340232007-04-24 23:01:02 +0200118
Michal Simek26acb3e2014-01-21 07:30:37 +0100119/* SPL part */
Michal Simek26acb3e2014-01-21 07:30:37 +0100120
Michal Simek736c1e642020-11-04 16:12:20 +0100121#define CONFIG_SYS_UBOOT_BASE CONFIG_SYS_TEXT_BASE
Michal Simek26acb3e2014-01-21 07:30:37 +0100122
123/* for booting directly linux */
Michal Simek736c1e642020-11-04 16:12:20 +0100124#define CONFIG_SYS_FDT_BASE (CONFIG_SYS_TEXT_BASE + \
125 0x40000)
Michal Simek26acb3e2014-01-21 07:30:37 +0100126
Michal Simek26acb3e2014-01-21 07:30:37 +0100127#define CONFIG_SYS_SPL_ARGS_ADDR (CONFIG_SYS_TEXT_BASE + \
128 0x1000000)
129
130/* SP location before relocation, must use scratch RAM */
131/* BRAM start */
132#define CONFIG_SYS_INIT_RAM_ADDR 0x0
133/* BRAM size - will be generated */
Michal Simekfb8e3842015-02-03 16:24:48 +0100134#define CONFIG_SYS_INIT_RAM_SIZE 0x100000
Michal Simek26acb3e2014-01-21 07:30:37 +0100135
Michal Simekfb8e3842015-02-03 16:24:48 +0100136# define CONFIG_SPL_STACK_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
Ovidiu Panaite6dbb8b2020-09-24 11:54:37 +0300137 CONFIG_SYS_INIT_RAM_SIZE)
Michal Simek26acb3e2014-01-21 07:30:37 +0100138
139/* Just for sure that there is a space for stack */
140#define CONFIG_SPL_STACK_SIZE 0x100
141
Michal Simek26acb3e2014-01-21 07:30:37 +0100142#define CONFIG_SPL_MAX_FOOTPRINT (CONFIG_SYS_INIT_RAM_SIZE - \
143 CONFIG_SYS_INIT_RAM_ADDR - \
Michal Simekfb8e3842015-02-03 16:24:48 +0100144 CONFIG_SYS_MALLOC_F_LEN - \
Michal Simek26acb3e2014-01-21 07:30:37 +0100145 CONFIG_SPL_STACK_SIZE)
146
Michal Simek952d5142007-03-11 13:42:58 +0100147#endif /* __CONFIG_H */