Skip to contentSkip to conversation

Add more boolean configs to Kconfig

PATCH New Masahiro Yamada 2 participants 9 messages Nov 13, 2014 – Nov 24, 2014 Kbuild

lore
Share & tools
lore
#0 lore raw

cover 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(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/4 FIT: add some FIT configurations to Kconfig

---

 Kconfig | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
Kconfig +22 -0
index f34f341..9b16d66 100644
@@ -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
Signature · 1 line
1.9.1
#2 lore raw

PATCH 1/4 FIT: add some FIT configurations to Kconfig

Quoted 1 line · Masahiro Yamada

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141124/90735dd0/attachment.pgp>
#3 lore raw

PATCH 2/4 hush: add CONFIG_HUSH_PARSER to Kconfig

In reply to Masahiro Yamada

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.

---

 README         | 12 ------------
 common/Kconfig | 17 +++++++++++++++++
 2 files changed, 17 insertions(+), 12 deletions(-)
README +0 -12
index c3a9dfc..66ec1cb 100644
@@ -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
common/Kconfig +17 -0
index 216a8de..7f8359d 100644
@@ -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
Signature · 1 line
1.9.1
#4 lore raw

PATCH 2/4 hush: add CONFIG_HUSH_PARSER to Kconfig

Quoted 9 lines · Masahiro Yamada

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.

Quoted 8 lines

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141124/a8100e29/attachment.pgp>
#5 lore raw

PATCH 3/4 commands: add more command entries in Kconfig

In reply to Masahiro Yamada

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.

---

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(-)
common/Kconfig +274 -9
index 7f8359d..fd84fa0 100644
@@ -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
Signature · 1 line
1.9.1
#6 lore raw

PATCH 3/4 commands: add more command entries in Kconfig

Quoted 7 lines · Masahiro Yamada

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141124/ad7776d8/attachment.pgp>
#7 lore raw

PATCH 4/4 spl: fix descending condition to drivers/mtd/nand/

In reply to Masahiro Yamada

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.

---

 scripts/Makefile.spl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/Makefile.spl +1 -1
index 7afe437..0625b2c 100644
@@ -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/
Signature · 1 line
1.9.1
#8 lore raw

PATCH 4/4 spl: fix descending condition to drivers/mtd/nand/

Quoted 5 lines · Masahiro Yamada

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141124/0bf7b673/attachment.pgp>