2018-05-07 06:58:06 +09:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2008-11-20 17:59:09 +09:00
|
|
|
/*
|
2011-03-16 00:52:29 +09:00
|
|
|
* (C) Copyright 2008-2011
|
2008-11-20 17:59:09 +09:00
|
|
|
* Heiko Schocher, DENX Software Engineering, hs@denx.de.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __CONFIG_KEYMILE_H
|
|
|
|
#define __CONFIG_KEYMILE_H
|
|
|
|
|
2020-05-11 02:40:09 +09:00
|
|
|
#include <linux/stringify.h>
|
|
|
|
|
2008-11-20 17:59:09 +09:00
|
|
|
/*
|
|
|
|
* Miscellaneous configurable options
|
|
|
|
*/
|
|
|
|
#if defined(CONFIG_CMD_KGDB)
|
2011-03-16 00:52:29 +09:00
|
|
|
#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
|
2008-11-20 17:59:09 +09:00
|
|
|
#else
|
2011-03-14 23:49:05 +09:00
|
|
|
#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
|
2008-11-20 17:59:09 +09:00
|
|
|
#endif
|
2011-03-14 23:49:05 +09:00
|
|
|
#define CONFIG_SYS_MAXARGS 32 /* max number of command args */
|
2011-03-16 00:52:29 +09:00
|
|
|
#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
|
2008-11-20 17:59:09 +09:00
|
|
|
|
2011-03-16 00:52:29 +09:00
|
|
|
#define CONFIG_HUSH_INIT_VAR
|
2008-11-20 17:59:09 +09:00
|
|
|
|
2011-04-08 11:47:46 +09:00
|
|
|
#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
|
2008-11-20 17:59:09 +09:00
|
|
|
|
2011-03-16 00:52:29 +09:00
|
|
|
#define CONFIG_LOADS_ECHO
|
|
|
|
#define CONFIG_SYS_LOADS_BAUD_CHANGE
|
2008-11-20 17:59:09 +09:00
|
|
|
|
|
|
|
/*
|
|
|
|
* BOOTP options
|
|
|
|
*/
|
|
|
|
#define CONFIG_BOOTP_BOOTFILESIZE
|
|
|
|
|
2011-03-04 22:56:27 +09:00
|
|
|
#ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
|
|
|
|
#define CONFIG_KM_DEF_ENV_BOOTPARAMS \
|
2011-07-05 06:27:16 +09:00
|
|
|
"actual_bank=0\0"
|
2009-03-12 15:37:18 +09:00
|
|
|
#endif
|
|
|
|
|
2012-05-04 17:30:16 +09: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 19:49:10 +09: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 17:30:16 +09: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 19:49:10 +09:00
|
|
|
"ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
|
|
|
|
CONFIG_KM_UBI_PART_BOOT_OPTS
|
2012-05-04 17:30:16 +09: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 19:49:10 +09:00
|
|
|
"ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
|
|
|
|
CONFIG_KM_UBI_PART_BOOT_OPTS " " \
|
2012-05-04 17:30:16 +09: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-15 00:01:04 +09:00
|
|
|
|
2013-01-21 12:55:20 +09:00
|
|
|
#ifdef CONFIG_NAND_ECC_BCH
|
|
|
|
#define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
|
2013-01-21 12:55:24 +09:00
|
|
|
#define CONFIG_KM_ECC_MODE " eccmode=bch"
|
2013-01-21 12:55:20 +09:00
|
|
|
#else
|
|
|
|
#define CONFIG_KM_UIMAGE_NAME "uImage\0"
|
2013-01-21 12:55:24 +09:00
|
|
|
#define CONFIG_KM_ECC_MODE
|
2013-01-21 12:55:20 +09:00
|
|
|
#endif
|
|
|
|
|
2011-03-04 22:56:27 +09:00
|
|
|
/*
|
|
|
|
* boottargets
|
2011-07-05 06:27:16 +09:00
|
|
|
* - set 'subbootcmds'
|
2011-03-04 22:56:27 +09:00
|
|
|
* - set 'bootcmd' and 'altbootcmd'
|
|
|
|
* available targets:
|
|
|
|
* - 'release': for a standalone system kernel/rootfs from flash
|
|
|
|
*/
|
|
|
|
#define CONFIG_KM_DEF_ENV_BOOTTARGETS \
|
2015-11-14 00:15:20 +09:00
|
|
|
"subbootcmds=ubiattach ubicopy checkfdt cramfsloadfdt " \
|
|
|
|
"set_fdthigh cramfsloadkernel flashargs add_default " \
|
|
|
|
"addpanic boot\0" \
|
2011-07-05 06:52:52 +09:00
|
|
|
"develop=" \
|
2020-10-29 21:48:01 +09:00
|
|
|
"tftp ${load_addr_r} scripts/develop-${arch}.txt && " \
|
|
|
|
"env import -t ${load_addr_r} ${filesize} && " \
|
2011-07-05 06:52:52 +09:00
|
|
|
"run setup_debug_env\0" \
|
|
|
|
"ramfs=" \
|
2020-10-29 21:48:01 +09:00
|
|
|
"tftp ${load_addr_r} scripts/ramfs-${arch}.txt && " \
|
|
|
|
"env import -t ${load_addr_r} ${filesize} && " \
|
2011-07-05 06:52:52 +09:00
|
|
|
"run setup_debug_env\0" \
|
2011-03-04 22:56:27 +09:00
|
|
|
""
|
|
|
|
|
2011-03-15 00:01:04 +09:00
|
|
|
/*
|
|
|
|
* bootargs
|
|
|
|
* - modify 'bootargs'
|
|
|
|
*
|
2011-07-05 06:27:16 +09:00
|
|
|
* - 'add_default': default bootargs common for all arm/ppc boards
|
2011-03-15 00:01:04 +09:00
|
|
|
* - 'addpanic': add kernel panic options
|
|
|
|
* - 'flashargs': defaults arguments for flash base boot
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#define CONFIG_KM_DEF_ENV_BOOTARGS \
|
2011-07-05 06:27:16 +09:00
|
|
|
"add_default=" \
|
2011-03-15 00:01:04 +09:00
|
|
|
"setenv bootargs ${bootargs} " \
|
|
|
|
"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
|
2013-10-18 18:47:16 +09:00
|
|
|
":${hostname}:${netdev}:off:" \
|
2011-07-05 06:27:16 +09:00
|
|
|
" console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
|
2011-09-14 08:06:11 +09:00
|
|
|
" mem=${kernelmem} init=${init}" \
|
2013-01-21 12:55:24 +09:00
|
|
|
CONFIG_KM_ECC_MODE \
|
2012-09-24 00:41:23 +09:00
|
|
|
" phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
|
2012-05-04 17:30:16 +09:00
|
|
|
" " CONFIG_KM_UBI_LINUX_MTD " " \
|
2011-07-05 06:27:16 +09:00
|
|
|
CONFIG_KM_DEF_BOOT_ARGS_CPU \
|
|
|
|
"\0" \
|
2011-03-15 00:01:04 +09:00
|
|
|
"addpanic=" \
|
2011-05-04 10:47:34 +09:00
|
|
|
"setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
|
2011-03-15 00:01:04 +09:00
|
|
|
"flashargs=" \
|
|
|
|
"setenv bootargs " \
|
2011-04-08 11:47:41 +09:00
|
|
|
"root=mtdblock:rootfs${boot_bank} " \
|
2011-03-15 00:01:04 +09: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-24 00:41:23 +09:00
|
|
|
"cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
|
2013-01-21 12:55:20 +09:00
|
|
|
"cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
|
2020-10-10 00:21:33 +09:00
|
|
|
"ubicopy=ubi read ${cramfsaddr} bootfs${boot_bank}\0" \
|
2013-01-21 12:55:20 +09:00
|
|
|
"uimage=" CONFIG_KM_UIMAGE_NAME \
|
2012-05-04 17:30:16 +09:00
|
|
|
CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
|
2011-03-15 00:01:04 +09:00
|
|
|
|
|
|
|
/*
|
|
|
|
* constants
|
|
|
|
* - KM specific constants and commands
|
|
|
|
*
|
|
|
|
* - 'default': setup default environment
|
|
|
|
*/
|
|
|
|
#define CONFIG_KM_DEF_ENV_CONSTANTS \
|
2011-04-08 11:47:41 +09:00
|
|
|
"backup_bank=0\0" \
|
2011-07-05 06:27:16 +09:00
|
|
|
"release=run newenv; reset\0" \
|
2012-09-24 00:41:23 +09:00
|
|
|
"pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
|
2011-06-06 07:22:13 +09:00
|
|
|
"testbootcmd=setenv boot_bank ${test_bank}; " \
|
|
|
|
"run ${subbootcmds}; reset\0" \
|
2020-10-10 00:21:32 +09:00
|
|
|
"env_version=1\0" \
|
2011-03-15 00:01:04 +09:00
|
|
|
""
|
|
|
|
|
2009-03-12 15:37:18 +09:00
|
|
|
#ifndef CONFIG_KM_DEF_ENV
|
|
|
|
#define CONFIG_KM_DEF_ENV \
|
2011-03-04 22:56:27 +09:00
|
|
|
CONFIG_KM_DEF_ENV_BOOTPARAMS \
|
2019-11-27 03:09:01 +09:00
|
|
|
"netdev=" __stringify(CONFIG_KM_DEF_NETDEV) "\0" \
|
2011-03-15 00:01:04 +09:00
|
|
|
CONFIG_KM_DEF_ENV_CPU \
|
2011-03-04 22:56:27 +09:00
|
|
|
CONFIG_KM_DEF_ENV_BOOTTARGETS \
|
2011-03-15 00:01:04 +09:00
|
|
|
CONFIG_KM_DEF_ENV_BOOTARGS \
|
|
|
|
CONFIG_KM_DEF_ENV_FLASH_BOOT \
|
2011-03-04 22:56:27 +09:00
|
|
|
CONFIG_KM_DEF_ENV_CONSTANTS \
|
2011-03-15 00:01:04 +09:00
|
|
|
"altbootcmd=run bootcmd\0" \
|
2014-01-28 00:58:27 +09:00
|
|
|
"boot=bootm ${load_addr_r} - ${fdt_addr_r}\0" \
|
2011-07-05 06:27:16 +09:00
|
|
|
"bootcmd=km_checkbidhwk && " \
|
2012-05-04 17:55:58 +09:00
|
|
|
"setenv bootcmd \'if km_checktestboot; then; " \
|
|
|
|
"setenv boot_bank ${test_bank}; else; " \
|
|
|
|
"setenv boot_bank ${actual_bank}; fi;" \
|
2011-07-05 06:27:16 +09:00
|
|
|
"run ${subbootcmds}; reset\' && " \
|
|
|
|
"setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
|
|
|
|
"run ${subbootcmds}; reset\' && " \
|
|
|
|
"saveenv && saveenv && boot\0" \
|
2014-01-28 00:58:27 +09: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-15 00:01:04 +09:00
|
|
|
"init=/sbin/init-overlay.sh\0" \
|
2012-09-24 00:41:23 +09:00
|
|
|
"load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
|
2011-07-05 06:27:16 +09:00
|
|
|
"load=tftpboot ${load_addr_r} ${u-boot}\0" \
|
2017-10-23 06:55:07 +09:00
|
|
|
"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
|
|
|
|
"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
|
2009-03-12 15:37:18 +09:00
|
|
|
""
|
|
|
|
#endif /* CONFIG_KM_DEF_ENV */
|
|
|
|
|
2008-11-20 17:59:09 +09:00
|
|
|
#endif /* __CONFIG_KEYMILE_H */
|