1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * (C) Copyright 2008-2011
4 * Heiko Schocher, DENX Software Engineering, hs@denx.de.
7 #ifndef __CONFIG_KEYMILE_H
8 #define __CONFIG_KEYMILE_H
10 #include <linux/stringify.h>
13 * Miscellaneous configurable options
15 #if defined(CONFIG_CMD_KGDB)
16 #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
18 #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
20 #define CONFIG_SYS_MAXARGS 32 /* max number of command args */
21 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
23 #define CONFIG_HUSH_INIT_VAR
25 #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
27 #define CONFIG_LOADS_ECHO
28 #define CONFIG_SYS_LOADS_BAUD_CHANGE
33 #define CONFIG_BOOTP_BOOTFILESIZE
35 /* UBI Support for all Keymile boards */
36 #define CONFIG_MTD_CONCAT
38 #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
39 #define CONFIG_KM_DEF_ENV_BOOTPARAMS \
43 #ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
44 #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
45 #endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
47 #ifndef CONFIG_KM_UBI_PART_BOOT_OPTS
48 #define CONFIG_KM_UBI_PART_BOOT_OPTS ""
49 #endif /* CONFIG_KM_UBI_PART_BOOT_OPTS */
51 #ifndef CONFIG_KM_UBI_PARTITION_NAME_APP
52 /* one flash chip only called boot */
53 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
54 # define CONFIG_KM_UBI_LINUX_MTD \
55 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
56 CONFIG_KM_UBI_PART_BOOT_OPTS
57 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
58 "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0"
59 #else /* CONFIG_KM_UBI_PARTITION_NAME_APP */
60 /* two flash chips called boot and app */
61 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
62 /* app: CONFIG_KM_UBI_PARTITION_NAME_APP */
63 # define CONFIG_KM_UBI_LINUX_MTD \
64 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
65 CONFIG_KM_UBI_PART_BOOT_OPTS " " \
66 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP
67 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
68 "ubiattach=if test ${boot_bank} -eq 0; then; " \
69 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \
70 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
71 #endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
73 #ifdef CONFIG_NAND_ECC_BCH
74 #define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
75 #define CONFIG_KM_ECC_MODE " eccmode=bch"
77 #define CONFIG_KM_UIMAGE_NAME "uImage\0"
78 #define CONFIG_KM_ECC_MODE
84 * - set 'bootcmd' and 'altbootcmd'
86 * - 'release': for a standalone system kernel/rootfs from flash
88 #define CONFIG_KM_DEF_ENV_BOOTTARGETS \
89 "subbootcmds=ubiattach ubicopy checkfdt cramfsloadfdt " \
90 "set_fdthigh cramfsloadkernel flashargs add_default " \
93 "tftp ${load_addr_r} scripts/develop-${arch}.txt && " \
94 "env import -t ${load_addr_r} ${filesize} && " \
95 "run setup_debug_env\0" \
97 "tftp ${load_addr_r} scripts/ramfs-${arch}.txt && " \
98 "env import -t ${load_addr_r} ${filesize} && " \
99 "run setup_debug_env\0" \
104 * - modify 'bootargs'
106 * - 'add_default': default bootargs common for all arm/ppc boards
107 * - 'addpanic': add kernel panic options
108 * - 'flashargs': defaults arguments for flash base boot
111 #define CONFIG_KM_DEF_ENV_BOOTARGS \
113 "setenv bootargs ${bootargs} " \
114 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
115 ":${hostname}:${netdev}:off:" \
116 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
117 " mem=${kernelmem} init=${init}" \
119 " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
120 " " CONFIG_KM_UBI_LINUX_MTD " " \
121 CONFIG_KM_DEF_BOOT_ARGS_CPU \
124 "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
127 "root=mtdblock:rootfs${boot_bank} " \
128 "rootfstype=squashfs ro\0" \
133 * - commands for booting from flash
135 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
136 * - 'ubiattach': attach ubi partition
137 * - 'ubicopy': copy ubi volume to ram
138 * - volume names: bootfs0, bootfs1, bootfs2, ...
140 * processor specific settings
141 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
143 #define CONFIG_KM_DEF_ENV_FLASH_BOOT \
144 "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
145 "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
146 "ubicopy=ubi read ${cramfsaddr} bootfs${boot_bank}\0" \
147 "uimage=" CONFIG_KM_UIMAGE_NAME \
148 CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
152 * - KM specific constants and commands
154 * - 'default': setup default environment
156 #define CONFIG_KM_DEF_ENV_CONSTANTS \
158 "release=run newenv; reset\0" \
159 "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
160 "testbootcmd=setenv boot_bank ${test_bank}; " \
161 "run ${subbootcmds}; reset\0" \
165 #ifndef CONFIG_KM_DEF_ENV
166 #define CONFIG_KM_DEF_ENV \
167 CONFIG_KM_DEF_ENV_BOOTPARAMS \
168 "netdev=" __stringify(CONFIG_KM_DEF_NETDEV) "\0" \
169 CONFIG_KM_DEF_ENV_CPU \
170 CONFIG_KM_DEF_ENV_BOOTTARGETS \
171 CONFIG_KM_DEF_ENV_BOOTARGS \
172 CONFIG_KM_DEF_ENV_FLASH_BOOT \
173 CONFIG_KM_DEF_ENV_CONSTANTS \
174 "altbootcmd=run bootcmd\0" \
175 "boot=bootm ${load_addr_r} - ${fdt_addr_r}\0" \
176 "bootcmd=km_checkbidhwk && " \
177 "setenv bootcmd \'if km_checktestboot; then; " \
178 "setenv boot_bank ${test_bank}; else; " \
179 "setenv boot_bank ${actual_bank}; fi;" \
180 "run ${subbootcmds}; reset\' && " \
181 "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
182 "run ${subbootcmds}; reset\' && " \
183 "saveenv && saveenv && boot\0" \
185 "cramfsload ${fdt_addr_r} " \
186 "fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0" \
187 "fdt_addr_r="__stringify(CONFIG_KM_FDT_ADDR) "\0" \
188 "init=/sbin/init-overlay.sh\0" \
189 "load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
190 "load=tftpboot ${load_addr_r} ${u-boot}\0" \
191 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
192 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
194 #endif /* CONFIG_KM_DEF_ENV */
196 #endif /* __CONFIG_KEYMILE_H */