[U-Boot] [PATCH 0/4] Add more boolean configs to Kconfig

We need to move configs although it is a very tedious work. First, we have to create entries in Kconfig.
1/4: add some FIT options 2/4: add Hush option 3/4: add various commands options
I know there is still more to work on, but I believe every big work is done step by step.
I am not an expert of all the areas of U-Boot, so I need your help.
- Please check if the added Kconfig options (prompt, help message, categorization) are reasonable - Add more options in follow-up patches
Masahiro Yamada (4): FIT: add some FIT configurations to Kconfig hush: add CONFIG_HUSH_PARSER to Kconfig commands: add more command entries in Kconfig spl: fix descending condition to drivers/mtd/nand/
Kconfig | 22 ++++ README | 12 --- common/Kconfig | 300 +++++++++++++++++++++++++++++++++++++++++++++++++-- scripts/Makefile.spl | 2 +- 4 files changed, 314 insertions(+), 22 deletions(-)

Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Kconfig | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/Kconfig b/Kconfig index f34f341..9b16d66 100644 --- a/Kconfig +++ b/Kconfig @@ -93,6 +93,28 @@ config TPL help If you want to build TPL as well as the normal image and SPL, say Y.
+config FIT + bool "Support Flattened Image Tree" + depends on !SPL_BUILD + help + This option allows to boot the new uImage structrure, + Flattened Image Tree. FIT is formally a FDT, which can include + images of various types (kernel, FDT blob, ramdisk, etc.) + in a single blob. To boot this new uImage structure, + pass the the address of the blob to the "bootm" command. + +config FIT_VERBOSE + bool "Display verbose messages on FIT boot" + depends on FIT + +config FIT_SIGNATURE + bool "Enabel signature verification of FIT uImages" + depends on FIT + help + This option enables signature verification of FIT uImages, + using a hash signed and verified using RSA. + See doc/uImage.FIT/signature.txt for more details. + config SYS_EXTRA_OPTIONS string "Extra Options (DEPRECATED)" depends on !SPL_BUILD

On Thu, Nov 13, 2014 at 07:29:06PM +0900, Masahiro Yamada wrote:
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com
Applied to u-boot/master, thanks!

The README file states that the macros beginning with "CONFIG_SYS_" depend on the hardware etc. and should not be meddled with if you do not what you're doing. We have already screwed up with this policy; we have given the prefix "CONFIG_SYS_" to many user-selectable configurations. Here, "CONFIG_SYS_HUSH_PARSER" is one of them. Users can enable it if they want to use a more powerful command line parser, or disable it if they only need a simple one.
This commit attempts to rename CONFIG_SYS_HUSH_PARSER to CONFIG_HUSH_PARSER and move it to Kconfig.
Every board maintainer is expected to enable CONFIG_HUSH_PARSER (= add "CONFIG_HUSH_PARSER=y" to his defconfig file) and remove "#define CONFIG_SYS_HUSH_PARSER" from his header file.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
README | 12 ------------ common/Kconfig | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/README b/README index c3a9dfc..66ec1cb 100644 --- a/README +++ b/README @@ -2834,18 +2834,6 @@ CBFS (Coreboot Filesystem) support
Enable auto completion of commands using TAB.
- CONFIG_SYS_HUSH_PARSER - - Define this variable to enable the "hush" shell (from - Busybox) as command line interpreter, thus enabling - powerful command line syntax like - if...then...else...fi conditionals or `&&' and '||' - constructs ("shell scripts"). - - If undefined, you get the old, much simpler behaviour - with a somewhat smaller memory footprint. - - CONFIG_SYS_PROMPT_HUSH_PS2
This defines the secondary prompt string, which is diff --git a/common/Kconfig b/common/Kconfig index 216a8de..7f8359d 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -1,6 +1,23 @@ menu "Command line interface" depends on !SPL_BUILD
+config HUSH_PARSER + bool "Use hush shell" + select SYS_HUSH_PARSER + help + This option enables the "hush" shell (from Busybox) as command line + interpreter, thus enabling powerful command line syntax like + if...then...else...fi conditionals or `&&' and '||' + constructs ("shell scripts"). + + If disabled, you get the old, much simpler behaviour with a somewhat + smaller memory footprint. + +config SYS_HUSH_PARSER + bool + help + Backward compatibility. + config CMD_BOOTM bool "Enable bootm command" default y

