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