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
11 * Miscellaneous configurable options
13 #if defined(CONFIG_CMD_KGDB)
14 #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
16 #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
18 #define CONFIG_SYS_MAXARGS 32 /* max number of command args */
19 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
21 #define CONFIG_HUSH_INIT_VAR
23 #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
25 #define CONFIG_LOADS_ECHO
26 #define CONFIG_SYS_LOADS_BAUD_CHANGE
31 #define CONFIG_BOOTP_BOOTFILESIZE
33 /* UBI Support for all Keymile boards */
34 #define CONFIG_MTD_CONCAT
36 #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
37 #define CONFIG_KM_DEF_ENV_BOOTPARAMS \
41 #ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
42 #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
43 #endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
45 #ifndef CONFIG_KM_UBI_PART_BOOT_OPTS
46 #define CONFIG_KM_UBI_PART_BOOT_OPTS ""
47 #endif /* CONFIG_KM_UBI_PART_BOOT_OPTS */
49 #ifndef CONFIG_KM_UBI_PARTITION_NAME_APP
50 /* one flash chip only called boot */
51 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
52 # define CONFIG_KM_UBI_LINUX_MTD \
53 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
54 CONFIG_KM_UBI_PART_BOOT_OPTS
55 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
56 "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0"
57 #else /* CONFIG_KM_UBI_PARTITION_NAME_APP */
58 /* two flash chips called boot and app */
59 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
60 /* app: CONFIG_KM_UBI_PARTITION_NAME_APP */
61 # define CONFIG_KM_UBI_LINUX_MTD \
62 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
63 CONFIG_KM_UBI_PART_BOOT_OPTS " " \
64 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP
65 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
66 "ubiattach=if test ${boot_bank} -eq 0; then; " \
67 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \
68 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
69 #endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
71 #ifdef CONFIG_NAND_ECC_BCH
72 #define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
73 #define CONFIG_KM_ECC_MODE " eccmode=bch"
75 #define CONFIG_KM_UIMAGE_NAME "uImage\0"
76 #define CONFIG_KM_ECC_MODE
82 * - set 'bootcmd' and 'altbootcmd'
84 * - 'release': for a standalone system kernel/rootfs from flash
86 #define CONFIG_KM_DEF_ENV_BOOTTARGETS \
87 "subbootcmds=ubiattach ubicopy checkfdt cramfsloadfdt " \
88 "set_fdthigh cramfsloadkernel flashargs add_default " \
91 "tftp 200000 scripts/develop-${arch}.txt && " \
92 "env import -t 200000 ${filesize} && " \
93 "run setup_debug_env\0" \
95 "tftp 200000 scripts/ramfs-${arch}.txt && " \
96 "env import -t 200000 ${filesize} && " \
97 "run setup_debug_env\0" \
102 * - modify 'bootargs'
104 * - 'add_default': default bootargs common for all arm/ppc boards
105 * - 'addpanic': add kernel panic options
106 * - 'flashargs': defaults arguments for flash base boot
109 #define CONFIG_KM_DEF_ENV_BOOTARGS \
111 "setenv bootargs ${bootargs} " \
112 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
113 ":${hostname}:${netdev}:off:" \
114 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
115 " mem=${kernelmem} init=${init}" \
117 " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
118 " " CONFIG_KM_UBI_LINUX_MTD " " \
119 CONFIG_KM_DEF_BOOT_ARGS_CPU \
122 "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
125 "root=mtdblock:rootfs${boot_bank} " \
126 "rootfstype=squashfs ro\0" \
131 * - commands for booting from flash
133 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
134 * - 'ubiattach': attach ubi partition
135 * - 'ubicopy': copy ubi volume to ram
136 * - volume names: bootfs0, bootfs1, bootfs2, ...
138 * processor specific settings
139 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
141 #define CONFIG_KM_DEF_ENV_FLASH_BOOT \
142 "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
143 "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
144 "ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \
145 " bootfs${boot_bank}\0" \
146 "uimage=" CONFIG_KM_UIMAGE_NAME \
147 CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
151 * - KM specific constants and commands
153 * - 'default': setup default environment
155 #define CONFIG_KM_DEF_ENV_CONSTANTS \
157 "release=run newenv; reset\0" \
158 "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
159 "testbootcmd=setenv boot_bank ${test_bank}; " \
160 "run ${subbootcmds}; reset\0" \
163 #ifndef CONFIG_KM_DEF_ENV
164 #define CONFIG_KM_DEF_ENV \
165 CONFIG_KM_DEF_ENV_BOOTPARAMS \
166 "netdev=" __stringify(CONFIG_KM_DEF_NETDEV) "\0" \
167 CONFIG_KM_DEF_ENV_CPU \
168 CONFIG_KM_DEF_ENV_BOOTTARGETS \
169 CONFIG_KM_DEF_ENV_BOOTARGS \
170 CONFIG_KM_DEF_ENV_FLASH_BOOT \
171 CONFIG_KM_DEF_ENV_CONSTANTS \
172 "altbootcmd=run bootcmd\0" \
173 "boot=bootm ${load_addr_r} - ${fdt_addr_r}\0" \
174 "bootcmd=km_checkbidhwk && " \
175 "setenv bootcmd \'if km_checktestboot; then; " \
176 "setenv boot_bank ${test_bank}; else; " \
177 "setenv boot_bank ${actual_bank}; fi;" \
178 "run ${subbootcmds}; reset\' && " \
179 "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
180 "run ${subbootcmds}; reset\' && " \
181 "saveenv && saveenv && boot\0" \
183 "cramfsload ${fdt_addr_r} " \
184 "fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0" \
185 "fdt_addr_r="__stringify(CONFIG_KM_FDT_ADDR) "\0" \
186 "init=/sbin/init-overlay.sh\0" \
187 "load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
188 "load=tftpboot ${load_addr_r} ${u-boot}\0" \
189 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
190 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
192 #endif /* CONFIG_KM_DEF_ENV */
194 #endif /* __CONFIG_KEYMILE_H */