On Thu, 2011-09-15 at 19:24:47 +0200, Thomas Schwinge wrote:
> On Thu, 15 Sep 2011 18:48:17 +0200, "Thomas Schmitt" <scdbac...@gmx.net> 
> wrote:
> > > For example, you could boot a GNU/Linux system, and figure out which SCSI
> > > devices exactly are provided.
> > 
> > I did. RIPLinux-9.3-non-X.iso as emulated IDE CD-ROM boots with
> > 64 bit kernel. An additionally emulated SCSI CD-ROM
> >   -drive file=/dvdbuffer/netinst.iso,if=scsi,bus=4,unit=0,media=cdrom
> > appears as /dev/sr0 and is readable.
> > The emulated IDE CD-ROM appears as /dev/hdc.
> 
> I was thinking about dmesg messages for SCSI; which device driver(s) does
> the Linux kernel use (dmesg), which PCI interface card is emulated
> (lspci), how's the emulated hardware getting configured by the Linux
> kernel, etc.  Then we have to see whether an equivalent device driver
> exists for GNU Mach (or whether it can easily be integrated).

Heh, I went reverse, checked which SCSI host controllers qemu was
providing that could be used from GNU Mach. It appears LSI 53c895A
is the promising one. We already have a driver for that family of
chips just not that specific one. I've made it recognize it and set
the PCI command bit, but it issues wrong I/O operations on the
controller, so something else is bogus. I'm not sure I'll have time
to dig further, so anyone feel free to take it from here.

Preliminary patch attached.

regards,
guillem
commit 5a7ede120625710f9198a19010b2a81421208a75
Author: Guillem Jover <guil...@hadrons.org>
Date:   Thu Sep 15 20:34:02 2011 +0200

    Add support for LSI 53c895A SCSI controllers
    
    * linux/src/drivers/scsi/ncr53c8xx.c
    * linux/src/drivers/scsi/ncr53c8xx.h
    * linux/src/include/linux/pci.h

diff --git a/linux/src/drivers/scsi/ncr53c8xx.c b/linux/src/drivers/scsi/ncr53c8xx.c
index 1be3d9f..61d1450 100644
--- a/linux/src/drivers/scsi/ncr53c8xx.c
+++ b/linux/src/drivers/scsi/ncr53c8xx.c
@@ -9394,6 +9394,12 @@ static int ncr53c8xx_pci_init(Scsi_Host_Template *tpnt,
 		base = (base & 0x00FFFFFF) | 0x01000000;
 		pcibios_write_config_dword(bus, device_fn, PCI_BASE_ADDRESS_1, base);
 	}
+#else
+	if ((command & PCI_COMMAND_MASTER) != PCI_COMMAND_MASTER) {
+		printk("ncr53c8xx : setting PCI master command bit\n");
+		command |= PCI_COMMAND_MASTER;
+		pcibios_write_config_word(bus, device_fn, PCI_COMMAND, command);
+	}
 #endif
 
 	/*
diff --git a/linux/src/drivers/scsi/ncr53c8xx.h b/linux/src/drivers/scsi/ncr53c8xx.h
index cc009ca..2fa1e28 100644
--- a/linux/src/drivers/scsi/ncr53c8xx.h
+++ b/linux/src/drivers/scsi/ncr53c8xx.h
@@ -504,6 +504,9 @@ typedef struct {
  {PCI_DEVICE_ID_NCR_53C895, 0xff, "895",  7, 31, 7,			\
  FE_WIDE|FE_ULTRA2|FE_QUAD|FE_CACHE_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM}\
  ,									\
+ {PCI_DEVICE_ID_LSI_53C895A, 0xff, "895a",  7, 31, 7,			\
+ FE_WIDE|FE_ULTRA2|FE_QUAD|FE_CACHE_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM}\
+ ,									\
  {PCI_DEVICE_ID_NCR_53C896, 0xff, "896",  7, 31, 7,			\
  FE_WIDE|FE_ULTRA2|FE_QUAD|FE_CACHE_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM}\
 }
@@ -522,6 +525,7 @@ typedef struct {
 	PCI_DEVICE_ID_NCR_53C875J,	\
 	PCI_DEVICE_ID_NCR_53C885,	\
 	PCI_DEVICE_ID_NCR_53C895,	\
+	PCI_DEVICE_ID_LSI_53C895A,	\
 	PCI_DEVICE_ID_NCR_53C896	\
 }
 
diff --git a/linux/src/include/linux/pci.h b/linux/src/include/linux/pci.h
index 3508979..4e86be8 100644
--- a/linux/src/include/linux/pci.h
+++ b/linux/src/include/linux/pci.h
@@ -243,6 +243,7 @@
 #define PCI_DEVICE_ID_NCR_53C895	0x000c
 #define PCI_DEVICE_ID_NCR_53C885	0x000d
 #define PCI_DEVICE_ID_NCR_53C875	0x000f
+#define PCI_DEVICE_ID_LSI_53C895A	0x0012
 #define PCI_DEVICE_ID_NCR_53C875J	0x008f
 
 #define PCI_VENDOR_ID_ATI		0x1002

Reply via email to