From 842404ea0730a7b48355794bdca6b787d4a1536a Mon Sep 17 00:00:00 2001 From: Sergei Poselenov Date: Mon, 9 Aug 2010 16:01:42 +0400 Subject: Fixed clobbered output of the "help usb" command The "usb help" doesn't format the output correctly: => help usb usb - USB sub-system Usage: usb reset - reset (rescan) USB controller usb stop [f] - stop USB [f]=force stop usb tree - show USB device tree usb info [dev] - show available USB devices usb storage - show details of USB storage devices usb dev [dev] - show or set current USB storage device usb part [dev] - print partition table of one or all USB storage devices usb read addr blk# cnt - read `cnt' blocks starting at block `blk#' to memory address `addr'usb write addr blk# cnt - write `cnt' blocks starting at block `blk#' from memory address `addr' => With fix below applied, the output is correct: => help usb usb - USB sub-system Usage: usb reset - reset (rescan) USB controller usb stop [f] - stop USB [f]=force stop usb tree - show USB device tree usb info [dev] - show available USB devices usb storage - show details of USB storage devices usb dev [dev] - show or set current USB storage device usb part [dev] - print partition table of one or all USB storage devices usb read addr blk# cnt - read `cnt' blocks starting at block `blk#' to memory address `addr' usb write addr blk# cnt - write `cnt' blocks starting at block `blk#' from memory address `addr' => Signed-off-by: Sergei Poselenov --- common/cmd_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/cmd_usb.c b/common/cmd_usb.c index dc63f24..226ea0d 100644 --- a/common/cmd_usb.c +++ b/common/cmd_usb.c @@ -712,7 +712,7 @@ U_BOOT_CMD( "usb part [dev] - print partition table of one or all USB storage" " devices\n" "usb read addr blk# cnt - read `cnt' blocks starting at block `blk#'\n" - " to memory address `addr'" + " to memory address `addr'\n" "usb write addr blk# cnt - write `cnt' blocks starting at block `blk#'\n" " from memory address `addr'" ); -- cgit v1.1 From 962ad59e25640e586e2bceabf67a628a27f8f508 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 11 Aug 2010 23:42:26 -0400 Subject: env_nand: return error when no device is found Currently, if there is an error probing the NAND chip and the env is based in NAND, the readenv() function will use a NULL function pointer and thus jump to address 0. Here I just check for a non-zero value of blocksize as that shouldn't be zero when a valid device is found, but perhaps there is a better way for someone familiar with the NAND internals to suggest. Signed-off-by: Mike Frysinger Tested-by: Ben Gardiner --- common/env_nand.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common') diff --git a/common/env_nand.c b/common/env_nand.c index a5e1038..d38bcca 100644 --- a/common/env_nand.c +++ b/common/env_nand.c @@ -266,6 +266,8 @@ int readenv (size_t offset, u_char * buf) u_char *char_ptr; blocksize = nand_info[0].erasesize; + if (!blocksize) + return 1; len = min(blocksize, CONFIG_ENV_SIZE); while (amount_loaded < CONFIG_ENV_SIZE && offset < end) { -- cgit v1.1