Received: from eggs.gnu.org ([208.118.235.92]:50106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ss1VJ-00063M-Vz for qemu-devel@nongnu.org; Thu, 19 Jul 2012 20:55:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ss1VJ-00010y-0V for qemu-devel@nongnu.org; Thu, 19 Jul 2012 20:55:37 -0400 Received: from mail-vc0-f173.google.com ([209.85.220.173]:47679) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ss1VI-00010u-Sc for qemu-devel@nongnu.org; Thu, 19 Jul 2012 20:55:36 -0400 Received: by vcbfl15 with SMTP id fl15so2562772vcb.4 for ; Thu, 19 Jul 2012 17:55:36 -0700 (PDT) Date: Thu, 19 Jul 2012 20:55:34 -0400 From: Kevin O'Connor Message-ID: <20120720005534.GC24578@morn.localdomain> References: <1342714503-6673-1-git-send-email-kraxel@redhat.com> <1342714503-6673-3-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1342714503-6673-3-git-send-email-kraxel@redhat.com> Subject: Re: [Qemu-devel] [SeaBIOS] [PATCH 2/2] lsi53c895a boot support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: seabios@seabios.org, qemu-devel@nongnu.org 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