On Thu, Nov 13, 2014 at 07:29:07PM +0900, Masahiro Yamada wrote:
The README file states that the macros beginning with "CONFIG_SYS_" depend on the hardware etc. and should not be meddled with if you do not what you're doing. We have already screwed up with this policy; we have given the prefix "CONFIG_SYS_" to many user-selectable configurations. Here, "CONFIG_SYS_HUSH_PARSER" is one of them. Users can enable it if they want to use a more powerful command line parser, or disable it if they only need a simple one.
This commit attempts to rename CONFIG_SYS_HUSH_PARSER to CONFIG_HUSH_PARSER and move it to Kconfig.
Every board maintainer is expected to enable CONFIG_HUSH_PARSER (= add "CONFIG_HUSH_PARSER=y" to his defconfig file) and remove "#define CONFIG_SYS_HUSH_PARSER" from his header file.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com
Applied to u-boot/master, thanks!

This commit adds some of command entries (CONFIG_CMD_*) to cover include/config_cmd_default.h and a little extra.
Because U-Boot supports lots of commands, they should be categorized according to their usage.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
I know lots of commands are missing. Since I am not familiar with all the commands, volunteers are very very welcome.
- Please check if the added Kconfig options (prompt, help message, categorization) are reasonable.
- Please send patches to add more.
common/Kconfig | 283 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 274 insertions(+), 9 deletions(-)
diff --git a/common/Kconfig b/common/Kconfig index 7f8359d..fd84fa0 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -18,34 +18,299 @@ config SYS_HUSH_PARSER help Backward compatibility.
+comment "Commands" + +menu "Info commands" + +config CMD_BDI + bool "bdinfo" + help + Print board info + +config CMD_CONSOLE + bool "coninfo" + help + Print console devices and information. + +config CMD_LICENSE + bool "license" + help + Print GPL license text + +endmenu + +menu "Boot commands" + +config CMD_BOOTD + bool "bootd" + help + Run the command stored in the environment "bootcmd", i.e. + "bootd" does the same thing as "run bootcmd". + config CMD_BOOTM - bool "Enable bootm command" + bool "bootm" default y help Boot an application image from the memory.
-config CMD_CRC32 - bool "Enable crc32 command" +config CMD_GO + bool "go" default y help - Compute CRC32. + Start an application at a given address. + +config CMD_RUN + bool "run" + help + Run the command in the given environment variable. + +config CMD_IMI + bool "iminfo" + help + Print header information for application image. + +config CMD_IMLS + bool "imls" + help + List all images found in flash + +config CMD_XIMG + bool "imxtract" + help + Extract a part of a multi-image. + +endmenu + +menu "Environment commands"
config CMD_EXPORTENV - bool "Enable env export command" + bool "env export" default y help Export environments.
config CMD_IMPORTENV - bool "Enable env import command" + bool "env import" default y help Import environments.
-config CMD_GO - bool "Enable go command" +config CMD_EDITENV + bool "editenv" + help + Edit environment variable. + +config CMD_SAVEENV + bool "saveenv" + help + Run the command in the given environment variable. + +endmenu + +menu "Memory commands" + +config CMD_MEMORY + bool "md, mm, nm, mw, cp, cmp, base, loop" + help + Memeory commands. + md - memory display + mm - memory modify (auto-incrementing address) + nm - memory modify (constant address) + mw - memory write (fill) + cp - memory copy + cmp - memory compare + base - print or set address offset + loop - initinite loop on address range + +config CMD_CRC32 + bool "crc32" default y help - Start an application at a given address. + Compute CRC32. + +config LOOPW + bool "loopw" + help + Infinite write loop on address range + +config CMD_MEMTEST + bool "crc32" + help + Simple RAM read/write test. + +config CMD_MX_CYCLIC + bool "mdc, mwc" + help + mdc - memory display cyclic + mwc - memory write cyclic + +config CMD_MEMINFO + bool "meminfo" + help + Display memory information. + +endmenu + +menu "Device access commands" + +config CMD_LOADB + bool "loadb" + help + Load a binary file over serial line. + +config CMD_LOADS + bool "loads" + help + Load an S-Record file over serial line + +config CMD_FLASH + bool "flinfo, erase, protect" + help + NOR flash support. + flinfo - print FLASH memory information + erase - FLASH memory + protect - enable or disable FLASH write protection + +config CMD_NAND + bool "nand" + help + NAND support. + +config CMD_SPI + bool "sspi" + help + SPI utility command. + +config CMD_I2C + bool "i2c" + help + I2C support. + +config CMD_USB + bool "usb" + help + USB support. + +config CMD_FPGA + bool "fpga" + help + FPGA support. + +endmenu + + +menu "Shell scripting commands" + +config CMD_ECHO + bool "echo" + help + Echo args to console + +config CMD_ITEST + bool "itest" + help + Return true/false on integer compare. + +config CMD_SOURCE + bool "source" + help + Run script from memory + +endmenu + +menu "Network commands" + +config CMD_NET + bool "bootp, tftpboot" + help + Network commands. + bootp - boot image via network using BOOTP/TFTP protocol + tftpboot - boot image via network using TFTP protocol + +config CMD_TFTPPUT + bool "tftp put" + help + TFTP put command, for uploading files to a server + +config CMD_TFTPSRV + bool "tftpsrv" + help + Act as a TFTP server and boot the first received file + +config CMD_RARP + bool "rarpboot" + help + Boot image via network using RARP/TFTP protocol + +config CMD_DHCP + bool "dhcp" + help + Boot image via network using DHCP/TFTP protocol + +config CMD_NFS + bool "nfs" + help + Boot image via network using NFS protocol. + +config CMD_PING + bool "ping" + help + Send ICMP ECHO_REQUEST to network host + +config CMD_CDP + bool "cdp" + help + Perform CDP network configuration + +config CMD_SNTP + bool "sntp" + help + Synchronize RTC via network + +config CMD_DNS + bool "dns" + help + Lookup the IP of a hostname + +config CMD_DNS + bool "dns" + help + Lookup the IP of a hostname + +config CMD_LINK_LOCAL + bool "linklocal" + help + Acquire a network IP address using the link-local protocol + +endmenu + +menu "Misc commands" + +config CMD_TIME + bool "time" + help + Run commands and summarize execution time. + +# TODO: rename to CMD_SLEEP +config CMD_MISC + bool "sleep" + help + Delay execution for some time + +config CMD_TIMER + bool "timer" + help + Access the system timer. + +config CMD_SETGETDCR + bool "getdcr, setdcr, getidcr, setidcr" + depends on 4xx + help + getdcr - Get an AMCC PPC 4xx DCR's value + setdcr - Set an AMCC PPC 4xx DCR's value + getidcr - Get a register value via indirect DCR addressing + setidcr - Set a register value via indirect DCR addressing + +endmenu
endmenu

