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_DEF_NETDEV
42 #define CONFIG_KM_DEF_NETDEV \
46 #ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
47 #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
48 #endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
50 #ifndef CONFIG_KM_UBI_PART_BOOT_OPTS
51 #define CONFIG_KM_UBI_PART_BOOT_OPTS ""
52 #endif /* CONFIG_KM_UBI_PART_BOOT_OPTS */
54 #ifndef CONFIG_KM_UBI_PARTITION_NAME_APP
55 /* one flash chip only called boot */
56 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
57 # define CONFIG_KM_UBI_LINUX_MTD \
58 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
59 CONFIG_KM_UBI_PART_BOOT_OPTS
60 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
61 "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0"
62 #else /* CONFIG_KM_UBI_PARTITION_NAME_APP */
63 /* two flash chips called boot and app */
64 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
65 /* app: CONFIG_KM_UBI_PARTITION_NAME_APP */
66 # define CONFIG_KM_UBI_LINUX_MTD \
67 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
68 CONFIG_KM_UBI_PART_BOOT_OPTS " " \
69 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP
70 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
71 "ubiattach=if test ${boot_bank} -eq 0; then; " \
72 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \
73 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
74 #endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
76 #ifdef CONFIG_NAND_ECC_BCH
77 #define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
78 #define CONFIG_KM_ECC_MODE " eccmode=bch"
80 #define CONFIG_KM_UIMAGE_NAME "uImage\0"
81 #define CONFIG_KM_ECC_MODE
87 * - set 'bootcmd' and 'altbootcmd'
89 * - 'release': for a standalone system kernel/rootfs from flash
91 #define CONFIG_KM_DEF_ENV_BOOTTARGETS \
92 "subbootcmds=ubiattach ubicopy checkfdt cramfsloadfdt " \
93 "set_fdthigh cramfsloadkernel flashargs add_default " \
96 "tftp 200000 scripts/develop-${arch}.txt && " \
97 "env import -t 200000 ${filesize} && " \
98 "run setup_debug_env\0" \
100 "tftp 200000 scripts/ramfs-${arch}.txt && " \
101 "env import -t 200000 ${filesize} && " \
102 "run setup_debug_env\0" \
107 * - modify 'bootargs'
109 * - 'add_default': default bootargs common for all arm/ppc boards
110 * - 'addpanic': add kernel panic options
111 * - 'flashargs': defaults arguments for flash base boot
114 #define CONFIG_KM_DEF_ENV_BOOTARGS \
116 "setenv bootargs ${bootargs} " \
117 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
118 ":${hostname}:${netdev}:off:" \
119 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
120 " mem=${kernelmem} init=${init}" \
122 " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
123 " " CONFIG_KM_UBI_LINUX_MTD " " \
124 CONFIG_KM_DEF_BOOT_ARGS_CPU \
127 "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
130 "root=mtdblock:rootfs${boot_bank} " \
131 "rootfstype=squashfs ro\0" \
136 * - commands for booting from flash
138 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
139 * - 'ubiattach': attach ubi partition
140 * - 'ubicopy': copy ubi volume to ram
141 * - volume names: bootfs0, bootfs1, bootfs2, ...
143 * processor specific settings
144 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
146 #define CONFIG_KM_DEF_ENV_FLASH_BOOT \
147 "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
148 "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
149 "ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \
150 " bootfs${boot_bank}\0" \
151 "uimage=" CONFIG_KM_UIMAGE_NAME \
152 CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
156 * - KM specific constants and commands
158 * - 'default': setup default environment
160 #define CONFIG_KM_DEF_ENV_CONSTANTS \
162 "release=run newenv; reset\0" \
163 "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
164 "testbootcmd=setenv boot_bank ${test_bank}; " \
165 "run ${subbootcmds}; reset\0" \
168 #ifndef CONFIG_KM_DEF_ENV
169 #define CONFIG_KM_DEF_ENV \
170 CONFIG_KM_DEF_ENV_BOOTPARAMS \
171 CONFIG_KM_DEF_NETDEV \
172 CONFIG_KM_DEF_ENV_CPU \
173 CONFIG_KM_DEF_ENV_BOOTTARGETS \
174 CONFIG_KM_DEF_ENV_BOOTARGS \
175 CONFIG_KM_DEF_ENV_FLASH_BOOT \
176 CONFIG_KM_DEF_ENV_CONSTANTS \
177 "altbootcmd=run bootcmd\0" \
178 "boot=bootm ${load_addr_r} - ${fdt_addr_r}\0" \
179 "bootcmd=km_checkbidhwk && " \
180 "setenv bootcmd \'if km_checktestboot; then; " \
181 "setenv boot_bank ${test_bank}; else; " \
182 "setenv boot_bank ${actual_bank}; fi;" \
183 "run ${subbootcmds}; reset\' && " \
184 "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
185 "run ${subbootcmds}; reset\' && " \
186 "saveenv && saveenv && boot\0" \
188 "cramfsload ${fdt_addr_r} " \
189 "fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0" \
190 "fdt_addr_r="__stringify(CONFIG_KM_FDT_ADDR) "\0" \
191 "init=/sbin/init-overlay.sh\0" \
192 "load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
193 "load=tftpboot ${load_addr_r} ${u-boot}\0" \
194 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
195 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
197 #endif /* CONFIG_KM_DEF_ENV */
199 #endif /* __CONFIG_KEYMILE_H */