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
36 #define CONFIG_SYS_FLASH_PROTECTION
41 #define CONFIG_BOOTP_BOOTFILESIZE
43 /* UBI Support for all Keymile boards */
44 #define CONFIG_MTD_PARTITIONS
45 #define CONFIG_MTD_DEVICE
46 #define CONFIG_MTD_CONCAT
48 #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
49 #define CONFIG_KM_DEF_ENV_BOOTPARAMS \
53 #ifndef CONFIG_KM_DEF_NETDEV
54 #define CONFIG_KM_DEF_NETDEV \
58 #ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
59 #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
60 #endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
62 #ifndef CONFIG_KM_UBI_PART_BOOT_OPTS
63 #define CONFIG_KM_UBI_PART_BOOT_OPTS ""
64 #endif /* CONFIG_KM_UBI_PART_BOOT_OPTS */
66 #ifndef CONFIG_KM_UBI_PARTITION_NAME_APP
67 /* one flash chip only called boot */
68 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
69 # define CONFIG_KM_UBI_LINUX_MTD \
70 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
71 CONFIG_KM_UBI_PART_BOOT_OPTS
72 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
73 "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0"
74 #else /* CONFIG_KM_UBI_PARTITION_NAME_APP */
75 /* two flash chips called boot and app */
76 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
77 /* app: CONFIG_KM_UBI_PARTITION_NAME_APP */
78 # define CONFIG_KM_UBI_LINUX_MTD \
79 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
80 CONFIG_KM_UBI_PART_BOOT_OPTS " " \
81 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP
82 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
83 "ubiattach=if test ${boot_bank} -eq 0; then; " \
84 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \
85 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
86 #endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
88 #ifdef CONFIG_NAND_ECC_BCH
89 #define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
90 #define CONFIG_KM_ECC_MODE " eccmode=bch"
92 #define CONFIG_KM_UIMAGE_NAME "uImage\0"
93 #define CONFIG_KM_ECC_MODE
99 * - set 'bootcmd' and 'altbootcmd'
101 * - 'release': for a standalone system kernel/rootfs from flash
103 #define CONFIG_KM_DEF_ENV_BOOTTARGETS \
104 "subbootcmds=ubiattach ubicopy checkfdt cramfsloadfdt " \
105 "set_fdthigh cramfsloadkernel flashargs add_default " \
108 "tftp 200000 scripts/develop-${arch}.txt && " \
109 "env import -t 200000 ${filesize} && " \
110 "run setup_debug_env\0" \
112 "tftp 200000 scripts/ramfs-${arch}.txt && " \
113 "env import -t 200000 ${filesize} && " \
114 "run setup_debug_env\0" \
119 * - modify 'bootargs'
121 * - 'add_default': default bootargs common for all arm/ppc boards
122 * - 'addpanic': add kernel panic options
123 * - 'flashargs': defaults arguments for flash base boot
126 #define CONFIG_KM_DEF_ENV_BOOTARGS \
128 "setenv bootargs ${bootargs} " \
129 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
130 ":${hostname}:${netdev}:off:" \
131 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
132 " mem=${kernelmem} init=${init}" \
134 " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
135 " " CONFIG_KM_UBI_LINUX_MTD " " \
136 CONFIG_KM_DEF_BOOT_ARGS_CPU \
139 "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
142 "root=mtdblock:rootfs${boot_bank} " \
143 "rootfstype=squashfs ro\0" \
148 * - commands for booting from flash
150 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
151 * - 'ubiattach': attach ubi partition
152 * - 'ubicopy': copy ubi volume to ram
153 * - volume names: bootfs0, bootfs1, bootfs2, ...
155 * processor specific settings
156 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
158 #define CONFIG_KM_DEF_ENV_FLASH_BOOT \
159 "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
160 "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
161 "ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \
162 " bootfs${boot_bank}\0" \
163 "uimage=" CONFIG_KM_UIMAGE_NAME \
164 CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
168 * - KM specific constants and commands
170 * - 'default': setup default environment
172 #define CONFIG_KM_DEF_ENV_CONSTANTS \
174 "release=run newenv; reset\0" \
175 "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
176 "testbootcmd=setenv boot_bank ${test_bank}; " \
177 "run ${subbootcmds}; reset\0" \
180 #ifndef CONFIG_KM_DEF_ENV
181 #define CONFIG_KM_DEF_ENV \
182 CONFIG_KM_DEF_ENV_BOOTPARAMS \
183 CONFIG_KM_DEF_NETDEV \
184 CONFIG_KM_DEF_ENV_CPU \
185 CONFIG_KM_DEF_ENV_BOOTTARGETS \
186 CONFIG_KM_DEF_ENV_BOOTARGS \
187 CONFIG_KM_DEF_ENV_FLASH_BOOT \
188 CONFIG_KM_DEF_ENV_CONSTANTS \
189 "altbootcmd=run bootcmd\0" \
190 "boot=bootm ${load_addr_r} - ${fdt_addr_r}\0" \
191 "bootcmd=km_checkbidhwk && " \
192 "setenv bootcmd \'if km_checktestboot; then; " \
193 "setenv boot_bank ${test_bank}; else; " \
194 "setenv boot_bank ${actual_bank}; fi;" \
195 "run ${subbootcmds}; reset\' && " \
196 "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
197 "run ${subbootcmds}; reset\' && " \
198 "saveenv && saveenv && boot\0" \
201 "cramfsload ${fdt_addr_r} " \
202 "fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0" \
203 "fdt_addr_r="__stringify(CONFIG_KM_FDT_ADDR) "\0" \
204 "init=/sbin/init-overlay.sh\0" \
205 "load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
206 "load=tftpboot ${load_addr_r} ${u-boot}\0" \
207 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
208 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
210 #endif /* CONFIG_KM_DEF_ENV */
212 #endif /* __CONFIG_KEYMILE_H */