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 | a591051 | 2019-09-25 11:12:40 +0200 | [diff] [blame] | 14 | #define CONFIG_SYS_BOOTM_LEN (64 * 1024 * 1024) |
| 15 | |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 16 | /* uart */ |
Michal Simek | c7ff40a | 2015-12-09 12:42:16 +0100 | [diff] [blame] | 17 | /* 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 Simek | 65e915c | 2014-05-08 16:08:44 +0200 | [diff] [blame] | 21 | /* Stack location before relocation */ |
Michal Simek | 7cb7ae7 | 2015-12-08 14:34:13 +0100 | [diff] [blame] | 22 | #define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_TEXT_BASE - \ |
| 23 | CONFIG_SYS_MALLOC_F_LEN) |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 24 | |
Michal Simek | f3e2c9d | 2020-11-04 16:14:06 +0100 | [diff] [blame] | 25 | #ifdef CONFIG_CFI_FLASH |
Michal Simek | 04c379f | 2010-08-02 14:20:28 +0200 | [diff] [blame] | 26 | /* ?empty sector */ |
| 27 | # define CONFIG_SYS_FLASH_EMPTY_INFO 1 |
| 28 | /* max number of memory banks */ |
Michal Simek | 04c379f | 2010-08-02 14:20:28 +0200 | [diff] [blame] | 29 | /* max number of sectors on one chip */ |
Michal Simek | f3e2c9d | 2020-11-04 16:14:06 +0100 | [diff] [blame] | 30 | # define CONFIG_SYS_MAX_FLASH_SECT 2048 |
| 31 | #endif |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 32 | |
Michal Simek | 025e8cf | 2020-11-04 15:58:04 +0100 | [diff] [blame] | 33 | #define CONFIG_ICACHE |
| 34 | #define CONFIG_DCACHE |
Michal Simek | f95f6dc | 2009-01-05 13:29:32 +0100 | [diff] [blame] | 35 | |
Michal Simek | e3aa3d5 | 2012-09-25 10:13:35 +0200 | [diff] [blame] | 36 | #ifndef XILINX_DCACHE_BYTE_SIZE |
| 37 | #define XILINX_DCACHE_BYTE_SIZE 32768 |
| 38 | #endif |
| 39 | |
Michal Simek | 04c379f | 2010-08-02 14:20:28 +0200 | [diff] [blame] | 40 | /* size of console buffer */ |
| 41 | #define CONFIG_SYS_CBSIZE 512 |
Michal Simek | 04c379f | 2010-08-02 14:20:28 +0200 | [diff] [blame] | 42 | /* max number of command args */ |
| 43 | #define CONFIG_SYS_MAXARGS 15 |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 44 | |
Mario Six | 790d844 | 2018-03-28 14:38:20 +0200 | [diff] [blame] | 45 | #define CONFIG_HOSTNAME "microblaze-generic" |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 46 | |
| 47 | /* architecture dependent code */ |
T Karthik Reddy | e539c26 | 2020-09-22 05:18:55 -0600 | [diff] [blame] | 48 | #if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP) |
| 49 | #define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na) |
| 50 | #else |
| 51 | #define BOOT_TARGET_DEVICES_PXE(func) |
| 52 | #endif |
| 53 | |
| 54 | #if defined(CONFIG_CMD_DHCP) |
| 55 | #define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na) |
| 56 | #else |
| 57 | #define BOOT_TARGET_DEVICES_DHCP(func) |
| 58 | #endif |
| 59 | |
| 60 | #if defined(CONFIG_SPI_FLASH) |
| 61 | # define BOOT_TARGET_DEVICES_QSPI(func) func(QSPI, qspi, na) |
| 62 | #else |
| 63 | # define BOOT_TARGET_DEVICES_QSPI(func) |
| 64 | #endif |
| 65 | |
T Karthik Reddy | 885f231 | 2020-12-17 03:15:56 -0700 | [diff] [blame] | 66 | #if defined(CONFIG_MTD_NOR_FLASH) |
| 67 | # define BOOT_TARGET_DEVICES_NOR(func) func(NOR, nor, na) |
| 68 | #else |
| 69 | # define BOOT_TARGET_DEVICES_NOR(func) |
| 70 | #endif |
| 71 | |
| 72 | #define BOOTENV_DEV_NOR(devtypeu, devtypel, instance) \ |
| 73 | "bootcmd_nor=cp.b ${script_offset_nor} ${scriptaddr} ${script_size_f} && " \ |
| 74 | "echo NOR: Trying to boot script at ${scriptaddr} && " \ |
| 75 | "source ${scriptaddr}; echo NOR: SCRIPT FAILED: continuing...;\0" |
| 76 | |
| 77 | #define BOOTENV_DEV_NAME_NOR(devtypeu, devtypel, instance) \ |
| 78 | "nor " |
| 79 | |
T Karthik Reddy | e539c26 | 2020-09-22 05:18:55 -0600 | [diff] [blame] | 80 | #define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \ |
| 81 | "bootcmd_qspi=sf probe 0 0 0 && " \ |
| 82 | "sf read ${scriptaddr} ${script_offset_f} ${script_size_f} && " \ |
| 83 | "echo QSPI: Trying to boot script at ${scriptaddr} && " \ |
| 84 | "source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;\0" |
| 85 | |
| 86 | #define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \ |
| 87 | "qspi " |
| 88 | |
| 89 | #define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na) |
| 90 | |
| 91 | #define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \ |
| 92 | "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \ |
| 93 | "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0" |
| 94 | |
| 95 | #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \ |
| 96 | "jtag " |
| 97 | |
| 98 | #define BOOT_TARGET_DEVICES(func) \ |
| 99 | BOOT_TARGET_DEVICES_JTAG(func) \ |
T Karthik Reddy | 885f231 | 2020-12-17 03:15:56 -0700 | [diff] [blame] | 100 | BOOT_TARGET_DEVICES_QSPI(func) \ |
| 101 | BOOT_TARGET_DEVICES_NOR(func) \ |
T Karthik Reddy | e539c26 | 2020-09-22 05:18:55 -0600 | [diff] [blame] | 102 | BOOT_TARGET_DEVICES_DHCP(func) \ |
| 103 | BOOT_TARGET_DEVICES_PXE(func) |
| 104 | |
| 105 | #include <config_distro_bootcmd.h> |
| 106 | |
Michal Simek | 31caa37 | 2016-05-10 13:11:19 +0200 | [diff] [blame] | 107 | #ifndef CONFIG_EXTRA_ENV_SETTINGS |
T Karthik Reddy | a3627ee | 2020-09-22 05:18:52 -0600 | [diff] [blame] | 108 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 109 | "unlock=yes\0"\ |
| 110 | "nor0=flash-0\0"\ |
| 111 | "mtdparts=mtdparts=flash-0:"\ |
| 112 | "256k(u-boot),256k(env),3m(kernel),"\ |
| 113 | "1m(romfs),1m(cramfs),-(jffs2)\0"\ |
| 114 | "nc=setenv stdout nc;"\ |
| 115 | "setenv stdin nc\0" \ |
| 116 | "serial=setenv stdout serial;"\ |
T Karthik Reddy | e539c26 | 2020-09-22 05:18:55 -0600 | [diff] [blame] | 117 | "setenv stdin serial\0"\ |
| 118 | "script_size_f=0x40000\0"\ |
| 119 | BOOTENV |
Michal Simek | 31caa37 | 2016-05-10 13:11:19 +0200 | [diff] [blame] | 120 | #endif |
Michal Simek | ab34023 | 2007-04-24 23:01:02 +0200 | [diff] [blame] | 121 | |
Michal Simek | 3162732 | 2015-12-02 17:22:07 +0100 | [diff] [blame] | 122 | #if defined(CONFIG_XILINX_AXIEMAC) |
Stephan Linz | be0ea37 | 2012-02-24 18:33:41 +0100 | [diff] [blame] | 123 | # define CONFIG_SYS_FAULT_ECHO_LINK_DOWN 1 |
Stephan Linz | be0ea37 | 2012-02-24 18:33:41 +0100 | [diff] [blame] | 124 | #endif |
| 125 | |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 126 | /* SPL part */ |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 127 | |
Michal Simek | 736c1e64 | 2020-11-04 16:12:20 +0100 | [diff] [blame] | 128 | #define CONFIG_SYS_UBOOT_BASE CONFIG_SYS_TEXT_BASE |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 129 | |
| 130 | /* for booting directly linux */ |
Michal Simek | 736c1e64 | 2020-11-04 16:12:20 +0100 | [diff] [blame] | 131 | #define CONFIG_SYS_FDT_BASE (CONFIG_SYS_TEXT_BASE + \ |
| 132 | 0x40000) |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 133 | |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 134 | #define CONFIG_SYS_SPL_ARGS_ADDR (CONFIG_SYS_TEXT_BASE + \ |
| 135 | 0x1000000) |
| 136 | |
| 137 | /* SP location before relocation, must use scratch RAM */ |
| 138 | /* BRAM start */ |
| 139 | #define CONFIG_SYS_INIT_RAM_ADDR 0x0 |
| 140 | /* BRAM size - will be generated */ |
Michal Simek | fb8e384 | 2015-02-03 16:24:48 +0100 | [diff] [blame] | 141 | #define CONFIG_SYS_INIT_RAM_SIZE 0x100000 |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 142 | |
Michal Simek | fb8e384 | 2015-02-03 16:24:48 +0100 | [diff] [blame] | 143 | # define CONFIG_SPL_STACK_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \ |
Ovidiu Panait | e6dbb8b | 2020-09-24 11:54:37 +0300 | [diff] [blame] | 144 | CONFIG_SYS_INIT_RAM_SIZE) |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 145 | |
| 146 | /* Just for sure that there is a space for stack */ |
| 147 | #define CONFIG_SPL_STACK_SIZE 0x100 |
| 148 | |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 149 | #define CONFIG_SPL_MAX_FOOTPRINT (CONFIG_SYS_INIT_RAM_SIZE - \ |
| 150 | CONFIG_SYS_INIT_RAM_ADDR - \ |
Michal Simek | fb8e384 | 2015-02-03 16:24:48 +0100 | [diff] [blame] | 151 | CONFIG_SYS_MALLOC_F_LEN - \ |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 152 | CONFIG_SPL_STACK_SIZE) |
| 153 | |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 154 | #endif /* __CONFIG_H */ |