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