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.
|
|
|
|
*
|
2013-10-07 11:07:26 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2008-11-20 08:59:09 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __CONFIG_KEYMILE_H
|
|
|
|
#define __CONFIG_KEYMILE_H
|
|
|
|
|
2010-04-26 11:07:28 +00:00
|
|
|
#define CONFIG_BOOTCOUNT_LIMIT
|
2008-11-20 08:59:09 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Command line configuration.
|
|
|
|
*/
|
|
|
|
#define CONFIG_CMD_ASKENV
|
|
|
|
#define CONFIG_CMD_DHCP
|
2011-09-22 05:06:12 +00:00
|
|
|
#define CONFIG_CMD_DEFAULTENV_VARS
|
2013-07-04 13:37:32 +00:00
|
|
|
#define CONFIG_CMD_GREPENV
|
2008-11-20 08:59:09 +00:00
|
|
|
#define CONFIG_CMD_IMMAP
|
|
|
|
#define CONFIG_CMD_MII
|
|
|
|
#define CONFIG_CMD_PING
|
|
|
|
#define CONFIG_CMD_EEPROM
|
|
|
|
#define CONFIG_CMD_I2C
|
2009-03-12 06:37:18 +00:00
|
|
|
#define CONFIG_CMD_JFFS2
|
2009-07-09 10:04:18 +00:00
|
|
|
#define CONFIG_CMD_MTDPARTS
|
2008-11-20 08:59:09 +00:00
|
|
|
|
2011-03-15 15:52:29 +00:00
|
|
|
#undef CONFIG_WATCHDOG /* disable platform specific watchdog */
|
2008-11-20 08:59:09 +00:00
|
|
|
|
2011-03-14 14:49:05 +00:00
|
|
|
#define CONFIG_BOOTDELAY 2 /* autoboot after 2 seconds */
|
2011-03-15 15:52:29 +00:00
|
|
|
#undef CONFIG_BOOTARGS /* the boot command will set bootargs */
|
2008-11-20 08:59:09 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Miscellaneous configurable options
|
|
|
|
*/
|
|
|
|
#define CONFIG_SYS_HUSH_PARSER
|
2011-03-15 15:52:29 +00:00
|
|
|
#define CONFIG_SYS_LONGHELP /* undef to save memory */
|
2008-11-20 08:59:09 +00:00
|
|
|
#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-15 15:52:29 +00:00
|
|
|
#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
|
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
|
|
|
|
#define CONFIG_CMDLINE_EDITING
|
|
|
|
#define CONFIG_AUTO_COMPLETE
|
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
|
|
|
|
|
|
|
#define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */
|
|
|
|
|
2011-03-15 15:52:29 +00:00
|
|
|
#define CONFIG_BAUDRATE 115200
|
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
|
|
|
|
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
|
|
|
|
#define CONFIG_BOOTP_BOOTPATH
|
|
|
|
#define CONFIG_BOOTP_GATEWAY
|
|
|
|
#define CONFIG_BOOTP_HOSTNAME
|
|
|
|
|
2009-07-09 10:04:18 +00:00
|
|
|
/* UBI Support for all Keymile boards */
|
|
|
|
#define CONFIG_CMD_UBI
|
|
|
|
#define CONFIG_RBTREE
|
|
|
|
#define CONFIG_MTD_PARTITIONS
|
|
|
|
#define CONFIG_MTD_DEVICE
|
|
|
|
#define CONFIG_MTD_CONCAT
|
|
|
|
|
2011-06-05 22:22:21 +00:00
|
|
|
#define CONFIG_CMD_CRAMFS
|
|
|
|
#define CONFIG_CRAMFS_CMDLINE
|
|
|
|
|
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 \
|
arm/km: define fdt_high env variable and allow backwards compatibility
Add set_fdthigh subcommand to "subbootcmds" (release) so to set "fdt_high"
This is necessary on Kirkwood so that the FDT does not get relocated
above the memory limit that the kernel cannot access
(that is the memory part reserved for the switch).
This was tested on NUSA1, where it is necessary, and on ETER1, where it
doesn't seem to hurt.
We want the scripts to also work with older versions of u-boot, where:
a) set_fdthigh is not defined (will be default env for newer u-boots)
b) the fdt will not be available
For this reason, we use "set_fdthigh" to tell whether we are running
a newer (FDT-aware) u-boot or not.
So if "set_fdthigh" runs successfully or arch != arm we try loading
the fdt; otherwise we proceed normally.
Notice how, contrary to release mode, set_fdthigh will _not_ be part of
subbootcmds for develop and ramfs, but will be executed as part of
"tftpfdt".
Since this is only needed for kirkwood cards, and it prevents the kernel
from booting on QorIQ (though it seemed to work on ETER1), we change
its definition in the default env for powerpc so that the value is only
set on ARM.
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Acked-by: Valentin Longchamp <valentin.longchamp@keymile.com>
2014-01-27 15:58:28 +00:00
|
|
|
"subbootcmds=ubiattach ubicopy 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" \
|
2012-05-04 08:55:54 +00:00
|
|
|
"bootlimit=3\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" \
|
2011-03-14 15:01:04 +00:00
|
|
|
"mtdids=" MTDIDS_DEFAULT "\0" \
|
|
|
|
"mtdparts=" MTDPARTS_DEFAULT "\0" \
|
2009-03-12 06:37:18 +00:00
|
|
|
""
|
|
|
|
#endif /* CONFIG_KM_DEF_ENV */
|
|
|
|
|
2011-04-08 02:47:46 +00:00
|
|
|
#define CONFIG_VERSION_VARIABLE /* include version env variable */
|
2009-03-12 06:37:18 +00:00
|
|
|
|
2008-11-20 08:59:09 +00:00
|
|
|
#endif /* __CONFIG_KEYMILE_H */
|