Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Heiko Schocher | 7937e4f | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 2 | /* |
Heiko Schocher | 8ce3dd5 | 2011-03-15 16:52:29 +0100 | [diff] [blame] | 3 | * (C) Copyright 2008-2011 |
Heiko Schocher | 7937e4f | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 4 | * Heiko Schocher, DENX Software Engineering, hs@denx.de. |
Heiko Schocher | 7937e4f | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef __CONFIG_KEYMILE_H |
| 8 | #define __CONFIG_KEYMILE_H |
| 9 | |
Heiko Schocher | 8ce3dd5 | 2011-03-15 16:52:29 +0100 | [diff] [blame] | 10 | #undef CONFIG_WATCHDOG /* disable platform specific watchdog */ |
Heiko Schocher | 7937e4f | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 11 | |
Heiko Schocher | 7937e4f | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 12 | /* |
| 13 | * Miscellaneous configurable options |
| 14 | */ |
Heiko Schocher | 7937e4f | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 15 | #if defined(CONFIG_CMD_KGDB) |
Heiko Schocher | 8ce3dd5 | 2011-03-15 16:52:29 +0100 | [diff] [blame] | 16 | #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ |
Heiko Schocher | 7937e4f | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 17 | #else |
Holger Brunck | 0bd8202 | 2011-03-14 15:49:05 +0100 | [diff] [blame] | 18 | #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */ |
Heiko Schocher | 7937e4f | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 19 | #endif |
Holger Brunck | 0bd8202 | 2011-03-14 15:49:05 +0100 | [diff] [blame] | 20 | #define CONFIG_SYS_MAXARGS 32 /* max number of command args */ |
Heiko Schocher | 8ce3dd5 | 2011-03-15 16:52:29 +0100 | [diff] [blame] | 21 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE |
Heiko Schocher | 7937e4f | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 22 | |
Heiko Schocher | 8ce3dd5 | 2011-03-15 16:52:29 +0100 | [diff] [blame] | 23 | #define CONFIG_HUSH_INIT_VAR |
Heiko Schocher | 7937e4f | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 24 | |
Holger Brunck | 4559d1f | 2011-04-08 02:47:46 +0000 | [diff] [blame] | 25 | #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 } |
Heiko Schocher | 7937e4f | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 26 | |
Heiko Schocher | 8ce3dd5 | 2011-03-15 16:52:29 +0100 | [diff] [blame] | 27 | #define CONFIG_LOADS_ECHO |
| 28 | #define CONFIG_SYS_LOADS_BAUD_CHANGE |
Heiko Schocher | 7937e4f | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 29 | |
Holger Brunck | 6c3dd06 | 2015-11-13 16:15:19 +0100 | [diff] [blame] | 30 | |
Heiko Schocher | a8d5189 | 2009-03-12 07:37:18 +0100 | [diff] [blame] | 31 | /* Support the IVM EEprom */ |
| 32 | #define CONFIG_SYS_IVM_EEPROM_ADR 0x50 |
| 33 | #define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400 |
| 34 | #define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100 |
| 35 | |
Heiko Schocher | 8ce3dd5 | 2011-03-15 16:52:29 +0100 | [diff] [blame] | 36 | #define CONFIG_SYS_FLASH_PROTECTION |
Heiko Schocher | a8d5189 | 2009-03-12 07:37:18 +0100 | [diff] [blame] | 37 | |
Heiko Schocher | 7937e4f | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 38 | /* |
| 39 | * BOOTP options |
| 40 | */ |
| 41 | #define CONFIG_BOOTP_BOOTFILESIZE |
Heiko Schocher | 7937e4f | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 42 | |
Heiko Schocher | 875f4728 | 2009-07-09 12:04:18 +0200 | [diff] [blame] | 43 | /* UBI Support for all Keymile boards */ |
Heiko Schocher | 875f4728 | 2009-07-09 12:04:18 +0200 | [diff] [blame] | 44 | #define CONFIG_MTD_CONCAT |
| 45 | |
Holger Brunck | e7c1fdc | 2011-03-04 14:56:27 +0100 | [diff] [blame] | 46 | #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS |
| 47 | #define CONFIG_KM_DEF_ENV_BOOTPARAMS \ |
Holger Brunck | 2ff59ee | 2011-07-04 21:27:16 +0000 | [diff] [blame] | 48 | "actual_bank=0\0" |
Heiko Schocher | a8d5189 | 2009-03-12 07:37:18 +0100 | [diff] [blame] | 49 | #endif |
| 50 | |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 51 | #ifndef CONFIG_KM_DEF_NETDEV |
| 52 | #define CONFIG_KM_DEF_NETDEV \ |
| 53 | "netdev=eth0\0" |
| 54 | #endif |
| 55 | |
Andreas Huber | a81548a | 2012-05-04 10:30:16 +0200 | [diff] [blame] | 56 | #ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT |
| 57 | #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0" |
| 58 | #endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */ |
| 59 | |
Valentin Longchamp | e6d848f | 2014-01-27 11:49:10 +0100 | [diff] [blame] | 60 | #ifndef CONFIG_KM_UBI_PART_BOOT_OPTS |
| 61 | #define CONFIG_KM_UBI_PART_BOOT_OPTS "" |
| 62 | #endif /* CONFIG_KM_UBI_PART_BOOT_OPTS */ |
| 63 | |
Andreas Huber | a81548a | 2012-05-04 10:30:16 +0200 | [diff] [blame] | 64 | #ifndef CONFIG_KM_UBI_PARTITION_NAME_APP |
| 65 | /* one flash chip only called boot */ |
| 66 | /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */ |
| 67 | # define CONFIG_KM_UBI_LINUX_MTD \ |
Valentin Longchamp | e6d848f | 2014-01-27 11:49:10 +0100 | [diff] [blame] | 68 | "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \ |
| 69 | CONFIG_KM_UBI_PART_BOOT_OPTS |
Andreas Huber | a81548a | 2012-05-04 10:30:16 +0200 | [diff] [blame] | 70 | # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \ |
| 71 | "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0" |
| 72 | #else /* CONFIG_KM_UBI_PARTITION_NAME_APP */ |
| 73 | /* two flash chips called boot and app */ |
| 74 | /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */ |
| 75 | /* app: CONFIG_KM_UBI_PARTITION_NAME_APP */ |
| 76 | # define CONFIG_KM_UBI_LINUX_MTD \ |
Valentin Longchamp | e6d848f | 2014-01-27 11:49:10 +0100 | [diff] [blame] | 77 | "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \ |
| 78 | CONFIG_KM_UBI_PART_BOOT_OPTS " " \ |
Andreas Huber | a81548a | 2012-05-04 10:30:16 +0200 | [diff] [blame] | 79 | "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP |
| 80 | # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \ |
| 81 | "ubiattach=if test ${boot_bank} -eq 0; then; " \ |
| 82 | "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \ |
| 83 | "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0" |
| 84 | #endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */ |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 85 | |
Andreas Huber | c31a757 | 2013-01-21 03:55:20 +0000 | [diff] [blame] | 86 | #ifdef CONFIG_NAND_ECC_BCH |
| 87 | #define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0" |
Holger Brunck | ffcbb93 | 2013-01-21 03:55:24 +0000 | [diff] [blame] | 88 | #define CONFIG_KM_ECC_MODE " eccmode=bch" |
Andreas Huber | c31a757 | 2013-01-21 03:55:20 +0000 | [diff] [blame] | 89 | #else |
| 90 | #define CONFIG_KM_UIMAGE_NAME "uImage\0" |
Holger Brunck | ffcbb93 | 2013-01-21 03:55:24 +0000 | [diff] [blame] | 91 | #define CONFIG_KM_ECC_MODE |
Andreas Huber | c31a757 | 2013-01-21 03:55:20 +0000 | [diff] [blame] | 92 | #endif |
| 93 | |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 94 | /* |
Holger Brunck | e7c1fdc | 2011-03-04 14:56:27 +0100 | [diff] [blame] | 95 | * boottargets |
Holger Brunck | 2ff59ee | 2011-07-04 21:27:16 +0000 | [diff] [blame] | 96 | * - set 'subbootcmds' |
Holger Brunck | e7c1fdc | 2011-03-04 14:56:27 +0100 | [diff] [blame] | 97 | * - set 'bootcmd' and 'altbootcmd' |
| 98 | * available targets: |
| 99 | * - 'release': for a standalone system kernel/rootfs from flash |
Holger Brunck | e7c1fdc | 2011-03-04 14:56:27 +0100 | [diff] [blame] | 100 | */ |
| 101 | #define CONFIG_KM_DEF_ENV_BOOTTARGETS \ |
Valentin Longchamp | 15e79cc | 2015-11-13 16:15:20 +0100 | [diff] [blame] | 102 | "subbootcmds=ubiattach ubicopy checkfdt cramfsloadfdt " \ |
| 103 | "set_fdthigh cramfsloadkernel flashargs add_default " \ |
| 104 | "addpanic boot\0" \ |
Holger Brunck | e7bec9b | 2011-07-04 21:52:52 +0000 | [diff] [blame] | 105 | "develop=" \ |
| 106 | "tftp 200000 scripts/develop-${arch}.txt && " \ |
| 107 | "env import -t 200000 ${filesize} && " \ |
| 108 | "run setup_debug_env\0" \ |
| 109 | "ramfs=" \ |
| 110 | "tftp 200000 scripts/ramfs-${arch}.txt && " \ |
Holger Brunck | 0b53902 | 2011-05-04 01:47:34 +0000 | [diff] [blame] | 111 | "env import -t 200000 ${filesize} && " \ |
Holger Brunck | e7bec9b | 2011-07-04 21:52:52 +0000 | [diff] [blame] | 112 | "run setup_debug_env\0" \ |
Holger Brunck | e7c1fdc | 2011-03-04 14:56:27 +0100 | [diff] [blame] | 113 | "" |
| 114 | |
| 115 | /* |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 116 | * bootargs |
| 117 | * - modify 'bootargs' |
| 118 | * |
Holger Brunck | 2ff59ee | 2011-07-04 21:27:16 +0000 | [diff] [blame] | 119 | * - 'add_default': default bootargs common for all arm/ppc boards |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 120 | * - 'addpanic': add kernel panic options |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 121 | * - 'flashargs': defaults arguments for flash base boot |
| 122 | * |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 123 | */ |
| 124 | #define CONFIG_KM_DEF_ENV_BOOTARGS \ |
Holger Brunck | 2ff59ee | 2011-07-04 21:27:16 +0000 | [diff] [blame] | 125 | "add_default=" \ |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 126 | "setenv bootargs ${bootargs} " \ |
| 127 | "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \ |
Valentin Longchamp | 1d39959 | 2013-10-18 11:47:16 +0200 | [diff] [blame] | 128 | ":${hostname}:${netdev}:off:" \ |
Holger Brunck | 2ff59ee | 2011-07-04 21:27:16 +0000 | [diff] [blame] | 129 | " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \ |
Andreas Huber | 28c63c7 | 2011-09-13 23:06:11 +0000 | [diff] [blame] | 130 | " mem=${kernelmem} init=${init}" \ |
Holger Brunck | ffcbb93 | 2013-01-21 03:55:24 +0000 | [diff] [blame] | 131 | CONFIG_KM_ECC_MODE \ |
Marek Vasut | fd5ba89 | 2012-09-23 17:41:23 +0200 | [diff] [blame] | 132 | " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\ |
Andreas Huber | a81548a | 2012-05-04 10:30:16 +0200 | [diff] [blame] | 133 | " " CONFIG_KM_UBI_LINUX_MTD " " \ |
Holger Brunck | 2ff59ee | 2011-07-04 21:27:16 +0000 | [diff] [blame] | 134 | CONFIG_KM_DEF_BOOT_ARGS_CPU \ |
| 135 | "\0" \ |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 136 | "addpanic=" \ |
Holger Brunck | 0b53902 | 2011-05-04 01:47:34 +0000 | [diff] [blame] | 137 | "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \ |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 138 | "flashargs=" \ |
| 139 | "setenv bootargs " \ |
Thomas Herzmann | 1d253c1 | 2011-04-08 02:47:41 +0000 | [diff] [blame] | 140 | "root=mtdblock:rootfs${boot_bank} " \ |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 141 | "rootfstype=squashfs ro\0" \ |
| 142 | "" |
| 143 | |
Holger Brunck | e7c1fdc | 2011-03-04 14:56:27 +0100 | [diff] [blame] | 144 | /* |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 145 | * flash_boot |
| 146 | * - commands for booting from flash |
| 147 | * |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 148 | * - 'cramfsloadkernel': copy kernel from a cramfs to ram |
| 149 | * - 'ubiattach': attach ubi partition |
| 150 | * - 'ubicopy': copy ubi volume to ram |
| 151 | * - volume names: bootfs0, bootfs1, bootfs2, ... |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 152 | * |
| 153 | * processor specific settings |
| 154 | * - 'cramfsloadfdt': copy fdt from a cramfs to ram |
| 155 | */ |
| 156 | #define CONFIG_KM_DEF_ENV_FLASH_BOOT \ |
Marek Vasut | fd5ba89 | 2012-09-23 17:41:23 +0200 | [diff] [blame] | 157 | "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \ |
Andreas Huber | c31a757 | 2013-01-21 03:55:20 +0000 | [diff] [blame] | 158 | "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \ |
Marek Vasut | fd5ba89 | 2012-09-23 17:41:23 +0200 | [diff] [blame] | 159 | "ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \ |
Holger Brunck | 0b53902 | 2011-05-04 01:47:34 +0000 | [diff] [blame] | 160 | " bootfs${boot_bank}\0" \ |
Andreas Huber | c31a757 | 2013-01-21 03:55:20 +0000 | [diff] [blame] | 161 | "uimage=" CONFIG_KM_UIMAGE_NAME \ |
Andreas Huber | a81548a | 2012-05-04 10:30:16 +0200 | [diff] [blame] | 162 | CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 163 | |
| 164 | /* |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 165 | * constants |
| 166 | * - KM specific constants and commands |
| 167 | * |
| 168 | * - 'default': setup default environment |
| 169 | */ |
| 170 | #define CONFIG_KM_DEF_ENV_CONSTANTS \ |
Thomas Herzmann | 1d253c1 | 2011-04-08 02:47:41 +0000 | [diff] [blame] | 171 | "backup_bank=0\0" \ |
Holger Brunck | 2ff59ee | 2011-07-04 21:27:16 +0000 | [diff] [blame] | 172 | "release=run newenv; reset\0" \ |
Marek Vasut | fd5ba89 | 2012-09-23 17:41:23 +0200 | [diff] [blame] | 173 | "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \ |
Thomas Herzmann | 80d5c9e | 2011-06-05 22:22:13 +0000 | [diff] [blame] | 174 | "testbootcmd=setenv boot_bank ${test_bank}; " \ |
| 175 | "run ${subbootcmds}; reset\0" \ |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 176 | "" |
| 177 | |
Heiko Schocher | a8d5189 | 2009-03-12 07:37:18 +0100 | [diff] [blame] | 178 | #ifndef CONFIG_KM_DEF_ENV |
| 179 | #define CONFIG_KM_DEF_ENV \ |
Holger Brunck | e7c1fdc | 2011-03-04 14:56:27 +0100 | [diff] [blame] | 180 | CONFIG_KM_DEF_ENV_BOOTPARAMS \ |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 181 | CONFIG_KM_DEF_NETDEV \ |
| 182 | CONFIG_KM_DEF_ENV_CPU \ |
Holger Brunck | e7c1fdc | 2011-03-04 14:56:27 +0100 | [diff] [blame] | 183 | CONFIG_KM_DEF_ENV_BOOTTARGETS \ |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 184 | CONFIG_KM_DEF_ENV_BOOTARGS \ |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 185 | CONFIG_KM_DEF_ENV_FLASH_BOOT \ |
Holger Brunck | e7c1fdc | 2011-03-04 14:56:27 +0100 | [diff] [blame] | 186 | CONFIG_KM_DEF_ENV_CONSTANTS \ |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 187 | "altbootcmd=run bootcmd\0" \ |
Gerlando Falauto | ae2adaf | 2014-01-27 16:58:27 +0100 | [diff] [blame] | 188 | "boot=bootm ${load_addr_r} - ${fdt_addr_r}\0" \ |
Holger Brunck | 2ff59ee | 2011-07-04 21:27:16 +0000 | [diff] [blame] | 189 | "bootcmd=km_checkbidhwk && " \ |
Thomas Herzmann | b2c3160 | 2012-05-04 10:55:58 +0200 | [diff] [blame] | 190 | "setenv bootcmd \'if km_checktestboot; then; " \ |
| 191 | "setenv boot_bank ${test_bank}; else; " \ |
| 192 | "setenv boot_bank ${actual_bank}; fi;" \ |
Holger Brunck | 2ff59ee | 2011-07-04 21:27:16 +0000 | [diff] [blame] | 193 | "run ${subbootcmds}; reset\' && " \ |
| 194 | "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \ |
| 195 | "run ${subbootcmds}; reset\' && " \ |
| 196 | "saveenv && saveenv && boot\0" \ |
Gerlando Falauto | ae2adaf | 2014-01-27 16:58:27 +0100 | [diff] [blame] | 197 | "cramfsloadfdt=" \ |
| 198 | "cramfsload ${fdt_addr_r} " \ |
| 199 | "fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0" \ |
| 200 | "fdt_addr_r="__stringify(CONFIG_KM_FDT_ADDR) "\0" \ |
Holger Brunck | 752ba31 | 2011-03-14 16:01:04 +0100 | [diff] [blame] | 201 | "init=/sbin/init-overlay.sh\0" \ |
Marek Vasut | fd5ba89 | 2012-09-23 17:41:23 +0200 | [diff] [blame] | 202 | "load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \ |
Holger Brunck | 2ff59ee | 2011-07-04 21:27:16 +0000 | [diff] [blame] | 203 | "load=tftpboot ${load_addr_r} ${u-boot}\0" \ |
Tom Rini | 5ad8e11 | 2017-10-22 17:55:07 -0400 | [diff] [blame] | 204 | "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \ |
| 205 | "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \ |
Heiko Schocher | a8d5189 | 2009-03-12 07:37:18 +0100 | [diff] [blame] | 206 | "" |
| 207 | #endif /* CONFIG_KM_DEF_ENV */ |
| 208 | |
Heiko Schocher | 7937e4f | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 209 | #endif /* __CONFIG_KEYMILE_H */ |