Browse Source

Kconfig: Convert CMD_READ to Kconfig

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@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Simon Glass 7 years ago
parent
commit
b75dfd2d46
6 changed files with 9 additions and 4 deletions
  1. 0 1
      README
  2. 5 0
      cmd/Kconfig
  3. 1 1
      cmd/read.c
  4. 3 0
      configs/sandbox_defconfig
  5. 0 1
      include/config_cmd_all.h
  6. 0 1
      scripts/config_whitelist.txt

+ 0 - 1
README

@@ -814,7 +814,6 @@ The following options need to be configured:
 		CONFIG_CMD_NFS		  NFS support
 		CONFIG_CMD_NFS		  NFS support
 		CONFIG_CMD_PING		* send ICMP ECHO_REQUEST to network
 		CONFIG_CMD_PING		* send ICMP ECHO_REQUEST to network
 					  host
 					  host
-		CONFIG_CMD_READ		* Read raw data from partition
 		CONFIG_CMD_REGINFO	* Register dump
 		CONFIG_CMD_REGINFO	* Register dump
 		CONFIG_CMD_RUN		  run command in env variable
 		CONFIG_CMD_RUN		  run command in env variable
 		CONFIG_CMD_SANDBOX	* sb command to access sandbox features
 		CONFIG_CMD_SANDBOX	* sb command to access sandbox features

+ 5 - 0
cmd/Kconfig

@@ -749,6 +749,11 @@ config CMD_PCMCIA
 	  about 1990. These devices are typically removable memory or network
 	  about 1990. These devices are typically removable memory or network
 	  cards using a standard 68-pin connector.
 	  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.
+
 config CMD_REMOTEPROC
 config CMD_REMOTEPROC
 	bool "remoteproc"
 	bool "remoteproc"
 	depends on REMOTEPROC
 	depends on REMOTEPROC

+ 1 - 1
cmd/read.c

@@ -66,7 +66,7 @@ int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		return 1;
 		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");
 		printf("Error reading blocks\n");
 		return 1;
 		return 1;
 	}
 	}

+ 3 - 0
configs/sandbox_defconfig

@@ -193,3 +193,6 @@ CONFIG_UNIT_TEST=y
 CONFIG_UT_TIME=y
 CONFIG_UT_TIME=y
 CONFIG_UT_DM=y
 CONFIG_UT_DM=y
 CONFIG_UT_ENV=y
 CONFIG_UT_ENV=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_MTDPARTS_SPREAD=y
+CONFIG_CMD_READ=y

+ 0 - 1
include/config_cmd_all.h

@@ -15,7 +15,6 @@
 
 
 #define CONFIG_CMD_REGINFO	/* Register dump		*/
 #define CONFIG_CMD_REGINFO	/* Register dump		*/
 #define CONFIG_CMD_REISER	/* Reiserfs support		*/
 #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_SANDBOX	/* sb command to access sandbox features */
 #define CONFIG_CMD_SAVES	/* save S record dump		*/
 #define CONFIG_CMD_SAVES	/* save S record dump		*/
 #define CONFIG_CMD_SDRAM	/* SDRAM DIMM SPD info printout */
 #define CONFIG_CMD_SDRAM	/* SDRAM DIMM SPD info printout */

+ 0 - 1
scripts/config_whitelist.txt

@@ -293,7 +293,6 @@ CONFIG_CM922T_XA10
 CONFIG_CMDLINE_EDITING
 CONFIG_CMDLINE_EDITING
 CONFIG_CMDLINE_PS_SUPPORT
 CONFIG_CMDLINE_PS_SUPPORT
 CONFIG_CMDLINE_TAG
 CONFIG_CMDLINE_TAG
-CONFIG_CMD_READ
 CONFIG_CMD_REGINFO
 CONFIG_CMD_REGINFO
 CONFIG_CMD_REISER
 CONFIG_CMD_REISER
 CONFIG_CMD_SANDBOX
 CONFIG_CMD_SANDBOX