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
30 #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
31 #define CONFIG_KM_DEF_ENV_BOOTPARAMS \
35 #ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
36 #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
37 #endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
39 #ifndef CONFIG_KM_UBI_PART_BOOT_OPTS
40 #define CONFIG_KM_UBI_PART_BOOT_OPTS ""
41 #endif /* CONFIG_KM_UBI_PART_BOOT_OPTS */
43 #ifndef CONFIG_KM_UBI_PARTITION_NAME_APP
44 /* one flash chip only called boot */
45 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
46 # define CONFIG_KM_UBI_LINUX_MTD \
47 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
48 CONFIG_KM_UBI_PART_BOOT_OPTS
49 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
50 "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0"
51 #else /* CONFIG_KM_UBI_PARTITION_NAME_APP */
52 /* two flash chips called boot and app */
53 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
54 /* app: CONFIG_KM_UBI_PARTITION_NAME_APP */
55 # define CONFIG_KM_UBI_LINUX_MTD \
56 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
57 CONFIG_KM_UBI_PART_BOOT_OPTS " " \
58 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP
59 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
60 "ubiattach=if test ${boot_bank} -eq 0; then; " \
61 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \
62 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
63 #endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
65 #ifdef CONFIG_NAND_ECC_BCH
66 #define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
67 #define CONFIG_KM_ECC_MODE " eccmode=bch"
69 #define CONFIG_KM_UIMAGE_NAME "uImage\0"
70 #define CONFIG_KM_ECC_MODE
76 * - set 'bootcmd' and 'altbootcmd'
78 * - 'release': for a standalone system kernel/rootfs from flash
80 #define CONFIG_KM_DEF_ENV_BOOTTARGETS \
81 "subbootcmds=ubiattach ubicopy checkfdt cramfsloadfdt " \
82 "set_fdthigh cramfsloadkernel flashargs add_default " \
85 "tftp ${load_addr_r} scripts/develop-${arch}.txt && " \
86 "env import -t ${load_addr_r} ${filesize} && " \
87 "run setup_debug_env\0" \
89 "tftp ${load_addr_r} scripts/ramfs-${arch}.txt && " \
90 "env import -t ${load_addr_r} ${filesize} && " \
91 "run setup_debug_env\0" \
98 * - 'add_default': default bootargs common for all arm/ppc boards
99 * - 'addpanic': add kernel panic options
100 * - 'flashargs': defaults arguments for flash base boot
103 #define CONFIG_KM_DEF_ENV_BOOTARGS \
105 "setenv bootargs ${bootargs} " \
106 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
107 ":${hostname}:${netdev}:off:" \
108 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
109 " mem=${kernelmem} init=${init}" \
111 " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
112 " " CONFIG_KM_UBI_LINUX_MTD " " \
113 CONFIG_KM_DEF_BOOT_ARGS_CPU \
116 "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
119 "root=mtdblock:rootfs${boot_bank} " \
120 "rootfstype=squashfs ro\0" \
125 * - commands for booting from flash
127 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
128 * - 'ubiattach': attach ubi partition
129 * - 'ubicopy': copy ubi volume to ram
130 * - volume names: bootfs0, bootfs1, bootfs2, ...
132 * processor specific settings
133 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
135 #define CONFIG_KM_DEF_ENV_FLASH_BOOT \
136 "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
137 "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
138 "ubicopy=ubi read ${cramfsaddr} bootfs${boot_bank}\0" \
139 "uimage=" CONFIG_KM_UIMAGE_NAME \
140 CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
144 * - KM specific constants and commands
146 * - 'default': setup default environment
148 #define CONFIG_KM_DEF_ENV_CONSTANTS \
150 "release=run newenv; reset\0" \
151 "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
152 "testbootcmd=setenv boot_bank ${test_bank}; " \
153 "run ${subbootcmds}; reset\0" \
157 #ifndef CONFIG_KM_DEF_ENV
158 #define CONFIG_KM_DEF_ENV \
159 CONFIG_KM_DEF_ENV_BOOTPARAMS \
160 "netdev=" __stringify(CONFIG_KM_DEF_NETDEV) "\0" \
161 CONFIG_KM_DEF_ENV_CPU \
162 CONFIG_KM_DEF_ENV_BOOTTARGETS \
163 CONFIG_KM_DEF_ENV_BOOTARGS \
164 CONFIG_KM_DEF_ENV_FLASH_BOOT \
165 CONFIG_KM_DEF_ENV_CONSTANTS \
166 "altbootcmd=run bootcmd\0" \
167 "boot=bootm ${load_addr_r} - ${fdt_addr_r}\0" \
168 "bootcmd=km_checkbidhwk && " \
169 "setenv bootcmd \'if km_checktestboot; then; " \
170 "setenv boot_bank ${test_bank}; else; " \
171 "setenv boot_bank ${actual_bank}; fi;" \
172 "run ${subbootcmds}; reset\' && " \
173 "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
174 "run ${subbootcmds}; reset\' && " \
175 "saveenv && saveenv && boot\0" \
177 "cramfsload ${fdt_addr_r} " \
178 "fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0" \
179 "fdt_addr_r=" __stringify(CONFIG_KM_FDT_ADDR) "\0" \
180 "init=/sbin/init-overlay.sh\0" \
181 "load_addr_r=" __stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
182 "load=tftpboot ${load_addr_r} ${u-boot}\0" \
183 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
184 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
186 #endif /* CONFIG_KM_DEF_ENV */
188 #endif /* __CONFIG_KEYMILE_H */