Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 2 | /* |
Michal Simek | 04c379f | 2010-08-02 14:20:28 +0200 | [diff] [blame] | 3 | * (C) Copyright 2007-2010 Michal Simek |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 4 | * |
Michal Simek | d83d07e | 2007-09-24 00:30:42 +0200 | [diff] [blame] | 5 | * Michal SIMEK <monstr@monstr.eu> |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef __CONFIG_H |
| 9 | #define __CONFIG_H |
| 10 | |
Michal Simek | b139503 | 2020-11-04 16:00:38 +0100 | [diff] [blame] | 11 | /* Microblaze is microblaze_0 */ |
| 12 | #define XILINX_FSL_NUMBER 3 |
| 13 | |
Michal Simek | 04c379f | 2010-08-02 14:20:28 +0200 | [diff] [blame] | 14 | /* MicroBlaze CPU */ |
Michal Simek | 3af398e | 2007-05-08 14:52:52 +0200 | [diff] [blame] | 15 | #define MICROBLAZE_V5 1 |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 16 | |
Michal Simek | a591051 | 2019-09-25 11:12:40 +0200 | [diff] [blame] | 17 | #define CONFIG_SYS_BOOTM_LEN (64 * 1024 * 1024) |
| 18 | |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 19 | /* uart */ |
Michal Simek | c7ff40a | 2015-12-09 12:42:16 +0100 | [diff] [blame] | 20 | /* 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 Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 24 | /* setting reset address */ |
Wolfgang Denk | 0708bc6 | 2010-10-07 21:51:12 +0200 | [diff] [blame] | 25 | /*#define CONFIG_SYS_RESET_ADDRESS CONFIG_SYS_TEXT_BASE*/ |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 26 | |
Michal Simek | 65e915c | 2014-05-08 16:08:44 +0200 | [diff] [blame] | 27 | #define CONFIG_SYS_MALLOC_LEN 0xC0000 |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 28 | |
Michal Simek | 65e915c | 2014-05-08 16:08:44 +0200 | [diff] [blame] | 29 | /* Stack location before relocation */ |
Michal Simek | 7cb7ae7 | 2015-12-08 14:34:13 +0100 | [diff] [blame] | 30 | #define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_TEXT_BASE - \ |
| 31 | CONFIG_SYS_MALLOC_F_LEN) |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 32 | |
Michal Simek | f3e2c9d | 2020-11-04 16:14:06 +0100 | [diff] [blame] | 33 | #ifdef CONFIG_CFI_FLASH |
Michal Simek | 04c379f | 2010-08-02 14:20:28 +0200 | [diff] [blame] | 34 | /* ?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 Simek | f3e2c9d | 2020-11-04 16:14:06 +0100 | [diff] [blame] | 39 | # define CONFIG_SYS_MAX_FLASH_SECT 2048 |
| 40 | #endif |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 41 | |
Michal Simek | 025e8cf | 2020-11-04 15:58:04 +0100 | [diff] [blame] | 42 | #define CONFIG_ICACHE |
| 43 | #define CONFIG_DCACHE |
Michal Simek | f95f6dc | 2009-01-05 13:29:32 +0100 | [diff] [blame] | 44 | |
Michal Simek | e3aa3d5 | 2012-09-25 10:13:35 +0200 | [diff] [blame] | 45 | #ifndef XILINX_DCACHE_BYTE_SIZE |
| 46 | #define XILINX_DCACHE_BYTE_SIZE 32768 |
| 47 | #endif |
| 48 | |
Jon Loeliger | 316d234 | 2007-07-04 22:33:01 -0500 | [diff] [blame] | 49 | /* |
Jon Loeliger | 5c4ddae | 2007-07-10 10:12:10 -0500 | [diff] [blame] | 50 | * BOOTP options |
| 51 | */ |
| 52 | #define CONFIG_BOOTP_BOOTFILESIZE |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 53 | |
Michal Simek | 04c379f | 2010-08-02 14:20:28 +0200 | [diff] [blame] | 54 | /* size of console buffer */ |
| 55 | #define CONFIG_SYS_CBSIZE 512 |
Michal Simek | 04c379f | 2010-08-02 14:20:28 +0200 | [diff] [blame] | 56 | /* max number of command args */ |
| 57 | #define CONFIG_SYS_MAXARGS 15 |
Michal Simek | 04c379f | 2010-08-02 14:20:28 +0200 | [diff] [blame] | 58 | /* default load address */ |
Michal Simek | 6a41aad | 2015-12-11 14:45:29 +0100 | [diff] [blame] | 59 | #define CONFIG_SYS_LOAD_ADDR 0 |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 60 | |
Mario Six | 790d844 | 2018-03-28 14:38:20 +0200 | [diff] [blame] | 61 | #define CONFIG_HOSTNAME "microblaze-generic" |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 62 | |
| 63 | /* architecture dependent code */ |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 64 | #define CONFIG_SYS_USR_EXCEP /* user exception */ |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 65 | |
T Karthik Reddy | e539c26 | 2020-09-22 05:18:55 -0600 | [diff] [blame] | 66 | #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 | |
| 84 | #define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \ |
| 85 | "bootcmd_qspi=sf probe 0 0 0 && " \ |
| 86 | "sf read ${scriptaddr} ${script_offset_f} ${script_size_f} && " \ |
| 87 | "echo QSPI: Trying to boot script at ${scriptaddr} && " \ |
| 88 | "source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;\0" |
| 89 | |
| 90 | #define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \ |
| 91 | "qspi " |
| 92 | |
| 93 | #define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na) |
| 94 | |
| 95 | #define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \ |
| 96 | "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \ |
| 97 | "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0" |
| 98 | |
| 99 | #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \ |
| 100 | "jtag " |
| 101 | |
| 102 | #define BOOT_TARGET_DEVICES(func) \ |
| 103 | BOOT_TARGET_DEVICES_JTAG(func) \ |
| 104 | BOOT_TARGET_DEVICES_QSPI(func) \ |
| 105 | BOOT_TARGET_DEVICES_DHCP(func) \ |
| 106 | BOOT_TARGET_DEVICES_PXE(func) |
| 107 | |
| 108 | #include <config_distro_bootcmd.h> |
| 109 | |
Michal Simek | 31caa37 | 2016-05-10 13:11:19 +0200 | [diff] [blame] | 110 | #ifndef CONFIG_EXTRA_ENV_SETTINGS |
T Karthik Reddy | a3627ee | 2020-09-22 05:18:52 -0600 | [diff] [blame] | 111 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 112 | "unlock=yes\0"\ |
| 113 | "nor0=flash-0\0"\ |
| 114 | "mtdparts=mtdparts=flash-0:"\ |
| 115 | "256k(u-boot),256k(env),3m(kernel),"\ |
| 116 | "1m(romfs),1m(cramfs),-(jffs2)\0"\ |
| 117 | "nc=setenv stdout nc;"\ |
| 118 | "setenv stdin nc\0" \ |
| 119 | "serial=setenv stdout serial;"\ |
T Karthik Reddy | e539c26 | 2020-09-22 05:18:55 -0600 | [diff] [blame] | 120 | "setenv stdin serial\0"\ |
| 121 | "script_size_f=0x40000\0"\ |
| 122 | BOOTENV |
Michal Simek | 31caa37 | 2016-05-10 13:11:19 +0200 | [diff] [blame] | 123 | #endif |
Michal Simek | ab34023 | 2007-04-24 23:01:02 +0200 | [diff] [blame] | 124 | |
Michal Simek | 3162732 | 2015-12-02 17:22:07 +0100 | [diff] [blame] | 125 | #if defined(CONFIG_XILINX_AXIEMAC) |
Stephan Linz | be0ea37 | 2012-02-24 18:33:41 +0100 | [diff] [blame] | 126 | # define CONFIG_SYS_FAULT_ECHO_LINK_DOWN 1 |
Stephan Linz | be0ea37 | 2012-02-24 18:33:41 +0100 | [diff] [blame] | 127 | #endif |
| 128 | |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 129 | /* SPL part */ |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 130 | |
Michal Simek | 736c1e64 | 2020-11-04 16:12:20 +0100 | [diff] [blame] | 131 | #define CONFIG_SYS_UBOOT_BASE CONFIG_SYS_TEXT_BASE |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 132 | |
| 133 | /* for booting directly linux */ |
Michal Simek | 736c1e64 | 2020-11-04 16:12:20 +0100 | [diff] [blame] | 134 | #define CONFIG_SYS_FDT_BASE (CONFIG_SYS_TEXT_BASE + \ |
| 135 | 0x40000) |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 136 | |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 137 | #define CONFIG_SYS_SPL_ARGS_ADDR (CONFIG_SYS_TEXT_BASE + \ |
| 138 | 0x1000000) |
| 139 | |
| 140 | /* SP location before relocation, must use scratch RAM */ |
| 141 | /* BRAM start */ |
| 142 | #define CONFIG_SYS_INIT_RAM_ADDR 0x0 |
| 143 | /* BRAM size - will be generated */ |
Michal Simek | fb8e384 | 2015-02-03 16:24:48 +0100 | [diff] [blame] | 144 | #define CONFIG_SYS_INIT_RAM_SIZE 0x100000 |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 145 | |
Michal Simek | fb8e384 | 2015-02-03 16:24:48 +0100 | [diff] [blame] | 146 | # define CONFIG_SPL_STACK_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \ |
Ovidiu Panait | e6dbb8b | 2020-09-24 11:54:37 +0300 | [diff] [blame] | 147 | CONFIG_SYS_INIT_RAM_SIZE) |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 148 | |
| 149 | /* Just for sure that there is a space for stack */ |
| 150 | #define CONFIG_SPL_STACK_SIZE 0x100 |
| 151 | |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 152 | #define CONFIG_SPL_MAX_FOOTPRINT (CONFIG_SYS_INIT_RAM_SIZE - \ |
| 153 | CONFIG_SYS_INIT_RAM_ADDR - \ |
Michal Simek | fb8e384 | 2015-02-03 16:24:48 +0100 | [diff] [blame] | 154 | CONFIG_SYS_MALLOC_F_LEN - \ |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 155 | CONFIG_SPL_STACK_SIZE) |
| 156 | |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 157 | #endif /* __CONFIG_H */ |