[U-Boot-Users] [PATCH] Fix bugs in cmd_ide.c and cmd_scsi.c

Denis Peter d.peter at mpl.ch
Mon Apr 2 13:43:07 CEST 2007


On Thursday 29 March 2007 15:23, you wrote:
> In message <OF29AD783D.748F78C9-ONC12572AD.0041E8F8 at mpl.loc> you wrote:
>
> Doesn't work for me either:
> ...<snip>...
I'm sorry again. Changed my environment and tested the patch twice.

With best regards,

Denis

Fix bugs in cmd_ide.c and cmd_scsi.c

These bugs prevented to read/write more than one block from/to IDE drives,
and didn't allow to use "diskboot" and "scsiboot" to boot from another
device than device 0.

 common/cmd_ide.c  |    9 ++++++---
 common/cmd_scsi.c |    2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index 2e185cc..3bce1eb 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -423,7 +423,8 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 		}
 		part = simple_strtoul(++ep, NULL, 16);
 	}
-	if (get_partition_info (ide_dev_desc, part, &info)) {
+	if (get_partition_info (&ide_dev_desc[dev], part, &info)) {
+		puts ("error reading partinfo\n");
 		SHOW_BOOT_PROGRESS (-1);
 		return 1;
 	}
@@ -1233,8 +1234,9 @@ static void ide_ident (block_dev_desc_t *dev_desc)
 
 /* ------------------------------------------------------------------------- */
 
-ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, void *buffer)
+ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, void *vbuffer)
 {
+	ulong *buffer = (ulong *) vbuffer;
 	ulong n = 0;
 	unsigned char c;
 	unsigned char pwrsave=0; /* power save */
@@ -1353,8 +1355,9 @@ IDE_READ_E:
 /* ------------------------------------------------------------------------- */
 
 
-ulong ide_write (int device, lbaint_t blknr, ulong blkcnt, void *buffer)
+ulong ide_write (int device, lbaint_t blknr, ulong blkcnt, void *vbuffer)
 {
+	ulong *buffer = (ulong *) vbuffer;
 	ulong n = 0;
 	unsigned char c;
 #ifdef CONFIG_LBA48
diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c
index da36ed9..00b84fa 100644
--- a/common/cmd_scsi.c
+++ b/common/cmd_scsi.c
@@ -248,7 +248,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 		}
 		part = simple_strtoul(++ep, NULL, 16);
 	}
-	if (get_partition_info (scsi_dev_desc, part, &info)) {
+	if (get_partition_info (&scsi_dev_desc[dev], part, &info)) {
 		printf("error reading partinfo\n");
 		return 1;
 	}




More information about the U-Boot mailing list