blob: 91b29b35baeb1abdd0c9695f872e09b61d238a8c [file] [log] [blame]
Heiko Schocher1e8f4e72008-11-20 09:59:09 +01001/*
Heiko Schocherb11f53f2011-03-15 16:52:29 +01002 * (C) Copyright 2008-2011
Heiko Schocher1e8f4e72008-11-20 09:59:09 +01003 * Heiko Schocher, DENX Software Engineering, hs@denx.de.
4 *
Wolfgang Denk3765b3e2013-10-07 13:07:26 +02005 * SPDX-License-Identifier: GPL-2.0+
Heiko Schocher1e8f4e72008-11-20 09:59:09 +01006 */
7
8#ifndef __CONFIG_KEYMILE_H
9#define __CONFIG_KEYMILE_H
10
Heiko Schocherf1fef1d2010-04-26 13:07:28 +020011#define CONFIG_BOOTCOUNT_LIMIT
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010012
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010013/*
14 * Command line configuration.
15 */
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010016#define CONFIG_CMD_ASKENV
17#define CONFIG_CMD_DHCP
Gerlando Falautob0e55d52011-09-22 05:06:12 +000018#define CONFIG_CMD_DEFAULTENV_VARS
Holger Brunck7d772032013-07-04 15:37:32 +020019#define CONFIG_CMD_GREPENV
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010020#define CONFIG_CMD_IMMAP
21#define CONFIG_CMD_MII
22#define CONFIG_CMD_PING
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010023#define CONFIG_CMD_EEPROM
24#define CONFIG_CMD_I2C
Heiko Schocher364123d2009-03-12 07:37:18 +010025#define CONFIG_CMD_JFFS2
Heiko Schocherdc71b242009-07-09 12:04:18 +020026#define CONFIG_CMD_MTDPARTS
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010027
Heiko Schocherb11f53f2011-03-15 16:52:29 +010028#undef CONFIG_WATCHDOG /* disable platform specific watchdog */
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010029
Holger Brunckf41ee962011-03-14 15:49:05 +010030#define CONFIG_BOOTDELAY 2 /* autoboot after 2 seconds */
Heiko Schocherb11f53f2011-03-15 16:52:29 +010031#undef CONFIG_BOOTARGS /* the boot command will set bootargs */
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010032
33/*
34 * Miscellaneous configurable options
35 */
36#define CONFIG_SYS_HUSH_PARSER
Heiko Schocherb11f53f2011-03-15 16:52:29 +010037#define CONFIG_SYS_LONGHELP /* undef to save memory */
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010038#if defined(CONFIG_CMD_KGDB)
Heiko Schocherb11f53f2011-03-15 16:52:29 +010039#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010040#else
Holger Brunckf41ee962011-03-14 15:49:05 +010041#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010042#endif
Heiko Schocherb11f53f2011-03-15 16:52:29 +010043#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
Holger Brunckf41ee962011-03-14 15:49:05 +010044#define CONFIG_SYS_MAXARGS 32 /* max number of command args */
Heiko Schocherb11f53f2011-03-15 16:52:29 +010045#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
46#define CONFIG_CMDLINE_EDITING
47#define CONFIG_AUTO_COMPLETE
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010048
Heiko Schocherb11f53f2011-03-15 16:52:29 +010049#define CONFIG_HUSH_INIT_VAR
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010050
51#define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010052
Heiko Schocherb11f53f2011-03-15 16:52:29 +010053#define CONFIG_BAUDRATE 115200
Holger Brunck499b1a42011-04-08 02:47:46 +000054#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010055
Heiko Schocherb11f53f2011-03-15 16:52:29 +010056#define CONFIG_LOADS_ECHO
57#define CONFIG_SYS_LOADS_BAUD_CHANGE
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010058
Holger Brunck7f704602015-11-13 16:15:19 +010059#define CONFIG_AUTOBOOT_KEYED
60#define CONFIG_AUTOBOOT_PROMPT "Hit <SPACE> key to stop autoboot in %2ds\n"
61#define CONFIG_AUTOBOOT_STOP_STR " "
62
Heiko Schocher364123d2009-03-12 07:37:18 +010063/* Support the IVM EEprom */
64#define CONFIG_SYS_IVM_EEPROM_ADR 0x50
65#define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400
66#define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100
67
Heiko Schocherb11f53f2011-03-15 16:52:29 +010068#define CONFIG_SYS_FLASH_PROTECTION
Heiko Schocher364123d2009-03-12 07:37:18 +010069
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010070/*
71 * BOOTP options
72 */
73#define CONFIG_BOOTP_BOOTFILESIZE
74#define CONFIG_BOOTP_BOOTPATH
75#define CONFIG_BOOTP_GATEWAY
76#define CONFIG_BOOTP_HOSTNAME
77
Heiko Schocherdc71b242009-07-09 12:04:18 +020078/* UBI Support for all Keymile boards */
79#define CONFIG_CMD_UBI
80#define CONFIG_RBTREE
81#define CONFIG_MTD_PARTITIONS
Heiko Schocherdc71b242009-07-09 12:04:18 +020082#define CONFIG_MTD_DEVICE
83#define CONFIG_MTD_CONCAT
84
Holger Brunckf7fb46a2011-06-05 22:22:21 +000085#define CONFIG_CMD_CRAMFS
86#define CONFIG_CRAMFS_CMDLINE
87
Holger Bruncka21b5d42011-03-04 14:56:27 +010088#ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
89#define CONFIG_KM_DEF_ENV_BOOTPARAMS \
Holger Brunckdb0bb572011-07-04 21:27:16 +000090 "actual_bank=0\0"
Heiko Schocher364123d2009-03-12 07:37:18 +010091#endif
92
Holger Brunckde3ad132011-03-14 16:01:04 +010093#ifndef CONFIG_KM_DEF_NETDEV
94#define CONFIG_KM_DEF_NETDEV \
95 "netdev=eth0\0"
96#endif
97
Andreas Hubercf736392012-05-04 10:30:16 +020098#ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
99#define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
100#endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
101
Valentin Longchampcf7707a2014-01-27 11:49:10 +0100102#ifndef CONFIG_KM_UBI_PART_BOOT_OPTS
103#define CONFIG_KM_UBI_PART_BOOT_OPTS ""
104#endif /* CONFIG_KM_UBI_PART_BOOT_OPTS */
105
Andreas Hubercf736392012-05-04 10:30:16 +0200106#ifndef CONFIG_KM_UBI_PARTITION_NAME_APP
107/* one flash chip only called boot */
108/* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
109# define CONFIG_KM_UBI_LINUX_MTD \
Valentin Longchampcf7707a2014-01-27 11:49:10 +0100110 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
111 CONFIG_KM_UBI_PART_BOOT_OPTS
Andreas Hubercf736392012-05-04 10:30:16 +0200112# define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
113 "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0"
114#else /* CONFIG_KM_UBI_PARTITION_NAME_APP */
115/* two flash chips called boot and app */
116/* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
117/* app: CONFIG_KM_UBI_PARTITION_NAME_APP */
118# define CONFIG_KM_UBI_LINUX_MTD \
Valentin Longchampcf7707a2014-01-27 11:49:10 +0100119 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
120 CONFIG_KM_UBI_PART_BOOT_OPTS " " \
Andreas Hubercf736392012-05-04 10:30:16 +0200121 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP
122# define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
123 "ubiattach=if test ${boot_bank} -eq 0; then; " \
124 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \
125 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
126#endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
Holger Brunckde3ad132011-03-14 16:01:04 +0100127
Andreas Huberdacc1092013-01-21 03:55:20 +0000128#ifdef CONFIG_NAND_ECC_BCH
129#define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
Holger Bruncka7bc9142013-01-21 03:55:24 +0000130#define CONFIG_KM_ECC_MODE " eccmode=bch"
Andreas Huberdacc1092013-01-21 03:55:20 +0000131#else
132#define CONFIG_KM_UIMAGE_NAME "uImage\0"
Holger Bruncka7bc9142013-01-21 03:55:24 +0000133#define CONFIG_KM_ECC_MODE
Andreas Huberdacc1092013-01-21 03:55:20 +0000134#endif
135
Holger Brunckde3ad132011-03-14 16:01:04 +0100136/*
Holger Bruncka21b5d42011-03-04 14:56:27 +0100137 * boottargets
Holger Brunckdb0bb572011-07-04 21:27:16 +0000138 * - set 'subbootcmds'
Holger Bruncka21b5d42011-03-04 14:56:27 +0100139 * - set 'bootcmd' and 'altbootcmd'
140 * available targets:
141 * - 'release': for a standalone system kernel/rootfs from flash
Holger Bruncka21b5d42011-03-04 14:56:27 +0100142 */
143#define CONFIG_KM_DEF_ENV_BOOTTARGETS \
Valentin Longchampc6d32df2015-11-13 16:15:20 +0100144 "subbootcmds=ubiattach ubicopy checkfdt cramfsloadfdt " \
145 "set_fdthigh cramfsloadkernel flashargs add_default " \
146 "addpanic boot\0" \
Holger Brunckb648bfc2011-07-04 21:52:52 +0000147 "develop=" \
148 "tftp 200000 scripts/develop-${arch}.txt && " \
Holger Brunck2d9528e2011-05-04 01:47:34 +0000149 "env import -t 200000 ${filesize} && " \
Holger Brunckb648bfc2011-07-04 21:52:52 +0000150 "run setup_debug_env\0" \
151 "ramfs=" \
152 "tftp 200000 scripts/ramfs-${arch}.txt && " \
153 "env import -t 200000 ${filesize} && " \
154 "run setup_debug_env\0" \
Holger Bruncka21b5d42011-03-04 14:56:27 +0100155 ""
156
157/*
Holger Brunckde3ad132011-03-14 16:01:04 +0100158 * bootargs
159 * - modify 'bootargs'
160 *
Holger Brunckdb0bb572011-07-04 21:27:16 +0000161 * - 'add_default': default bootargs common for all arm/ppc boards
Holger Brunckde3ad132011-03-14 16:01:04 +0100162 * - 'addpanic': add kernel panic options
Holger Brunckde3ad132011-03-14 16:01:04 +0100163 * - 'flashargs': defaults arguments for flash base boot
164 *
Holger Brunckde3ad132011-03-14 16:01:04 +0100165 */
166#define CONFIG_KM_DEF_ENV_BOOTARGS \
Holger Brunckdb0bb572011-07-04 21:27:16 +0000167 "add_default=" \
Holger Brunckde3ad132011-03-14 16:01:04 +0100168 "setenv bootargs ${bootargs} " \
169 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
Valentin Longchamp7c3d6a22013-10-18 11:47:16 +0200170 ":${hostname}:${netdev}:off:" \
Holger Brunckdb0bb572011-07-04 21:27:16 +0000171 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
Andreas Huber2a7714c2011-09-13 23:06:11 +0000172 " mem=${kernelmem} init=${init}" \
Holger Bruncka7bc9142013-01-21 03:55:24 +0000173 CONFIG_KM_ECC_MODE \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200174 " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
Andreas Hubercf736392012-05-04 10:30:16 +0200175 " " CONFIG_KM_UBI_LINUX_MTD " " \
Holger Brunckdb0bb572011-07-04 21:27:16 +0000176 CONFIG_KM_DEF_BOOT_ARGS_CPU \
177 "\0" \
Holger Brunckde3ad132011-03-14 16:01:04 +0100178 "addpanic=" \
Holger Brunck2d9528e2011-05-04 01:47:34 +0000179 "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
Holger Brunckde3ad132011-03-14 16:01:04 +0100180 "flashargs=" \
181 "setenv bootargs " \
Thomas Herzmanne80ab3e2011-04-08 02:47:41 +0000182 "root=mtdblock:rootfs${boot_bank} " \
Holger Brunckde3ad132011-03-14 16:01:04 +0100183 "rootfstype=squashfs ro\0" \
184 ""
185
Holger Bruncka21b5d42011-03-04 14:56:27 +0100186/*
Holger Brunckde3ad132011-03-14 16:01:04 +0100187 * flash_boot
188 * - commands for booting from flash
189 *
Holger Brunckde3ad132011-03-14 16:01:04 +0100190 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
191 * - 'ubiattach': attach ubi partition
192 * - 'ubicopy': copy ubi volume to ram
193 * - volume names: bootfs0, bootfs1, bootfs2, ...
Holger Brunckde3ad132011-03-14 16:01:04 +0100194 *
195 * processor specific settings
196 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
197 */
198#define CONFIG_KM_DEF_ENV_FLASH_BOOT \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200199 "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
Andreas Huberdacc1092013-01-21 03:55:20 +0000200 "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200201 "ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \
Holger Brunck2d9528e2011-05-04 01:47:34 +0000202 " bootfs${boot_bank}\0" \
Andreas Huberdacc1092013-01-21 03:55:20 +0000203 "uimage=" CONFIG_KM_UIMAGE_NAME \
Andreas Hubercf736392012-05-04 10:30:16 +0200204 CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
Holger Brunckde3ad132011-03-14 16:01:04 +0100205
206/*
207 * constants
208 * - KM specific constants and commands
209 *
210 * - 'default': setup default environment
211 */
212#define CONFIG_KM_DEF_ENV_CONSTANTS \
Thomas Herzmanne80ab3e2011-04-08 02:47:41 +0000213 "backup_bank=0\0" \
Holger Brunckdb0bb572011-07-04 21:27:16 +0000214 "release=run newenv; reset\0" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200215 "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
Thomas Herzmann0333cfe2011-06-05 22:22:13 +0000216 "testbootcmd=setenv boot_bank ${test_bank}; " \
217 "run ${subbootcmds}; reset\0" \
Holger Brunckde3ad132011-03-14 16:01:04 +0100218 ""
219
Heiko Schocher364123d2009-03-12 07:37:18 +0100220#ifndef CONFIG_KM_DEF_ENV
221#define CONFIG_KM_DEF_ENV \
Holger Bruncka21b5d42011-03-04 14:56:27 +0100222 CONFIG_KM_DEF_ENV_BOOTPARAMS \
Holger Brunckde3ad132011-03-14 16:01:04 +0100223 CONFIG_KM_DEF_NETDEV \
224 CONFIG_KM_DEF_ENV_CPU \
Holger Bruncka21b5d42011-03-04 14:56:27 +0100225 CONFIG_KM_DEF_ENV_BOOTTARGETS \
Holger Brunckde3ad132011-03-14 16:01:04 +0100226 CONFIG_KM_DEF_ENV_BOOTARGS \
Holger Brunckde3ad132011-03-14 16:01:04 +0100227 CONFIG_KM_DEF_ENV_FLASH_BOOT \
Holger Bruncka21b5d42011-03-04 14:56:27 +0100228 CONFIG_KM_DEF_ENV_CONSTANTS \
Holger Brunckde3ad132011-03-14 16:01:04 +0100229 "altbootcmd=run bootcmd\0" \
Gerlando Falauto7b2268b2014-01-27 16:58:27 +0100230 "boot=bootm ${load_addr_r} - ${fdt_addr_r}\0" \
Holger Brunckdb0bb572011-07-04 21:27:16 +0000231 "bootcmd=km_checkbidhwk && " \
Thomas Herzmannc1b3d842012-05-04 10:55:58 +0200232 "setenv bootcmd \'if km_checktestboot; then; " \
233 "setenv boot_bank ${test_bank}; else; " \
234 "setenv boot_bank ${actual_bank}; fi;" \
Holger Brunckdb0bb572011-07-04 21:27:16 +0000235 "run ${subbootcmds}; reset\' && " \
236 "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
237 "run ${subbootcmds}; reset\' && " \
238 "saveenv && saveenv && boot\0" \
Holger Brunck31dd8982012-05-04 10:55:54 +0200239 "bootlimit=3\0" \
Gerlando Falauto7b2268b2014-01-27 16:58:27 +0100240 "cramfsloadfdt=" \
241 "cramfsload ${fdt_addr_r} " \
242 "fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0" \
243 "fdt_addr_r="__stringify(CONFIG_KM_FDT_ADDR) "\0" \
Holger Brunckde3ad132011-03-14 16:01:04 +0100244 "init=/sbin/init-overlay.sh\0" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200245 "load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
Holger Brunckdb0bb572011-07-04 21:27:16 +0000246 "load=tftpboot ${load_addr_r} ${u-boot}\0" \
Holger Brunckde3ad132011-03-14 16:01:04 +0100247 "mtdids=" MTDIDS_DEFAULT "\0" \
248 "mtdparts=" MTDPARTS_DEFAULT "\0" \
Heiko Schocher364123d2009-03-12 07:37:18 +0100249 ""
250#endif /* CONFIG_KM_DEF_ENV */
251
Holger Brunck499b1a42011-04-08 02:47:46 +0000252#define CONFIG_VERSION_VARIABLE /* include version env variable */
Heiko Schocher364123d2009-03-12 07:37:18 +0100253
Heiko Schocher1e8f4e72008-11-20 09:59:09 +0100254#endif /* __CONFIG_KEYMILE_H */