qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin O'Connor <kevin@koconnor.net>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: seabios@seabios.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [SeaBIOS] [PATCH 2/2] lsi53c895a boot support
Date: Thu, 19 Jul 2012 20:55:34 -0400	[thread overview]
Message-ID: <20120720005534.GC24578@morn.localdomain> (raw)
In-Reply-To: <1342714503-6673-3-git-send-email-kraxel@redhat.com>

On Thu, Jul 19, 2012 at 06:15:03PM +0200, Gerd Hoffmann wrote:
> This patch adds support for the lsi53c895a scsi host adapter,
> allowing seabios to boot from scsi disks and cdroms connected
> to the lsi scsi hba emulated by qemu.
> 
> This driver was written by looking at the expectations of qemu's
> lsi emulation.  I have no idea idea how close this is to work on
> real hardware, and I somehow doubt anyone cares given the age of
> physical lsi scsi cards.  It depends on !COREBOOT for that reason.

Thanks.  Looks good to me.  I definitely agree on marking it as
!COREBOOT.  Some minor comments below.

[...]
> --- a/src/Kconfig
> +++ b/src/Kconfig
> @@ -119,6 +119,12 @@ menu "Hardware support"
>          default y
>          help
>              Support boot from virtio-scsi storage.
> +    config LSI_SCSI
> +        depends on DRIVES && !COREBOOT
> +        bool "lsi53c895a scsi controllers"
> +        default y
> +        help
> +            Support boot from lsi53c895a scsi storage.

It's probably worthwhile to point out in the help that this is for
QEMU emulation only.

[...]
> +static int
> +lsi_scsi_cmd(struct lsi_lun_s *llun, struct disk_op_s *op,
> +             void *cdbcmd, u16 target, u16 lun, u16 blocksize)
> +{
> +    u32 iobase = GET_GLOBAL(llun->iobase);
> +    u32 dma = ((cdb_is_read(cdbcmd, blocksize) ? 0x01000000 : 0x00000000) |
> +               (op->count * blocksize));
> +    u8 msgout[] = {
> +        0x80 | lun,                 // select lun
> +        0x08,
> +    };
> +    u8 status = 0xff;
> +    u8 msgin_tmp[2];
> +    u8 msgin = 0xff;
> +
> +    /* FIXME: probably not the best idea to have this on the stack ... */
> +    u32 script[] = {

Several places in the code DMA to the stack already (usb-ehci,
usb-uhci, ata).

[...]
> --- /dev/null
> +++ b/src/lsi-scsi.h
> @@ -0,0 +1,2 @@
> +void lsi_scsi_setup(void);
> +int lsi_scsi_cmd_data(struct disk_op_s *op, void *cdbcmd, u16 blocksize);

Should have a header guard.

-Kevin

  reply	other threads:[~2012-07-20  0:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-19 16:15 [Qemu-devel] [PATCH 0/2] scsi boot Gerd Hoffmann
2012-07-19 16:15 ` [Qemu-devel] [PATCH 1/2] usb attached scsi boot support Gerd Hoffmann
2012-07-20  0:51   ` [Qemu-devel] [SeaBIOS] " Kevin O'Connor
2012-07-19 16:15 ` [Qemu-devel] [PATCH 2/2] lsi53c895a " Gerd Hoffmann
2012-07-20  0:55   ` Kevin O'Connor [this message]
2012-07-20  7:33     ` [Qemu-devel] [SeaBIOS] " Gerd Hoffmann
2012-07-20 12:47       ` Kevin O'Connor
2012-07-20 13:39         ` Gerd Hoffmann

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=20120720005534.GC24578@morn.localdomain \
    --to=kevin@koconnor.net \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=seabios@seabios.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).