Subject: Re: Compact Flash fixes (change request in PR#24633)
To: None <tech-kern@netbsd.org>
From: Ian Zagorskih <ianzag@megasignal.com>
List: tech-kern
Date: 07/13/2004 19:45:28
On Tuesday 13 July 2004 03:15, Charles M. Hannum wrote:
> On Monday 12 July 2004 17:44, Ian Zagorskih wrote:
> > NetBSD IANZAG 2.0_BETA NetBSD 2.0_BETA (IANZAG) #1: Tue Jun 15 16:15:27
> > NOVST 2004  ianzag@IANZAG:/usr/src/sys/arch/i386/compile/IANZAG i386
> >...
> > On FFS partition with native code i get about 50kb/s which is too slow
> > for this machine even on CF card. After applying the patch i get about
> > 600..900kb/s and this seems much better for me.
> >
> > Any ideas about the state of PR24633 ?
>
> "We know."
>
> I already committed (somewhat different) changes to -current, and they were
> pulled up to the release branch on July 2.  If you could test a more recent
> snapshot and verify that it works as expected, that would be a useful data
> point.

I got complete -current sources tree from releng dated as 20040711 and tested 
on my target machine. Looks like -current works much better in respect to 
Compact Flash cards :) 300kb/s in synchronous and >1Mb/s in asynchronous mode 
is good.

Well, there's IMHO last question: why CF card is configured to use PIO mode 
0 ? I know my card supports PIO mode 2 and it actually reports its 
capabilities in ATA identify response. At least i can trace this responce in 
ata_get_params() call. But somewhere futher this information is discarded and 
wd0 becomes PIO mode 0..

<offtopic on>
I want to see this changes in NetBSD 2.0 ! :) This really makes the life 
easier for people like me who had to use brain damaged Compact Flash cards..
</offtopic off>

---dd test---
# disklabel wd0
# /dev/rwd0d:
type: ESDI
disk: PQI IDE Flash Di
label: PQI
flags:
bytes/sector: 512
sectors/track: 16
tracks/cylinder: 8
sectors/cylinder: 128
cylinders: 500
total sectors: 64000
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

4 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:     64000         0     4.2BSD   1024  8192  8000  # (Cyl.      0 -    
499)
 c:     64000         0     unused      0     0        # (Cyl.      0 -    
499)
 d:     64000         0     unused      0     0        # (Cyl.      0 -    
499)
#

# mount -o sync /dev/wd0a /mnt
# cd /mnt/
# mount
192.168.100.5:/home/maks on / type nfs
/dev/wd0a on /mnt type ffs (synchronous, local)
# dd if=/dev/zero of=dat bs=1m count=24
24+0 records in
24+0 records out
25165824 bytes transferred in 73.862 secs (340714 bytes/sec)
# cd /
# umount /mnt
# mount  /dev/wd0a /mnt
# cd /mnt/
# dd if=/dev/zero of=dat bs=1m count=24
24+0 records in
24+0 records out
25165824 bytes transferred in 16.921 secs (1487253 bytes/sec)
---dd test---

---dmesg---
# cat dmesg.boot
NetBSD 2.0G (EmCORE-n513-nfs-console) #0: Tue Jul 13 17:10:08 NOVST 2004
        ianzag@IANZAG:/home/ianzag/NetBSD/current/build/obj/i386/sys/arch/i386/compile/EmCORE-n513-nfs-console
total memory = 30844 KB
avail memory = 28292 KB
BIOS32 rev. 0 found at 0xfaf10
mainbus0 (root)
cpu0 at mainbus0: (uniprocessor)
cpu0: Cyrix MMX-enhanced MediaGX (GXm) (586-class), 300.69 MHz, id 0x540
cpu0: features 808131<FPU,TSC,MSR,CX8>
cpu0: features 808131<CMOV,MMX>
cpu0: "Geode(TM) Integrated Processor by National Semi"
cpu0: I-cache 12K uOp cache 8-way
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pchb0 at pci0 dev 0 function 0
pchb0: Cyrix Corporation MediaGX Built-in PCI Host Controller (rev. 0x00)
rtk0 at pci0 dev 10 function 0: Realtek 8139 10/100BaseTX
rtk0: interrupting at irq 11
rtk0: Ethernet address 00:05:b7:00:2a:f6
ukphy0 at rtk0 phy 7: Generic IEEE 802.3u media interface
ukphy0: OUI 0x000000, model 0x0000, rev. 0
ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
pcib0 at pci0 dev 18 function 0
pcib0: Cyrix Corporation Cx5530 I/O Companion Multi-Function South Bridge 
(rev. 0x30)
Cyrix Corporation Cx5530 I/O Companion (SMI Status and ACPI Timer) 
(miscellaneous bridge) at pci0 dev 18 function 1 not configured
geodeide0 at pci0 dev 18 function 2
geodeide0: AMD Geode CX5530 IDE controller (rev. 0x00)
geodeide0: bus-master DMA support present
geodeide0: primary channel wired to compatibility mode
geodeide0: primary channel interrupting at irq 14
atabus0 at geodeide0 channel 0
geodeide0: secondary channel wired to compatibility mode
geodeide0: secondary channel interrupting at irq 15
atabus1 at geodeide0 channel 1
Cyrix Corporation Cx5530 I/O Companion (XpressAUDIO) (audio multimedia) at 
pci0 dev 18 function 3 not configured
vga0 at pci0 dev 18 function 4: Cyrix Corporation Cx5530 I/O Companion (Video 
Controller) (rev. 0x00)
wsdisplay0 at vga0 kbdmux 1: console (80x25, vt100 emulation)
wsmux1: connecting to wsdisplay0
ohci0 at pci0 dev 19 function 0: Compaq USB Controller (rev. 0x06)
ohci0: interrupting at irq 11
ohci0: OHCI version 1.0, legacy support
usb0 at ohci0: USB revision 1.0
uhub0 at usb0
uhub0: Compaq OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
isa0 at pcib0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
pckbc0 at isa0 port 0x60-0x64
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
sysbeep0 at pcppi0
npx0 at isa0 port 0xf0-0xff: using exception 16
wd0 at atabus1 drive 0: <PQI IDE Flash Disk>
wd0: drive supports 1-sector PIO transfers, LBA addressing
wd0: 32000 KB, 500 cyl, 8 head, 16 sec, 512 bytes/sect x 64000 sectors
wd0: 32-bit data port
wd0(geodeide0:1:0): using PIO mode 0
boot device: rtk0
root on rtk0
nfs_boot: trying DHCP/BOOTP
nfs_boot: DHCP next-server: 192.168.100.5
nfs_boot: my_name=MAKS
nfs_boot: my_addr=192.168.100.250
nfs_boot: my_mask=255.255.255.0
root on 192.168.100.5:/home/maks
wsdisplay0: screen 1 added (80x25, vt100 emulation)
wsdisplay0: screen 2 added (80x25, vt100 emulation)
wsdisplay0: screen 3 added (80x25, vt100 emulation)
wsdisplay0: screen 4 added (80x25, vt100 emulation)
---dmesg---

// wbr