2 * (C) Copyright 2008-2011
5 * SPDX-License-Identifier: GPL-2.0+
8 #ifndef __CONFIG_KEYMILE_H
9 #define __CONFIG_KEYMILE_H
11 #define CONFIG_BOOTCOUNT_LIMIT
13 #undef CONFIG_WATCHDOG /* disable platform specific watchdog */
16 * Miscellaneous configurable options
18 #define CONFIG_SYS_LONGHELP /* undef to save memory */
19 #if defined(CONFIG_CMD_KGDB)
20 #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
22 #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
24 #define CONFIG_SYS_MAXARGS 32 /* max number of command args */
25 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
26 #define CONFIG_CMDLINE_EDITING
27 #define CONFIG_AUTO_COMPLETE
29 #define CONFIG_HUSH_INIT_VAR
31 #define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */
33 #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
35 #define CONFIG_LOADS_ECHO
36 #define CONFIG_SYS_LOADS_BAUD_CHANGE
39 /* Support the IVM EEprom */
40 #define CONFIG_SYS_IVM_EEPROM_ADR 0x50
41 #define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400
42 #define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100
44 #define CONFIG_SYS_FLASH_PROTECTION
49 #define CONFIG_BOOTP_BOOTFILESIZE
50 #define CONFIG_BOOTP_BOOTPATH
51 #define CONFIG_BOOTP_GATEWAY
52 #define CONFIG_BOOTP_HOSTNAME
54 /* UBI Support for all Keymile boards */
55 #define CONFIG_MTD_PARTITIONS
56 #define CONFIG_MTD_DEVICE
57 #define CONFIG_MTD_CONCAT
59 #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
60 #define CONFIG_KM_DEF_ENV_BOOTPARAMS \
64 #ifndef CONFIG_KM_DEF_NETDEV
65 #define CONFIG_KM_DEF_NETDEV \
69 #ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
70 #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
71 #endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
73 #ifndef CONFIG_KM_UBI_PART_BOOT_OPTS
74 #define CONFIG_KM_UBI_PART_BOOT_OPTS ""
75 #endif /* CONFIG_KM_UBI_PART_BOOT_OPTS */
77 #ifndef CONFIG_KM_UBI_PARTITION_NAME_APP
78 /* one flash chip only called boot */
79 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
80 # define CONFIG_KM_UBI_LINUX_MTD \
81 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
82 CONFIG_KM_UBI_PART_BOOT_OPTS
83 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
84 "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0"
85 #else /* CONFIG_KM_UBI_PARTITION_NAME_APP */
86 /* two flash chips called boot and app */
87 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
88 /* app: CONFIG_KM_UBI_PARTITION_NAME_APP */
89 # define CONFIG_KM_UBI_LINUX_MTD \
90 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
91 CONFIG_KM_UBI_PART_BOOT_OPTS " " \
92 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP
93 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
94 "ubiattach=if test ${boot_bank} -eq 0; then; " \
95 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \
96 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
97 #endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
99 #ifdef CONFIG_NAND_ECC_BCH
100 #define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
101 #define CONFIG_KM_ECC_MODE " eccmode=bch"
103 #define CONFIG_KM_UIMAGE_NAME "uImage\0"
104 #define CONFIG_KM_ECC_MODE
109 * - set 'subbootcmds'
110 * - set 'bootcmd' and 'altbootcmd'
112 * - 'release': for a standalone system kernel/rootfs from flash
114 #define CONFIG_KM_DEF_ENV_BOOTTARGETS \
115 "subbootcmds=ubiattach ubicopy checkfdt cramfsloadfdt " \
116 "set_fdthigh cramfsloadkernel flashargs add_default " \
119 "tftp 200000 scripts/develop-${arch}.txt && " \
120 "env import -t 200000 ${filesize} && " \
121 "run setup_debug_env\0" \
123 "tftp 200000 scripts/ramfs-${arch}.txt && " \
124 "env import -t 200000 ${filesize} && " \
125 "run setup_debug_env\0" \
130 * - modify 'bootargs'
132 * - 'add_default': default bootargs common for all arm/ppc boards
133 * - 'addpanic': add kernel panic options
134 * - 'flashargs': defaults arguments for flash base boot
137 #define CONFIG_KM_DEF_ENV_BOOTARGS \
139 "setenv bootargs ${bootargs} " \
140 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
141 ":${hostname}:${netdev}:off:" \
142 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
143 " mem=${kernelmem} init=${init}" \
145 " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
146 " " CONFIG_KM_UBI_LINUX_MTD " " \
147 CONFIG_KM_DEF_BOOT_ARGS_CPU \
150 "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
153 "root=mtdblock:rootfs${boot_bank} " \
154 "rootfstype=squashfs ro\0" \
159 * - commands for booting from flash
161 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
162 * - 'ubiattach': attach ubi partition
163 * - 'ubicopy': copy ubi volume to ram
164 * - volume names: bootfs0, bootfs1, bootfs2, ...
166 * processor specific settings
167 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
169 #define CONFIG_KM_DEF_ENV_FLASH_BOOT \
170 "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
171 "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
172 "ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \
173 " bootfs${boot_bank}\0" \
174 "uimage=" CONFIG_KM_UIMAGE_NAME \
175 CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
179 * - KM specific constants and commands
181 * - 'default': setup default environment
183 #define CONFIG_KM_DEF_ENV_CONSTANTS \
185 "release=run newenv; reset\0" \
186 "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
187 "testbootcmd=setenv boot_bank ${test_bank}; " \
188 "run ${subbootcmds}; reset\0" \
191 #ifndef CONFIG_KM_DEF_ENV
192 #define CONFIG_KM_DEF_ENV \
193 CONFIG_KM_DEF_ENV_BOOTPARAMS \
194 CONFIG_KM_DEF_NETDEV \
195 CONFIG_KM_DEF_ENV_CPU \
196 CONFIG_KM_DEF_ENV_BOOTTARGETS \
197 CONFIG_KM_DEF_ENV_BOOTARGS \
198 CONFIG_KM_DEF_ENV_FLASH_BOOT \
199 CONFIG_KM_DEF_ENV_CONSTANTS \
200 "altbootcmd=run bootcmd\0" \
201 "boot=bootm ${load_addr_r} - ${fdt_addr_r}\0" \
202 "bootcmd=km_checkbidhwk && " \
203 "setenv bootcmd \'if km_checktestboot; then; " \
204 "setenv boot_bank ${test_bank}; else; " \
205 "setenv boot_bank ${actual_bank}; fi;" \
206 "run ${subbootcmds}; reset\' && " \
207 "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
208 "run ${subbootcmds}; reset\' && " \
209 "saveenv && saveenv && boot\0" \
212 "cramfsload ${fdt_addr_r} " \
213 "fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0" \
214 "fdt_addr_r="__stringify(CONFIG_KM_FDT_ADDR) "\0" \
215 "init=/sbin/init-overlay.sh\0" \
216 "load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
217 "load=tftpboot ${load_addr_r} ${u-boot}\0" \
218 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
219 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
221 #endif /* CONFIG_KM_DEF_ENV */
223 #endif /* __CONFIG_KEYMILE_H */