common: add U_BOOT_CMD_ALWAYS() support
This function is used to support some special U-Boot commands with U_BOOT_CMD_ALWAYS() declared even when CONFIG_CMDLINE is disabled. It's used when developers requires a critial u-boot.bin by disabling the U_BOOT_CMD() and using a simple CLI instead. Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Change-Id: I768637592a4d85c7fea00564e96fb80f21ab65fe
This commit is contained in:
parent
aedbab3f0f
commit
3d8049ad2f
|
|
@ -15,7 +15,7 @@ OUTPUT_ARCH(arm)
|
|||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
#ifndef CONFIG_CMDLINE
|
||||
#if !defined(CONFIG_CMDLINE) && !defined(CONFIG_U_BOOT_CMD_ALWAYS)
|
||||
/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
|
||||
#endif
|
||||
#if defined(CONFIG_ARMV7_SECURE_BASE) && defined(CONFIG_ARMV7_NONSEC)
|
||||
|
|
|
|||
|
|
@ -30,6 +30,14 @@ config SYS_PROMPT
|
|||
This string is displayed in the command line to the left of the
|
||||
cursor.
|
||||
|
||||
config U_BOOT_CMD_ALWAYS
|
||||
bool "Enable cmd with U_BOOT_CMD_ALWAYS() declared"
|
||||
depends on !CMDLINE
|
||||
help
|
||||
This function is used to support some special U-Boot commands with
|
||||
U_BOOT_CMD_ALWAYS() declared even when CONFIG_CMDLINE is disabled.
|
||||
It reduces the image size and works with simple CLI.
|
||||
|
||||
menu "Autoboot options"
|
||||
|
||||
config AUTOBOOT
|
||||
|
|
|
|||
|
|
@ -221,4 +221,14 @@ int board_run_command(const char *cmdline);
|
|||
U_BOOT_CMD_MKENT_COMPLETE(_name, _maxargs, _rep, _cmd, \
|
||||
_usage, _help, NULL)
|
||||
|
||||
#ifdef CONFIG_U_BOOT_CMD_ALWAYS
|
||||
#define U_BOOT_CMD_ALWAYS(_name, _maxargs, _rep, _cmd, _usage, _help) \
|
||||
ll_entry_declare(cmd_tbl_t, _name, cmd) = \
|
||||
{ #_name, _maxargs, _rep, _cmd, _usage, \
|
||||
_CMD_HELP(_help) _CMD_COMPLETE(NULL) }
|
||||
#else
|
||||
#define U_BOOT_CMD_ALWAYS(_name, _maxargs, _rep, _cmd, _usage, _help) \
|
||||
U_BOOT_CMD(_name, _maxargs, _rep, _cmd, _usage, _help)
|
||||
#endif
|
||||
|
||||
#endif /* __COMMAND_H */
|
||||
|
|
|
|||
Loading…
Reference in New Issue