All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Peter <d.peter@mpl.ch>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Fix bugs in cmd_ide.c and cmd_scsi.c
Date: Thu, 29 Mar 2007 10:27:11 +0200	[thread overview]
Message-ID: <OF61C9A6C9.C4DFEC4B-ONC12572AD.002E7D48@mpl.loc> (raw)

Hello,

At 11:23 28.03.2007, you wrote:
>Hi all,
> >
>...<snip>...
> > -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 */
>
>it seems to me, that the ide_write function will also need this fix.

yes, this one has slipped my attention, thank you for pointing this out.
Below the modified patch.

With best regards,

Denis

Fix bugs in cmd_ide.c and scsi_cmd.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.

Signed-off-by: Denis Peter <d.peter@mpl.ch>

  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..ba984c3 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)) {
+               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 */
@@ -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;
         }

             reply	other threads:[~2007-03-29  8:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-29  8:27 Denis Peter [this message]
2007-03-29 10:33 ` [U-Boot-Users] [PATCH] Fix bugs in cmd_ide.c and cmd_scsi.c Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2007-03-29 11:59 Denis Peter
2007-03-29 13:23 ` Wolfgang Denk
2007-04-02 11:43   ` Denis Peter
2007-03-27 14:23 Denis Peter
2007-03-28  9:23 ` Michael Tasche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OF61C9A6C9.C4DFEC4B-ONC12572AD.002E7D48@mpl.loc \
    --to=d.peter@mpl.ch \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.