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
16 #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
18 #define CONFIG_LOADS_ECHO
19 #define CONFIG_SYS_LOADS_BAUD_CHANGE
21 #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
22 #define CONFIG_KM_DEF_ENV_BOOTPARAMS \
26 #ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
27 #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
28 #endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
30 #ifndef CONFIG_KM_UBI_PART_BOOT_OPTS
31 #define CONFIG_KM_UBI_PART_BOOT_OPTS ""
32 #endif /* CONFIG_KM_UBI_PART_BOOT_OPTS */
34 #ifndef CONFIG_KM_UBI_PARTITION_NAME_APP
35 /* one flash chip only called boot */
36 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
37 # define CONFIG_KM_UBI_LINUX_MTD \
38 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
39 CONFIG_KM_UBI_PART_BOOT_OPTS
40 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
41 "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0"
42 #else /* CONFIG_KM_UBI_PARTITION_NAME_APP */
43 /* two flash chips called boot and app */
44 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
45 /* app: CONFIG_KM_UBI_PARTITION_NAME_APP */
46 # define CONFIG_KM_UBI_LINUX_MTD \
47 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
48 CONFIG_KM_UBI_PART_BOOT_OPTS " " \
49 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP
50 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
51 "ubiattach=if test ${boot_bank} -eq 0; then; " \
52 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \
53 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
54 #endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
56 #ifdef CONFIG_NAND_ECC_BCH
57 #define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
58 #define CONFIG_KM_ECC_MODE " eccmode=bch"
60 #define CONFIG_KM_UIMAGE_NAME "uImage\0"
61 #define CONFIG_KM_ECC_MODE
67 * - set 'bootcmd' and 'altbootcmd'
69 * - 'release': for a standalone system kernel/rootfs from flash
71 #define CONFIG_KM_DEF_ENV_BOOTTARGETS \
72 "subbootcmds=ubiattach ubicopy checkfdt cramfsloadfdt " \
73 "set_fdthigh cramfsloadkernel flashargs add_default " \
76 "tftp ${load_addr_r} scripts/develop-${arch}.txt && " \
77 "env import -t ${load_addr_r} ${filesize} && " \
78 "run setup_debug_env\0" \
80 "tftp ${load_addr_r} scripts/ramfs-${arch}.txt && " \
81 "env import -t ${load_addr_r} ${filesize} && " \
82 "run setup_debug_env\0" \
89 * - 'add_default': default bootargs common for all arm/ppc boards
90 * - 'addpanic': add kernel panic options
91 * - 'flashargs': defaults arguments for flash base boot
94 #define CONFIG_KM_DEF_ENV_BOOTARGS \
96 "setenv bootargs ${bootargs} " \
97 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
98 ":${hostname}:${netdev}:off:" \
99 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
100 " mem=${kernelmem} init=${init}" \
102 " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
103 " " CONFIG_KM_UBI_LINUX_MTD " " \
104 CONFIG_KM_DEF_BOOT_ARGS_CPU \
107 "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
110 "root=mtdblock:rootfs${boot_bank} " \
111 "rootfstype=squashfs ro\0" \
116 * - commands for booting from flash
118 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
119 * - 'ubiattach': attach ubi partition
120 * - 'ubicopy': copy ubi volume to ram
121 * - volume names: bootfs0, bootfs1, bootfs2, ...
123 * processor specific settings
124 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
126 #define CONFIG_KM_DEF_ENV_FLASH_BOOT \
127 "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
128 "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
129 "ubicopy=ubi read ${cramfsaddr} bootfs${boot_bank}\0" \
130 "uimage=" CONFIG_KM_UIMAGE_NAME \
131 CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
135 * - KM specific constants and commands
137 * - 'default': setup default environment
139 #define CONFIG_KM_DEF_ENV_CONSTANTS \
141 "release=run newenv; reset\0" \
142 "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
143 "testbootcmd=setenv boot_bank ${test_bank}; " \
144 "run ${subbootcmds}; reset\0" \
148 #ifndef CONFIG_KM_DEF_ENV
149 #define CONFIG_KM_DEF_ENV \
150 CONFIG_KM_DEF_ENV_BOOTPARAMS \
151 "netdev=" __stringify(CONFIG_KM_DEF_NETDEV) "\0" \
152 CONFIG_KM_DEF_ENV_CPU \
153 CONFIG_KM_DEF_ENV_BOOTTARGETS \
154 CONFIG_KM_DEF_ENV_BOOTARGS \
155 CONFIG_KM_DEF_ENV_FLASH_BOOT \
156 CONFIG_KM_DEF_ENV_CONSTANTS \
157 "altbootcmd=run bootcmd\0" \
158 "boot=bootm ${load_addr_r} - ${fdt_addr_r}\0" \
159 "bootcmd=km_checkbidhwk && " \
160 "setenv bootcmd \'if km_checktestboot; then; " \
161 "setenv boot_bank ${test_bank}; else; " \
162 "setenv boot_bank ${actual_bank}; fi;" \
163 "run ${subbootcmds}; reset\' && " \
164 "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
165 "run ${subbootcmds}; reset\' && " \
166 "saveenv && saveenv && boot\0" \
168 "cramfsload ${fdt_addr_r} " \
169 "fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0" \
170 "fdt_addr_r=" __stringify(CONFIG_KM_FDT_ADDR) "\0" \
171 "init=/sbin/init-overlay.sh\0" \
172 "load_addr_r=" __stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
173 "load=tftpboot ${load_addr_r} ${u-boot}\0" \
175 #endif /* CONFIG_KM_DEF_ENV */
177 #endif /* __CONFIG_KEYMILE_H */