Subject: Re: USB support in Qube2?
To: None <kiyohara@kk.iij4u.or.jp>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: port-cobalt
Date: 01/11/2004 19:28:32
In article <20040110.170738.74736620.kiyohara@kk.iij4u.or.jp>
kiyohara@kk.iij4u.or.jp wrote:

> I think need PCI_NETBSD_CONFIGURE. I wrote PCI_NETBSD_CONFIGURE patch.

Looks good, but siop0 (53c860) on my RaQ2 doesn't work with your patch.
It seems your patch doesn't map memory space for each PCI devices
correctly (though RaQ2 BIOS doesn't setup them either).

How do you determine these regions for I/O and memory spaces passed
to pci_configure_bus(9)?

+ #ifdef PCI_NETBSD_CONFIGURE
+	ioext = extent_create(
+	    "pciio", 0x10000000, 0x11ffffff, M_DEVBUF, NULL, 0, EX_NOWAIT);
+	memext = extent_create(
+	    "pcimem", 0x12000000, 0x13ffffff, M_DEVBUF, NULL, 0, EX_NOWAIT);
+	pci_configure_bus(0, ioext, memext, NULL, 0, 32);

---
Izumi Tsutsui
tsutsui@ceres.dti.ne.jp

---
Starting at 0x80001000

Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 1.6ZG (COLT) #62: Sun Jan 11 16:09:16 JST 2004
	tsutsui@mirage:/usr/src/sys/arch/cobalt/compile/COLT
256 MB memory, 247 MB freemainbus0 (root)
 :
siop0 at pci0 dev 8 function 0: PCI configuration registers:
  Common header:
    0x00: 0x00061000 0x02000157 0x01000002 0x0000ff08

    Vendor Name: Symbios Logic (0x1000)
    Device Name: 53c860 (0x0006)
    Command register: 0x0157
      I/O space accesses: on
      Memory space accesses: on
      Bus mastering: on
      Special cycles: off
      MWI transactions: on
      Palette snooping: off
      Parity error checking: on
      Address/data stepping: off
      System error (SERR): on
      Fast back-to-back transactions: off
    Status register: 0x0200
      Capability List support: off
      66 MHz capable: off
      User Definable Features (UDF) support: off
      Fast back-to-back capable: off
      Data parity error detected: off
      DEVSEL timing: medium (0x1)
      Slave signaled Target Abort: off
      Master received Target Abort: off
      Master received Master Abort: off
      Asserted System Error (SERR): off
      Parity error detected: off
    Class Name: mass storage (0x01)
    Subclass Name: SCSI (0x00)
    Interface: 0x00
    Revision ID: 0x02
    BIST: 0x00
    Header Type: 0x00 (0x00)
    Latency Timer: 0xff
    Cache Line Size: 0x08

  Type 0 ("normal" device) header:
    0x10: 0x10000001 0x12000800 0x00000000 0x00000000
    0x20: 0x00000000 0x00000000 0x00000000 0x00000000
    0x30: 0x00000000 0x00000000 0x00000000 0x40080104

    Base address register at 0x10
      type: 32-bit i/o
      base: 0x10000000, size: 0x00000100
    Base address register at 0x14
      type: 32-bit nonprefetchable memory
      base: 0x12000800, size: 0x00000100
    Base address register at 0x18
      not implemented(?)
    Base address register at 0x1c
      not implemented(?)
    Base address register at 0x20
      not implemented(?)
    Base address register at 0x24
      not implemented(?)
    Cardbus CIS Pointer: 0x00000000
    Subsystem vendor ID: 0x0000
    Subsystem ID: 0x0000
    Expansion ROM Base Address: 0x00000000
    Reserved @ 0x34: 0x00000000
    Reserved @ 0x38: 0x00000000
    Maximum Latency: 0x40
    Minimum Grant: 0x08
    Interrupt pin: 0x01 (pin A)
    Interrupt line: 0x04

  Device-dependent header:
    0x40: 0x00000000 0x00000000 0x00000000 0x00000000
    0x50: 0x00000000 0x00000000 0x00000000 0x00000000
    0x60: 0x00000000 0x00000000 0x00000000 0x00000000
    0x70: 0x00000000 0x00000000 0x00000000 0x00000000
    0x80: 0x000000c0 0x1f000000 0x00000000 0x02000080
    0x90: 0xffffffff 0xffffff00 0x2031f000 0x00a0a8f0
    0xa0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xb0: 0xfffffe38 0x20000000 0x00000000 0x00fffe38
    0xc0: 0x00000000 0x0f500000 0x0f000000 0x00000007
    0xd0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xe0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xf0: 0x00000000 0x00000000 0x00000000 0x00000000

    Don't know how to pretty-print device-dependent header.

Symbios Logic 53c860 (SCSI mass storage, revision 0x02) at ? dev 8 function 0 (intrswiz 0, intrpin 0x1, i/o on, mem on, no quirks): Symbios Logic 53c860 (ultra scsi)
siop0: interrupting at irq 4
scsibus0 at siop0: 8 targets, 8 luns per target
 :
tlp1: interrupting at level 2
tlp1: Ethernet address 00:10:e0:00:5e:97
lxtphy1 at tlp1 phy 1: LXT970 10/100 media interface, rev. 3
lxtphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
scsibus0: waiting 2 seconds for devices to settle...
wd0 at atabus0 drive 0INTRF
panic: siop_intr: I shouldn't be there !
Stopped at      netbsd:cpu_Debugger+0x4:        jr      ra
                bdslot: nop
db>