2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2008-11-20 08:59:09 +00:00
|
|
|
/*
|
2011-03-15 15:52:29 +00:00
|
|
|
* (C) Copyright 2008-2011
|
2008-11-20 08:59:09 +00:00
|
|
|
* Heiko Schocher, DENX Software Engineering, hs@denx.de.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __CONFIG_KEYMILE_H
|
|
|
|
#define __CONFIG_KEYMILE_H
|
|
|
|
|
2011-03-15 15:52:29 +00:00
|
|
|
#undef CONFIG_WATCHDOG /* disable platform specific watchdog */
|
2008-11-20 08:59:09 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Miscellaneous configurable options
|
|
|
|
*/
|
|
|
|
#if defined(CONFIG_CMD_KGDB)
|
2011-03-15 15:52:29 +00:00
|
|
|
#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
|
2008-11-20 08:59:09 +00:00
|
|
|
#else
|
2011-03-14 14:49:05 +00:00
|
|
|
#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
|
2008-11-20 08:59:09 +00:00
|
|
|
#endif
|
2011-03-14 14:49:05 +00:00
|
|
|
#define CONFIG_SYS_MAXARGS 32 /* max number of command args */
|
2011-03-15 15:52:29 +00:00
|
|
|
#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
|
2008-11-20 08:59:09 +00:00
|
|
|
|
2011-03-15 15:52:29 +00:00
|
|
|
#define CONFIG_HUSH_INIT_VAR
|
2008-11-20 08:59:09 +00:00
|
|
|
|
2011-04-08 02:47:46 +00:00
|
|
|
#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
|
2008-11-20 08:59:09 +00:00
|
|
|
|
2011-03-15 15:52:29 +00:00
|
|
|
#define CONFIG_LOADS_ECHO
|
|
|
|
#define CONFIG_SYS_LOADS_BAUD_CHANGE
|
2008-11-20 08:59:09 +00:00
|
|
|
|
2015-11-13 15:15:19 +00:00
|
|
|
|
2009-03-12 06:37:18 +00:00
|
|
|
/* Support the IVM EEprom */
|
|
|
|
#define CONFIG_SYS_IVM_EEPROM_ADR 0x50
|
|
|
|
#define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400
|
|
|
|
#define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100
|
|
|
|
|
2011-03-15 15:52:29 +00:00
|
|
|
#define CONFIG_SYS_FLASH_PROTECTION
|
2009-03-12 06:37:18 +00:00
|
|
|
|
2008-11-20 08:59:09 +00:00
|
|
|
/*
|
|
|
|
* BOOTP options
|
|
|
|
*/
|
|
|
|
#define CONFIG_BOOTP_BOOTFILESIZE
|
|
|
|
|
2009-07-09 10:04:18 +00:00
|
|
|
/* UBI Support for all Keymile boards */
|
|
|
|
#define CONFIG_MTD_CONCAT
|
|
|
|
|
2011-03-04 13:56:27 +00:00
|
|
|
#ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
|
|
|
|
#define CONFIG_KM_DEF_ENV_BOOTPARAMS \
|
2011-07-04 21:27:16 +00:00
|
|
|
"actual_bank=0\0"
|
2009-03-12 06:37:18 +00:00
|
|
|
#endif
|
|
|
|
|
2011-03-14 15:01:04 +00:00
|
|
|
#ifndef CONFIG_KM_DEF_NETDEV
|
|
|
|
#define CONFIG_KM_DEF_NETDEV \
|
|
|
|
"netdev=eth0\0"
|
|
|
|
#endif
|
|
|
|
|
2012-05-04 08:30:16 +00:00
|
|
|
#ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
|
|
|
|
#define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
|
|
|
|
#endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
|
|
|
|
|
2014-01-27 10:49:10 +00:00
|
|
|
#ifndef CONFIG_KM_UBI_PART_BOOT_OPTS
|
|
|
|
#define CONFIG_KM_UBI_PART_BOOT_OPTS ""
|
|
|
|
#endif /* CONFIG_KM_UBI_PART_BOOT_OPTS */
|
|
|
|
|
2012-05-04 08:30:16 +00:00
|
|
|
#ifndef CONFIG_KM_UBI_PARTITION_NAME_APP
|
|
|
|
/* one flash chip only called boot */
|
|
|
|
/* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
|
|
|
|
# define CONFIG_KM_UBI_LINUX_MTD \
|
2014-01-27 10:49:10 +00:00
|
|
|
"ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
|
|
|
|
CONFIG_KM_UBI_PART_BOOT_OPTS
|
2012-05-04 08:30:16 +00:00
|
|
|
# define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
|
|
|
|
"ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0"
|
|
|
|
#else /* CONFIG_KM_UBI_PARTITION_NAME_APP */
|
|
|
|
/* two flash chips called boot and app */
|
|
|
|
/* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
|
|
|
|
/* app: CONFIG_KM_UBI_PARTITION_NAME_APP */
|
|
|
|
# define CONFIG_KM_UBI_LINUX_MTD \
|
2014-01-27 10:49:10 +00:00
|
|
|
"ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
|
|
|
|
CONFIG_KM_UBI_PART_BOOT_OPTS " " \
|
2012-05-04 08:30:16 +00:00
|
|
|
"ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP
|
|
|
|
# define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
|
|
|
|
"ubiattach=if test ${boot_bank} -eq 0; then; " \
|
|
|
|
"ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \
|
|
|
|
"ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
|
|
|
|
#endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
|
2011-03-14 15:01:04 +00:00
|
|
|
|
2013-01-21 03:55:20 +00:00
|
|
|
#ifdef CONFIG_NAND_ECC_BCH
|
|
|
|
#define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
|
2013-01-21 03:55:24 +00:00
|
|
|
#define CONFIG_KM_ECC_MODE " eccmode=bch"
|
2013-01-21 03:55:20 +00:00
|
|
|
#else
|
|
|
|
#define CONFIG_KM_UIMAGE_NAME "uImage\0"
|
2013-01-21 03:55:24 +00:00
|
|
|
#define CONFIG_KM_ECC_MODE
|
2013-01-21 03:55:20 +00:00
|
|
|
#endif
|
|
|
|
|
2011-03-04 13:56:27 +00:00
|
|
|
/*
|
|
|
|
* boottargets
|
2011-07-04 21:27:16 +00:00
|
|
|
* - set 'subbootcmds'
|
2011-03-04 13:56:27 +00:00
|
|
|
* - set 'bootcmd' and 'altbootcmd'
|
|
|
|
* available targets:
|
|
|
|
* - 'release': for a standalone system kernel/rootfs from flash
|
|
|
|
*/
|
|
|
|
#define CONFIG_KM_DEF_ENV_BOOTTARGETS \
|
2015-11-13 15:15:20 +00:00
|
|
|
"subbootcmds=ubiattach ubicopy checkfdt cramfsloadfdt " \
|
|
|
|
"set_fdthigh cramfsloadkernel flashargs add_default " \
|
|
|
|
"addpanic boot\0" \
|
2011-07-04 21:52:52 +00:00
|
|
|
"develop=" \
|
|
|
|
"tftp 200000 scripts/develop-${arch}.txt && " \
|
2011-05-04 01:47:34 +00:00
|
|
|
"env import -t 200000 ${filesize} && " \
|
2011-07-04 21:52:52 +00:00
|
|
|
"run setup_debug_env\0" \
|
|
|
|
"ramfs=" \
|
|
|
|
"tftp 200000 scripts/ramfs-${arch}.txt && " \
|
|
|
|
"env import -t 200000 ${filesize} && " \
|
|
|
|
"run setup_debug_env\0" \
|
2011-03-04 13:56:27 +00:00
|
|
|
""
|
|
|
|
|
2011-03-14 15:01:04 +00:00
|
|
|
/*
|
|
|
|
* bootargs
|
|
|
|
* - modify 'bootargs'
|
|
|
|
*
|
2011-07-04 21:27:16 +00:00
|
|
|
* - 'add_default': default bootargs common for all arm/ppc boards
|
2011-03-14 15:01:04 +00:00
|
|
|
* - 'addpanic': add kernel panic options
|
|
|
|
* - 'flashargs': defaults arguments for flash base boot
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#define CONFIG_KM_DEF_ENV_BOOTARGS \
|
2011-07-04 21:27:16 +00:00
|
|
|
"add_default=" \
|
2011-03-14 15:01:04 +00:00
|
|
|
"setenv bootargs ${bootargs} " \
|
|
|
|
"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
|
2013-10-18 09:47:16 +00:00
|
|
|
":${hostname}:${netdev}:off:" \
|
2011-07-04 21:27:16 +00:00
|
|
|
" console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
|
2011-09-13 23:06:11 +00:00
|
|
|
" mem=${kernelmem} init=${init}" \
|
2013-01-21 03:55:24 +00:00
|
|
|
CONFIG_KM_ECC_MODE \
|
2012-09-23 15:41:23 +00:00
|
|
|
" phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
|
2012-05-04 08:30:16 +00:00
|
|
|
" " CONFIG_KM_UBI_LINUX_MTD " " \
|
2011-07-04 21:27:16 +00:00
|
|
|
CONFIG_KM_DEF_BOOT_ARGS_CPU \
|
|
|
|
"\0" \
|
2011-03-14 15:01:04 +00:00
|
|
|
"addpanic=" \
|
2011-05-04 01:47:34 +00:00
|
|
|
"setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
|
2011-03-14 15:01:04 +00:00
|
|
|
"flashargs=" \
|
|
|
|
"setenv bootargs " \
|
2011-04-08 02:47:41 +00:00
|
|
|
"root=mtdblock:rootfs${boot_bank} " \
|
2011-03-14 15:01:04 +00:00
|
|
|
"rootfstype=squashfs ro\0" \
|
|
|
|
""
|
|
|
|
|
|
|
|
/*
|
|
|
|
* flash_boot
|
|
|
|
* - commands for booting from flash
|
|
|
|
*
|
|
|
|
* - 'cramfsloadkernel': copy kernel from a cramfs to ram
|
|
|
|
* - 'ubiattach': attach ubi partition
|
|
|
|
* - 'ubicopy': copy ubi volume to ram
|
|
|
|
* - volume names: bootfs0, bootfs1, bootfs2, ...
|
|
|
|
*
|
|
|
|
* processor specific settings
|
|
|
|
* - 'cramfsloadfdt': copy fdt from a cramfs to ram
|
|
|
|
*/
|
|
|
|
#define CONFIG_KM_DEF_ENV_FLASH_BOOT \
|
2012-09-23 15:41:23 +00:00
|
|
|
"cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
|
2013-01-21 03:55:20 +00:00
|
|
|
"cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
|
2012-09-23 15:41:23 +00:00
|
|
|
"ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \
|
2011-05-04 01:47:34 +00:00
|
|
|
" bootfs${boot_bank}\0" \
|
2013-01-21 03:55:20 +00:00
|
|
|
"uimage=" CONFIG_KM_UIMAGE_NAME \
|
2012-05-04 08:30:16 +00:00
|
|
|
CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
|
2011-03-14 15:01:04 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* constants
|
|
|
|
* - KM specific constants and commands
|
|
|
|
*
|
|
|
|
* - 'default': setup default environment
|
|
|
|
*/
|
|
|
|
#define CONFIG_KM_DEF_ENV_CONSTANTS \
|
2011-04-08 02:47:41 +00:00
|
|
|
"backup_bank=0\0" \
|
2011-07-04 21:27:16 +00:00
|
|
|
"release=run newenv; reset\0" \
|
2012-09-23 15:41:23 +00:00
|
|
|
"pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
|
2011-06-05 22:22:13 +00:00
|
|
|
"testbootcmd=setenv boot_bank ${test_bank}; " \
|
|
|
|
"run ${subbootcmds}; reset\0" \
|
2011-03-14 15:01:04 +00:00
|
|
|
""
|
|
|
|
|
2009-03-12 06:37:18 +00:00
|
|
|
#ifndef CONFIG_KM_DEF_ENV
|
|
|
|
#define CONFIG_KM_DEF_ENV \
|
2011-03-04 13:56:27 +00:00
|
|
|
CONFIG_KM_DEF_ENV_BOOTPARAMS \
|
2011-03-14 15:01:04 +00:00
|
|
|
CONFIG_KM_DEF_NETDEV \
|
|
|
|
CONFIG_KM_DEF_ENV_CPU \
|
2011-03-04 13:56:27 +00:00
|
|
|
CONFIG_KM_DEF_ENV_BOOTTARGETS \
|
2011-03-14 15:01:04 +00:00
|
|
|
CONFIG_KM_DEF_ENV_BOOTARGS \
|
|
|
|
CONFIG_KM_DEF_ENV_FLASH_BOOT \
|
2011-03-04 13:56:27 +00:00
|
|
|
CONFIG_KM_DEF_ENV_CONSTANTS \
|
2011-03-14 15:01:04 +00:00
|
|
|
"altbootcmd=run bootcmd\0" \
|
2014-01-27 15:58:27 +00:00
|
|
|
"boot=bootm ${load_addr_r} - ${fdt_addr_r}\0" \
|
2011-07-04 21:27:16 +00:00
|
|
|
"bootcmd=km_checkbidhwk && " \
|
2012-05-04 08:55:58 +00:00
|
|
|
"setenv bootcmd \'if km_checktestboot; then; " \
|
|
|
|
"setenv boot_bank ${test_bank}; else; " \
|
|
|
|
"setenv boot_bank ${actual_bank}; fi;" \
|
2011-07-04 21:27:16 +00:00
|
|
|
"run ${subbootcmds}; reset\' && " \
|
|
|
|
"setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
|
|
|
|
"run ${subbootcmds}; reset\' && " \
|
|
|
|
"saveenv && saveenv && boot\0" \
|
2014-01-27 15:58:27 +00:00
|
|
|
"cramfsloadfdt=" \
|
|
|
|
"cramfsload ${fdt_addr_r} " \
|
|
|
|
"fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0" \
|
|
|
|
"fdt_addr_r="__stringify(CONFIG_KM_FDT_ADDR) "\0" \
|
2011-03-14 15:01:04 +00:00
|
|
|
"init=/sbin/init-overlay.sh\0" \
|
2012-09-23 15:41:23 +00:00
|
|
|
"load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
|
2011-07-04 21:27:16 +00:00
|
|
|
"load=tftpboot ${load_addr_r} ${u-boot}\0" \
|
2017-10-22 21:55:07 +00:00
|
|
|
"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
|
|
|
|
"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
|
2009-03-12 06:37:18 +00:00
|
|
|
""
|
|
|
|
#endif /* CONFIG_KM_DEF_ENV */
|
|
|
|
|
2008-11-20 08:59:09 +00:00
|
|
|
#endif /* __CONFIG_KEYMILE_H */
|