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_CONCAT
46 #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
47 #define CONFIG_KM_DEF_ENV_BOOTPARAMS \
51 #ifndef CONFIG_KM_DEF_NETDEV
52 #define CONFIG_KM_DEF_NETDEV \
56 #ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
57 #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
58 #endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
60 #ifndef CONFIG_KM_UBI_PART_BOOT_OPTS
61 #define CONFIG_KM_UBI_PART_BOOT_OPTS ""
62 #endif /* CONFIG_KM_UBI_PART_BOOT_OPTS */
64 #ifndef CONFIG_KM_UBI_PARTITION_NAME_APP
65 /* one flash chip only called boot */
66 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
67 # define CONFIG_KM_UBI_LINUX_MTD \
68 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
69 CONFIG_KM_UBI_PART_BOOT_OPTS
70 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
71 "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0"
72 #else /* CONFIG_KM_UBI_PARTITION_NAME_APP */
73 /* two flash chips called boot and app */
74 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
75 /* app: CONFIG_KM_UBI_PARTITION_NAME_APP */
76 # define CONFIG_KM_UBI_LINUX_MTD \
77 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
78 CONFIG_KM_UBI_PART_BOOT_OPTS " " \
79 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP
80 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
81 "ubiattach=if test ${boot_bank} -eq 0; then; " \
82 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \
83 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
84 #endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
86 #ifdef CONFIG_NAND_ECC_BCH
87 #define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
88 #define CONFIG_KM_ECC_MODE " eccmode=bch"
90 #define CONFIG_KM_UIMAGE_NAME "uImage\0"
91 #define CONFIG_KM_ECC_MODE
97 * - set 'bootcmd' and 'altbootcmd'
99 * - 'release': for a standalone system kernel/rootfs from flash
101 #define CONFIG_KM_DEF_ENV_BOOTTARGETS \
102 "subbootcmds=ubiattach ubicopy checkfdt cramfsloadfdt " \
103 "set_fdthigh cramfsloadkernel flashargs add_default " \
106 "tftp 200000 scripts/develop-${arch}.txt && " \
107 "env import -t 200000 ${filesize} && " \
108 "run setup_debug_env\0" \
110 "tftp 200000 scripts/ramfs-${arch}.txt && " \
111 "env import -t 200000 ${filesize} && " \
112 "run setup_debug_env\0" \
117 * - modify 'bootargs'
119 * - 'add_default': default bootargs common for all arm/ppc boards
120 * - 'addpanic': add kernel panic options
121 * - 'flashargs': defaults arguments for flash base boot
124 #define CONFIG_KM_DEF_ENV_BOOTARGS \
126 "setenv bootargs ${bootargs} " \
127 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
128 ":${hostname}:${netdev}:off:" \
129 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
130 " mem=${kernelmem} init=${init}" \
132 " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
133 " " CONFIG_KM_UBI_LINUX_MTD " " \
134 CONFIG_KM_DEF_BOOT_ARGS_CPU \
137 "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
140 "root=mtdblock:rootfs${boot_bank} " \
141 "rootfstype=squashfs ro\0" \
146 * - commands for booting from flash
148 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
149 * - 'ubiattach': attach ubi partition
150 * - 'ubicopy': copy ubi volume to ram
151 * - volume names: bootfs0, bootfs1, bootfs2, ...
153 * processor specific settings
154 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
156 #define CONFIG_KM_DEF_ENV_FLASH_BOOT \
157 "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
158 "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
159 "ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \
160 " bootfs${boot_bank}\0" \
161 "uimage=" CONFIG_KM_UIMAGE_NAME \
162 CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
166 * - KM specific constants and commands
168 * - 'default': setup default environment
170 #define CONFIG_KM_DEF_ENV_CONSTANTS \
172 "release=run newenv; reset\0" \
173 "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
174 "testbootcmd=setenv boot_bank ${test_bank}; " \
175 "run ${subbootcmds}; reset\0" \
178 #ifndef CONFIG_KM_DEF_ENV
179 #define CONFIG_KM_DEF_ENV \
180 CONFIG_KM_DEF_ENV_BOOTPARAMS \
181 CONFIG_KM_DEF_NETDEV \
182 CONFIG_KM_DEF_ENV_CPU \
183 CONFIG_KM_DEF_ENV_BOOTTARGETS \
184 CONFIG_KM_DEF_ENV_BOOTARGS \
185 CONFIG_KM_DEF_ENV_FLASH_BOOT \
186 CONFIG_KM_DEF_ENV_CONSTANTS \
187 "altbootcmd=run bootcmd\0" \
188 "boot=bootm ${load_addr_r} - ${fdt_addr_r}\0" \
189 "bootcmd=km_checkbidhwk && " \
190 "setenv bootcmd \'if km_checktestboot; then; " \
191 "setenv boot_bank ${test_bank}; else; " \
192 "setenv boot_bank ${actual_bank}; fi;" \
193 "run ${subbootcmds}; reset\' && " \
194 "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
195 "run ${subbootcmds}; reset\' && " \
196 "saveenv && saveenv && boot\0" \
199 "cramfsload ${fdt_addr_r} " \
200 "fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0" \
201 "fdt_addr_r="__stringify(CONFIG_KM_FDT_ADDR) "\0" \
202 "init=/sbin/init-overlay.sh\0" \
203 "load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
204 "load=tftpboot ${load_addr_r} ${u-boot}\0" \
205 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
206 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
208 #endif /* CONFIG_KM_DEF_ENV */
210 #endif /* __CONFIG_KEYMILE_H */