OpenBSD Journal

sili(4) and atascsi on sparc64

Contributed by dlg on from the sata-bling dept.

Chris Pascoe got sili(4) to the same level of functionality as ahci(4) over the weekend, so I enabled the driver in GENERIC on both i386 and amd64. Unfortunately ahci(4) is only available as part of motherboard chipsets, or as PCIe controllers from JMicron (who donated plenty of cards for us to work on). However, sili(4) is available as a normal PCI/PCI-X card, which means we can plug it into spare sparc64 to test how the atascsi code runs on something other than i386 and amd64.

So this morning I plugged a sili(4) controller into an unused Enterprise 250 we have at work, and fired it up. It almost worked :)

I found two bugs, one which I was expecting in atascsi, and another in the sili driver. The first in atascsi was a lack of byteswapping when reading words out of the ata_identify structure read from a disk, which was extremely simple to fix. I should have written it properly in the first place, but at the time we were rushing to get enough infrastructure in place so we could develop ahci(4). The second bug in sili was a workaround for reading errors off the hardware on sparc64.

So after those fixes we ended up with this:

console is /pci@1f,4000/ebus@1/se@14,200000:ssp
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
Copyright (c) 1995-2007 OpenBSD. All rights reserved. http://www.OpenBSD.org

OpenBSD 4.1-current (GENERIC) #3: Wed Apr 11 09:32:54 EST 2007
    dlg@sapote.itee.uq.edu.au:/usr/src/sys/arch/sparc64/compile/GENERIC
total memory = 805306368
avail memory = 720412672
using 17126 buffers containing 40263680 bytes of memory
bootpath: /pci@1f,4000/scsi@3,0/disk@0,0
mainbus0 (root): Sun (TM) Enterprise 250 (2 X UltraSPARC-II 400MHz)
cpu0 at mainbus0: SUNW,UltraSPARC-II (rev 10.0) @ 400 MHz, version 0 FPU
cpu0: physical 16K instruction (32 b/l), 16K data (32 b/l), 2048K external (64 b/l)
psycho0 at mainbus0 addr 0xfffbc000: SUNW,psycho, impl 0, version 4, ign 7c0
psycho0: bus range 0-0, PCI bus 0
psycho0: dvma map fe000000-ffffffff, iotdb 3d9e000-3da6000, STC0 enabled
pci0 at psycho0
ebus0 at pci0 dev 1 function 0 "Sun PCIO EBus2" rev 0x01
auxio0 at ebus0 addr 726000-726003, 728000-728003, 72a000-72a003, 72c000-72c003, 72f000-72f003
auxio0 at ebus0 addr 726000-726003, 728000-728003, 72a000-72a003, 72c000-72c003, 72f000-72f003
power0 at ebus0 addr 724000-724003
"SUNW,pll" at ebus0 addr 504000-504002 not configured
uperf0 at ebus0 addr 500000-500007: model SUNW,sc-mp (0/3) ports 4
"se" at ebus0 addr 400000-40007f ipl 43 not configured
"se" at ebus0 addr 200000-20007f ipl 35 not configured
comkbd0 at ebus0 addr 3083f8-3083ff ipl 41: no keyboard
com0 at ebus0 addr 3062f8-3062ff ipl 42: mouse: ns16550a, 16 byte fifo
lpt0 at ebus0 addr 3043bc-3043cb, 300398-300399, 700000-70000f ipl 34: polled
"fdthree" at ebus0 addr 3023f0-3023f7, 706000-70600f, 720000-720003 ipl 39 not configured
clock1 at ebus0 addr 0-1fff: mk48t59
"flashprom" at ebus0 addr 0-fffff, 0-fffff not configured
"SUNW,envctrltwo" at ebus0 addr 600000-600003 ipl 40 ipl 37 not configured
hme0 at pci0 dev 1 function 1 "Sun HME" rev 0x01: ivec 0x7e1, address 08:00:20:d2:54:9d
nsphy0 at hme0 phy 1: DP83840 10/100 PHY, rev. 1
siop0 at pci0 dev 3 function 0 "Symbios Logic 53c875" rev 0x14: ivec 0x7e0, using 4K of on-board RAM
scsibus0 at siop0: 16 targets
sd0 at scsibus0 targ 0 lun 0: <QUANTUM, ATLAS V 9 SCA, 0201> SCSI3 0/direct fixed
sd0: 8683MB, 20907 cyl, 2 head, 425 sec, 512 bytes/sec, 17783249 sec total
cd0 at scsibus0 targ 6 lun 0: <TOSHIBA, XM6201TASUN32XCD, 1103> SCSI2 5/cdrom removable
siop1 at pci0 dev 3 function 1 "Symbios Logic 53c875" rev 0x14: ivec 0x7e6, using 4K of on-board RAM
scsibus1 at siop1: 16 targets
psycho1 at mainbus0 addr 0xfffce000: SUNW,psycho, impl 0, version 4, ign 7c0
psycho1: bus range 128-128, PCI bus 128
psycho1: dvma map fe000000-ffffffff, iotdb 3d9e000-3da6000, STC0 enabled, STC1 enabled
pci1 at psycho1
sili0 at pci1 dev 1 function 0 "CMD Technology SiI3124 SATA" rev 0x01: ivec 0x7c0
scsibus2 at sili0: 4 targets
sd1 at scsibus2 targ 2 lun 0: <ATA, WDC WD2500KS-00M, 02.0> SCSI2 0/direct fixed
sd1: 238475MB, 238475 cyl, 64 head, 32 sec, 512 bytes/sec, 488397168 sec total
timer0 at mainbus0 addr 0xfffa7c00 ivec 0x7ec, 0x7ed
mc at mainbus0 not configured
pcons0 at mainbus0
root on sd0a
siop0: target 0 now using tagged 16 bit 20.0 MHz 16 REQ/ACK offset xfers
rootdev=0x700 rrootdev=0x1100 rawdev=0x1102

So yeah, sili(4) and atascsi are working fine. I'll enable the driver on sparc64 soon, and macppc as soon as I can test it. If anyone else gets hold of a controller and can try it in another arch with pci (sgi or hppa or something like that), let me know and I'll get the driver enabled.

Thanks must go to Jonathon Gray (jsg@) for getting the hardware to me to hack on. A huge thanks to Chris Pascoe who ended up doing more than half the code in this driver. He got interrupts, NCQ, and error recovery all written in about a day. He also did it properly, so it (almost) just worked on sparc64.

Chris and I are keen to get hold of some port multipliers so we can get those working in OpenBSD too. I'd also like a PCI Express mpi(4) (as seen on the want page) so I can boot and root a macppc off it, which in turn will let me work on its onboard ServerWorks SATA controller.

(Comments are closed)


Comments
  1. By Cobalt (70.162.93.223) on

    This wd -> sd transition is for real in 4.2, then? Or is it going to just be ahci/sili?

    I don't mind (it's an easy adjustment), I'm just curious.

    Comments
    1. By mk (130.225.194.192) on

      > This wd -> sd transition is for real in 4.2, then? Or is it going to just be ahci/sili?
      >
      > I don't mind (it's an easy adjustment), I'm just curious.

      wd doesn't go away but stuff that gets converted from pciide to atascsi will switch to sd. Currently, that's only sili and ahci.

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]