Skip to contentSkip to conversation

Fix bugs in cmd_ide.c and cmd_scsi.c

PATCH New Denis Peter 2 participants 2 messages Mar 27, 2007 – Mar 28, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix bugs in cmd_ide.c and cmd_scsi.c

Fix bugs in diskboot, scsiboot and ide_read

Fix bug introduced by "Fix get_partition_info() parameter error in all other calls" from 2005-03-04 in cmd_ide.c and cmd_scsi.c, which prevented to use diskboot or scsiboot form another device than 0.
Fix bug introduced by "Use "void*" not "unsigned long *" for block dev read_write pointers" introduced on 2007-02-20, which prevented to read more than one block form IDE.

---
commit 4816c887ff56b0cc16b142f6fda921683989300e
tree 10339e77b60290529bd0da693af86eca58cac083
parent 44ba464b99001f8bd1c456a1e9d59726252f707a
author Denis Peter <[email protected]> Tue, 27 Mar 2007 16:09:52 +0000 committer Denis Peter <[email protected]> Tue, 27 Mar 2007 16:09:52 +0000

 common/cmd_ide.c  |    6 ++++--
 common/cmd_scsi.c |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)
common/cmd_ide.c +4 -2
index 2e185cc..5a1cb45 100644
@@ -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)) {
+		printf ("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 */
common/cmd_scsi.c +1 -1
index da36ed9..00b84fa 100644
@@ -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;
 	}
#1 lore raw

PATCH 1/1 Fix bugs in cmd_ide.c and cmd_scsi.c

Hi all,

Quoted 47 lines · Denis Peter

Fix bugs in diskboot, scsiboot and ide_read

Fix bug introduced by "Fix get_partition_info() parameter error in all other calls" from 2005-03-04 in cmd_ide.c and cmd_scsi.c, which prevented to use diskboot or scsiboot form another device than 0.
Fix bug introduced by "Use "void*" not "unsigned long *" for block dev read_write pointers" introduced on 2007-02-20, which prevented to read more than one block form IDE.

---
commit 4816c887ff56b0cc16b142f6fda921683989300e
tree 10339e77b60290529bd0da693af86eca58cac083
parent 44ba464b99001f8bd1c456a1e9d59726252f707a
author Denis Peter <[email protected]> Tue, 27 Mar 2007 16:09:52 +0000 committer Denis Peter <[email protected]> Tue, 27 Mar 2007 16:09:52 +0000

 common/cmd_ide.c  |    6 ++++--
 common/cmd_scsi.c |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)
common/cmd_ide.c +4 -2
index 2e185cc..5a1cb45 100644
@@ -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)) {
+		printf ("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;
Quoted 1 line

unsigned char pwrsave=0; /* power save */

it seems to me, that the ide_write function will also need this fix.

Quoted 16 lines
common/cmd_scsi.c +1 -2
index da36ed9..00b84fa 100644
@@ -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;
 	}
 
 
-------------------------------------------------------------------------
Quoted 9 lines

Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Regards
Michael

Signature · 9 lines
                            _/_/_/_/   Michael Tasche
                           _/_/_/_/   Dipl.-Ing.
                          _/_/_/_/

      _/_/_/   _/_/_/_/_/_/_/      esd electronic system design gmbh
    _/   _/  _/             _/    Vahrenwalder Str. 207
   _/   _/    _/_/_/   _/   _/   D-30165 Hannover
   _/             _/  _/   _/   Phone: +49-511-37298-0
    _/_/_/_/_/_/_/   _/_/_/    Fax:   +49-511-37298-68