On Thu, Nov 13, 2014 at 07:29:08PM +0900, Masahiro Yamada wrote:
This commit adds some of command entries (CONFIG_CMD_*) to cover include/config_cmd_default.h and a little extra.
Because U-Boot supports lots of commands, they should be categorized according to their usage.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com
Applied to u-boot/master, thanks!

SPL should not reference CONFIG_CMD_NAND to decide whether or not it should build drivers/mtd/nand. CONFIG_CMD_NAND should be only used to select the NAND utility command on the command parser.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
scripts/Makefile.spl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 7afe437..0625b2c 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -80,7 +80,7 @@ libs-y += fs/ libs-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/ libs-$(CONFIG_SPL_POWER_SUPPORT) += drivers/power/ drivers/power/pmic/ libs-$(CONFIG_SPL_MTD_SUPPORT) += drivers/mtd/ -libs-$(if $(CONFIG_CMD_NAND),$(CONFIG_SPL_NAND_SUPPORT)) += drivers/mtd/nand/ +libs-$(CONFIG_SPL_NAND_SUPPORT) += drivers/mtd/nand/ libs-$(CONFIG_SPL_DRIVERS_MISC_SUPPORT) += drivers/misc/ libs-$(CONFIG_SPL_ONENAND_SUPPORT) += drivers/mtd/onenand/ libs-$(CONFIG_SPL_DMA_SUPPORT) += drivers/dma/

On Thu, Nov 13, 2014 at 07:29:09PM +0900, Masahiro Yamada wrote:
SPL should not reference CONFIG_CMD_NAND to decide whether or not it should build drivers/mtd/nand. CONFIG_CMD_NAND should be only used to select the NAND utility command on the command parser.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com
Applied to u-boot/master, thanks!
participants (2)
-
Masahiro Yamada
-
Tom Rini