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