[U-Boot] [PATCH 15/41] Kconfig: Convert CMD_READ to Kconfig

Simon Glass sjg at chromium.org
Fri Jul 21 23:11:14 UTC 2017


Convert this option and enable it in sandbox. Also correct a bug which
was introduced with the block-device driver model conversion.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 README                       | 2 --
 cmd/Kconfig                  | 5 +++++
 cmd/Makefile                 | 1 -
 cmd/read.c                   | 2 +-
 configs/sandbox_defconfig    | 3 +++
 include/command.h            | 9 ++++-----
 include/config_cmd_all.h     | 2 --
 scripts/config_whitelist.txt | 2 --
 8 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/README b/README
index e05be8d9a7..8dc75009d1 100644
--- a/README
+++ b/README
@@ -815,8 +815,6 @@ The following options need to be configured:
 		CONFIG_CMD_NFS		  NFS support
 		CONFIG_CMD_PING		* send ICMP ECHO_REQUEST to network
 					  host
-		CONFIG_CMD_PORTIO	* Port I/O
-		CONFIG_CMD_READ		* Read raw data from partition
 		CONFIG_CMD_REGINFO	* Register dump
 		CONFIG_CMD_RUN		  run command in env variable
 		CONFIG_CMD_SANDBOX	* sb command to access sandbox features
diff --git a/cmd/Kconfig b/cmd/Kconfig
index c9fb24d984..2546ef61f6 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -787,6 +787,11 @@ config CMD_PCMCIA
 	  1990. These devices are typically removable memory or network cards using
 	  a standard 68-pin connector.
 
+config CMD_READ
+	bool "read - Read binary data from a partition"
+	help
+	  Provides low-level access to the data in a partition.
+
 endmenu
 
 
diff --git a/cmd/Makefile b/cmd/Makefile
index bd231f24d8..eff6bd678f 100644
--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -97,7 +97,6 @@ ifdef CONFIG_PCI
 obj-$(CONFIG_CMD_PCI) += pci.o
 endif
 obj-y += pcmcia.o
-obj-$(CONFIG_CMD_PORTIO) += portio.o
 obj-$(CONFIG_CMD_PXE) += pxe.o
 obj-$(CONFIG_CMD_QFW) += qfw.o
 obj-$(CONFIG_CMD_READ) += read.o
diff --git a/cmd/read.c b/cmd/read.c
index 61d8ce73e4..ecf925426f 100644
--- a/cmd/read.c
+++ b/cmd/read.c
@@ -66,7 +66,7 @@ int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		return 1;
 	}
 
-	if (blk_read(dev_desc, offset + blk, cnt, addr) < 0) {
+	if (blk_dread(dev_desc, offset + blk, cnt, addr) < 0) {
 		printf("Error reading blocks\n");
 		return 1;
 	}
diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig
index 52ae05b447..0e839dce73 100644
--- a/configs/sandbox_defconfig
+++ b/configs/sandbox_defconfig
@@ -192,3 +192,6 @@ CONFIG_UNIT_TEST=y
 CONFIG_UT_TIME=y
 CONFIG_UT_DM=y
 CONFIG_UT_ENV=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_MTDPARTS_SPREAD=y
+CONFIG_CMD_READ=y
diff --git a/include/command.h b/include/command.h
index 08f04867dd..767cabb3df 100644
--- a/include/command.h
+++ b/include/command.h
@@ -80,11 +80,10 @@ int cmd_process_error(cmd_tbl_t *cmdtp, int err);
  * void function (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
  */
 
-#if defined(CONFIG_CMD_MEMORY)		\
-	|| defined(CONFIG_CMD_I2C)	\
-	|| defined(CONFIG_CMD_ITEST)	\
-	|| defined(CONFIG_CMD_PCI)	\
-	|| defined(CONFIG_CMD_PORTIO)
+#if defined(CONFIG_CMD_MEMORY) || \
+	defined(CONFIG_CMD_I2C) || \
+	defined(CONFIG_CMD_ITEST) || \
+	defined(CONFIG_CMD_PCI)
 #define CMD_DATA_SIZE
 extern int cmd_get_data_size(char* arg, int default_size);
 #endif
diff --git a/include/config_cmd_all.h b/include/config_cmd_all.h
index ea9860cf91..2a59976550 100644
--- a/include/config_cmd_all.h
+++ b/include/config_cmd_all.h
@@ -14,10 +14,8 @@
  */
 
 #define CONFIG_CMD_NAND		/* NAND support			*/
-#define CONFIG_CMD_PORTIO	/* Port I/O			*/
 #define CONFIG_CMD_REGINFO	/* Register dump		*/
 #define CONFIG_CMD_REISER	/* Reiserfs support		*/
-#define CONFIG_CMD_READ		/* Read data from partition	*/
 #define CONFIG_CMD_SANDBOX	/* sb command to access sandbox features */
 #define CONFIG_CMD_SAVES	/* save S record dump		*/
 #define CONFIG_CMD_SDRAM	/* SDRAM DIMM SPD info printout */
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 6662b60754..d3344bfebf 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -296,8 +296,6 @@ CONFIG_CM922T_XA10
 CONFIG_CMDLINE_EDITING
 CONFIG_CMDLINE_PS_SUPPORT
 CONFIG_CMDLINE_TAG
-CONFIG_CMD_PORTIO
-CONFIG_CMD_READ
 CONFIG_CMD_REGINFO
 CONFIG_CMD_REISER
 CONFIG_CMD_SANDBOX
-- 
2.14.0.rc0.284.gd933b75aa4-goog



More information about the U-Boot mailing list