Subject: DiskOnModule (DOM)
To: None <tech-kern@NetBSD.org>
From: Ian Zagorskih <ianzag@megasignal.com>
List: tech-kern
Date: 08/25/2003 17:11:31
I'm trying to use DiskOnModule under NetBSD 1.6.1/i386. Configuration is the 
following:

NetBSD 1.6.1-stable/i386

ICOP Vortex86/166MHz/64Mb 
http://www.icop.com.tw/products_detail.asp?ProductID=70

PowerQuest DiskOnModule MDM-64/44-H (MDM 64Mb 44pin horizontal) FDXXX-432LFM 
http://www.pqi.com.tw/eng/download/download-dom.htm

DOM is found by NetBSD and seems to work fine with one exception: it's 
configured to run at PIO mode 0. AFAIK from DOM's datashet this chip supports 
up to PIO mode 2 so data transfer rate should be about ~1.2 Mb/s for both 
read and write. For read even higher. Maximum i can see is about ~70kb/s on 
32Mb FFS partition with default newfs paraeters. Tested with with simple "$dd 
if=/dev/zero of=/tmp/data bs=1m count=32" and ordinary files copying. It 
dosn't matter if i access wd with pciide or ISA wdc.

I'v tried this DOM on mine PC ws with the same result (PIO mode 0). On the 
other hand, FreeBSD 4.8-stable recognizes it and configures to use PIO mode 2 
just fine.

I'v tried to force PIO mode 2 directly with:

wd* at pciide? channel ? drive ? flags 0x000A

...but i cannot boot with this settings (cannot find wd* device so boot 
fails). If more descriptive output is required i can post it.

A question is: does anybody tried DOM with NetBSD and what do i do wrong ? How 
to configure NetBSD to use DOM in proper PIO mode ?

Thank you.

part of kernel config:
---cut---
# PCI bus support
pci*	at mainbus? bus ?
pci*	at ppb? bus ?

pcib*	at pci? dev ? function ?	# PCI-ISA bridges
ppb*	at pci? dev ? function ?	# PCI-PCI bridges

# IDE and related devices
# PCI IDE controllers - see pciide(4) for supported hardware.
# The 0x0001 flag force the driver to use DMA, even if the driver doesn't know
# how to set up DMA modes for this chip. This may work, or may cause
# a machine hang with some controllers.

pciide* at pci? dev ? function ? flags 0x0000

# ISA ST506, ESDI, and IDE controllers
# Use flags 0x01 if you want to try to use 32bits data I/O (the driver will
# fall back to 16bits I/O if 32bits I/O are not functional).
# Some controllers pass the initial 32bit test, but will fail later.
#wdc0	at isa? port 0x1f0 irq 14 flags 0x00
#wdc1	at isa? port 0x170 irq 15 flags 0x00

# IDE drives
# Flags are used only with controllers that support DMA operations
# and mode settings (e.g. some pciide controllers)
# The lowest order four bits (rightmost digit) of the flags define the PIO
# mode to use, the next set of four bits the DMA mode and the third set the
# UltraDMA mode. For each set of four bits, the 3 lower bits define the mode
# to use, and the last bit must be 1 for this setting to be used.
# For DMA and UDMA, 0xf (1111) means 'disable'.
# 0x0fac means 'use PIO mode 4, DMA mode 2, disable UltraDMA'.
# (0xc=1100, 0xa=1010, 0xf=1111)
# 0x0000 means "use whatever the drive claims to support".
#wd*	at wdc? channel ? drive ? flags 0x0000
#wd*	at pciide? channel ? drive ? flags 0x000A	# PIO mode 2 Note: this fails !

wd*	at pciide? channel ? drive ? flags 0x0000

---cut---

dmesg output:
---cut---
NetBSD 1.6.1 (Vortex86) #176: Mon Aug 25 16:32:46 UTC 2003
    ianzag@ianzag:/usr/src/sys/arch/i386/compile/Vortex86
cpu0: SiS SiS SiS  (586-class), 166.62 MHz
cpu0: features 800111<FPU,TSC,CX8>
cpu0: features 800111<MMX>
total memory = 119 MB
avail memory = 109 MB
using 1556 buffers containing 6224 KB of memory
BIOS32 rev. 0 found at 0xfdb10
mainbus0 (root)
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
vendor 0x1039 product 0x0550 (host bridge, revision 0x01) at pci0 dev 0 
function 0 not configured

pciide0 at pci0 dev 0 function 1: Silicon Integrated System 5597/5598 IDE 
controller (rev. 0xd0)
pciide0: bus-master DMA support present
pciide0: primary channel wired to compatibility mode
wdc probe testwd0 at pciide0 channel 0 drive 0: <PQI IDE DiskOnModule>
wd0: drive supports 1-sector PIO transfers, LBA addressing
wd0: 64000 KB, 500 cyl, 8 head, 32 sec, 512 bytes/sect x 128000 sectors
wd0: 32-bit data port
pciide0: primary channel interrupting at irq 14
wd0(pciide0:0:0): using PIO mode 0

pciide0: secondary channel wired to compatibility mode
pciide0: secondary channel ignored (disabled)
pcib0 at pci0 dev 1 function 0
pcib0: vendor 0x1039 product 0x0008 (rev. 0x00)
ohci0 at pci0 dev 1 function 2: vendor 0x1039 product 0x7001 (rev. 0x07)
ohci0: interrupting at irq 10
ohci0: OHCI version 1.0, legacy support
usb0 at ohci0: USB revision 1.0
uhub0 at usb0
uhub0: vendor 0x1039 OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 3 ports with 3 removable, self powered
ppb0 at pci0 dev 2 function 0: vendor 0x1039 product 0x0001 (rev. 0x00)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
vga0 at pci1 dev 0 function 0: vendor 0x1039 product 0x5315 (rev. 0x00)
wsdisplay0 at vga0 (kbdmux ignored): console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
rtk0 at pci0 dev 13 function 0: RealTek 8139 10/100BaseTX
rtk0: interrupting at irq 11
rtk0: Ethernet address 44:4d:50:00:04:26
OUI 0x000000 model 0x0000 rev 0 at rtk0 phy 7 not configured
isa0 at pcib0
dsp0 at isa0 port 0x250-0x25f irq 5: id=0x252 sn=0x1 cap=0x7
dspm0 at dsp0
mcon0 at dspm0
pckbc0 at isa0 port 0x60-0x64
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0 (mux ignored): console keyboard, using wsdisplay0
npx0 at isa0 port 0xf0-0xff: using exception 16
biomask f7dd netmask ffdd ttymask ffff
boot device: wd0
root on wd0a dumps on wd0b
---cut---

-- 
JSC Novosibirsk Geophysical Equipment Development Center.
WEB	http://www.megasignal.com