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 #undef CONFIG_WATCHDOG /* disable platform specific watchdog */
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
31 /* Support the IVM EEprom */
32 #define CONFIG_SYS_IVM_EEPROM_ADR 0x50
33 #define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400
34 #define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100
39 #define CONFIG_BOOTP_BOOTFILESIZE
41 /* UBI Support for all Keymile boards */
42 #define CONFIG_MTD_CONCAT
44 #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
45 #define CONFIG_KM_DEF_ENV_BOOTPARAMS \
49 #ifndef CONFIG_KM_DEF_NETDEV
50 #define CONFIG_KM_DEF_NETDEV \
54 #ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
55 #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
56 #endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
58 #ifndef CONFIG_KM_UBI_PART_BOOT_OPTS
59 #define CONFIG_KM_UBI_PART_BOOT_OPTS ""
60 #endif /* CONFIG_KM_UBI_PART_BOOT_OPTS */
62 #ifndef CONFIG_KM_UBI_PARTITION_NAME_APP
63 /* one flash chip only called boot */
64 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
65 # define CONFIG_KM_UBI_LINUX_MTD \
66 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
67 CONFIG_KM_UBI_PART_BOOT_OPTS
68 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
69 "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0"
70 #else /* CONFIG_KM_UBI_PARTITION_NAME_APP */
71 /* two flash chips called boot and app */
72 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
73 /* app: CONFIG_KM_UBI_PARTITION_NAME_APP */
74 # define CONFIG_KM_UBI_LINUX_MTD \
75 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
76 CONFIG_KM_UBI_PART_BOOT_OPTS " " \
77 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP
78 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
79 "ubiattach=if test ${boot_bank} -eq 0; then; " \
80 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \
81 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
82 #endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
84 #ifdef CONFIG_NAND_ECC_BCH
85 #define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
86 #define CONFIG_KM_ECC_MODE " eccmode=bch"
88 #define CONFIG_KM_UIMAGE_NAME "uImage\0"
89 #define CONFIG_KM_ECC_MODE
95 * - set 'bootcmd' and 'altbootcmd'
97 * - 'release': for a standalone system kernel/rootfs from flash
99 #define CONFIG_KM_DEF_ENV_BOOTTARGETS \
100 "subbootcmds=ubiattach ubicopy checkfdt cramfsloadfdt " \
101 "set_fdthigh cramfsloadkernel flashargs add_default " \
104 "tftp 200000 scripts/develop-${arch}.txt && " \
105 "env import -t 200000 ${filesize} && " \
106 "run setup_debug_env\0" \
108 "tftp 200000 scripts/ramfs-${arch}.txt && " \
109 "env import -t 200000 ${filesize} && " \
110 "run setup_debug_env\0" \
115 * - modify 'bootargs'
117 * - 'add_default': default bootargs common for all arm/ppc boards
118 * - 'addpanic': add kernel panic options
119 * - 'flashargs': defaults arguments for flash base boot
122 #define CONFIG_KM_DEF_ENV_BOOTARGS \
124 "setenv bootargs ${bootargs} " \
125 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
126 ":${hostname}:${netdev}:off:" \
127 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
128 " mem=${kernelmem} init=${init}" \
130 " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
131 " " CONFIG_KM_UBI_LINUX_MTD " " \
132 CONFIG_KM_DEF_BOOT_ARGS_CPU \
135 "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
138 "root=mtdblock:rootfs${boot_bank} " \
139 "rootfstype=squashfs ro\0" \
144 * - commands for booting from flash
146 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
147 * - 'ubiattach': attach ubi partition
148 * - 'ubicopy': copy ubi volume to ram
149 * - volume names: bootfs0, bootfs1, bootfs2, ...
151 * processor specific settings
152 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
154 #define CONFIG_KM_DEF_ENV_FLASH_BOOT \
155 "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
156 "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
157 "ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \
158 " bootfs${boot_bank}\0" \
159 "uimage=" CONFIG_KM_UIMAGE_NAME \
160 CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
164 * - KM specific constants and commands
166 * - 'default': setup default environment
168 #define CONFIG_KM_DEF_ENV_CONSTANTS \
170 "release=run newenv; reset\0" \
171 "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
172 "testbootcmd=setenv boot_bank ${test_bank}; " \
173 "run ${subbootcmds}; reset\0" \
176 #ifndef CONFIG_KM_DEF_ENV
177 #define CONFIG_KM_DEF_ENV \
178 CONFIG_KM_DEF_ENV_BOOTPARAMS \
179 CONFIG_KM_DEF_NETDEV \
180 CONFIG_KM_DEF_ENV_CPU \
181 CONFIG_KM_DEF_ENV_BOOTTARGETS \
182 CONFIG_KM_DEF_ENV_BOOTARGS \
183 CONFIG_KM_DEF_ENV_FLASH_BOOT \
184 CONFIG_KM_DEF_ENV_CONSTANTS \
185 "altbootcmd=run bootcmd\0" \
186 "boot=bootm ${load_addr_r} - ${fdt_addr_r}\0" \
187 "bootcmd=km_checkbidhwk && " \
188 "setenv bootcmd \'if km_checktestboot; then; " \
189 "setenv boot_bank ${test_bank}; else; " \
190 "setenv boot_bank ${actual_bank}; fi;" \
191 "run ${subbootcmds}; reset\' && " \
192 "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
193 "run ${subbootcmds}; reset\' && " \
194 "saveenv && saveenv && boot\0" \
196 "cramfsload ${fdt_addr_r} " \
197 "fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0" \
198 "fdt_addr_r="__stringify(CONFIG_KM_FDT_ADDR) "\0" \
199 "init=/sbin/init-overlay.sh\0" \
200 "load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
201 "load=tftpboot ${load_addr_r} ${u-boot}\0" \
202 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
203 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
205 #endif /* CONFIG_KM_DEF_ENV */
207 #endif /* __CONFIG_KEYMILE_H */