this is needed to be able to see the PATA hard drive on a 1st gen
macbook air. netbsd made this change 6 years ago.
please test on pciide-using machines.
Index: pciide.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/pciide.c,v
retrieving revision 1.330
diff -u -p -u -r1.330 pciide.c
--- pciide.c 9 May 2011 22:33:54 -0000 1.330
+++ pciide.c 10 Jul 2011 23:46:31 -0000
@@ -2653,8 +2653,7 @@ piix_chip_map(struct pciide_softc *sc, s
for (channel = 0; channel < sc->sc_wdcdev.nchannels; channel++) {
cp = &sc->pciide_channels[channel];
- /* PIIX is compat-only */
- if (pciide_chansetup(sc, channel, 0) == 0)
+ if (pciide_chansetup(sc, channel, interface) == 0)
continue;
idetim = pci_conf_read(sc->sc_pc, sc->sc_tag, PIIX_IDETIM);
if ((PIIX_IDETIM_READ(idetim, channel) &
@@ -2663,11 +2662,10 @@ piix_chip_map(struct pciide_softc *sc, s
sc->sc_wdcdev.sc_dev.dv_xname, cp->name);
continue;
}
- /* PIIX are compat-only pciide devices */
- pciide_map_compat_intr(pa, cp, channel, 0);
+ pciide_map_compat_intr(pa, cp, channel, interface);
if (cp->hw_ok == 0)
continue;
- pciide_mapchan(pa, cp, 0, &cmdsize, &ctlsize, pciide_pci_intr);
+ pciide_mapchan(pa, cp, interface, &cmdsize, &ctlsize,
pciide_pci_intr);
if (cp->hw_ok == 0)
goto next;
if (pciide_chan_candisable(cp)) {
@@ -2681,7 +2679,7 @@ piix_chip_map(struct pciide_softc *sc, s
sc->sc_wdcdev.set_modes(&cp->wdc_channel);
next:
if (cp->hw_ok == 0)
- pciide_unmap_compat_intr(pa, cp, channel, 0);
+ pciide_unmap_compat_intr(pa, cp, channel, interface);
}
piix_timing_debug(sc);
dmesg with this fix:
OpenBSD 4.9-current (GENERIC.MP) #7: Sun Jul 10 18:34:02 CDT 2011
[email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 2103754752 (2006MB)
avail mem = 2033696768 (1939MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xe0000 (39 entries)
bios0: vendor Apple Inc. version "MBA11.88Z.00BB.B03.0803171226" date 03/17/08
bios0: Apple Inc. MacBookAir1,1
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP HPET APIC MCFG ASF! SBST ECDT SSDT SSDT SSDT SSDT SSDT
acpi0: wakeup devices ADP1(S3) LID0(S3) ARPT(S3) UHC1(S3) UHC2(S3) UHC3(S3)
UHC4(S3) UHC5(S3) EHC1(S3) EHC2(S3) EC__(S3)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 14318179 Hz
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM)2 Duo CPU P7700 @ 1.80GHz, 1795.82 MHz
cpu0:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,NXE,LONG
cpu0: 4MB 64b/line 16-way L2 cache
cpu0: apic clock running at 199MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM)2 Duo CPU P7700 @ 1.80GHz, 1795.50 MHz
cpu1:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,NXE,LONG
cpu1: 4MB 64b/line 16-way L2 cache
ioapic0 at mainbus0: apid 1 pa 0xfec00000, version 20, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 1
acpimcfg0 at acpi0 addr 0xf0000000, bus 0-255
acpiec0 at acpi0
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 2 (RP05)
acpiprt2 at acpi0: bus 3 (PCIB)
acpicpu0 at acpi0: C3, C2, C1, PSS
acpicpu1 at acpi0: C3, C2, C1, PSS
acpitz0 at acpi0: critical temperature is 100 degC
acpiac0 at acpi0: AC unit offline
acpibtn0 at acpi0: LID0
acpibtn1 at acpi0: PWRB
acpibtn2 at acpi0: SLPB
acpibat0 at acpi0: BAT0 model "3978702879145677633" type 3978702879347132748
oem "3978702879347199315"
acpivideo0 at acpi0: GFX0
cpu0: Enhanced SpeedStep 1795 MHz: speeds: 1800, 1600, 1400, 1200, 800 MHz
memory map conflict 0xf00f8000/0x1000
memory map conflict 0xfed1c000/0x4000
memory map conflict 0xfffa0000/0x30000
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel GM965 Host" rev 0x03
vga1 at pci0 dev 2 function 0 "Intel GM965 Video" rev 0x03
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
intagp0 at vga1
agp0 at intagp0: aperture at 0x80000000, size 0x10000000
inteldrm0 at vga1: apic 1 int 16
drm0 at inteldrm0
"Intel GM965 Video" rev 0x03 at pci0 dev 2 function 1 not configured
uhci0 at pci0 dev 26 function 0 "Intel 82801H USB" rev 0x03: apic 1 int 20
uhci1 at pci0 dev 26 function 1 "Intel 82801H USB" rev 0x03: apic 1 int 16
ehci0 at pci0 dev 26 function 7 "Intel 82801H USB" rev 0x03: apic 1 int 21
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
azalia0 at pci0 dev 27 function 0 "Intel 82801H HD Audio" rev 0x03: msi
azalia0: codecs: Realtek ALC885
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 "Intel 82801H PCIE" rev 0x03: msi
pci1 at ppb0 bus 1
ppb1 at pci0 dev 28 function 4 "Intel 82801H PCIE" rev 0x03: msi
pci2 at ppb1 bus 2
"Broadcom BCM4321" rev 0x05 at pci2 dev 0 function 0 not configured
uhci2 at pci0 dev 29 function 0 "Intel 82801H USB" rev 0x03: apic 1 int 16
uhci3 at pci0 dev 29 function 1 "Intel 82801H USB" rev 0x03: apic 1 int 18
uhci4 at pci0 dev 29 function 2 "Intel 82801H USB" rev 0x03: apic 1 int 21
ehci1 at pci0 dev 29 function 7 "Intel 82801H USB" rev 0x03: apic 1 int 20
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb2 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xf3
pci3 at ppb2 bus 3
pcib0 at pci0 dev 31 function 0 "Intel 82801HBM LPC" rev 0x03
pciide0 at pci0 dev 31 function 1 "Intel 82801HBM IDE" rev 0x03: DMA, channel 0
configured to native-PCI, channel 1 configured to native-PCI
pciide0: using apic 1 int 21 for native-PCI interrupt
wd0 at pciide0 channel 0 drive 0: <STT_FZM64GW18P>
wd0: 16-sector PIO, LBA48, 57344MB, 117440512 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 5
pciide0: channel 1 disabled (no drives)
pciide1 at pci0 dev 31 function 2 "Intel 82801HBM SATA" rev 0x03: DMA, channel
0 configured to native-PCI, channel 1 configured to native-PCI
pciide1: using apic 1 int 18 for native-PCI interrupt
ichiic0 at pci0 dev 31 function 3 "Intel 82801H SMBus" rev 0x03: apic 1 int 20
iic0 at ichiic0
usb2 at uhci0: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci1: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci2: USB revision 1.0
uhub4 at usb4 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb5 at uhci3: USB revision 1.0
uhub5 at usb5 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb6 at uhci4: USB revision 1.0
uhub6 at usb6 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at pcib0
isadma0 at isa0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
mtrr: Pentium Pro MTRR support
rsu0 at uhub1 port 1 "Manufacturer Realtek 11n Adapter" rev 2.00/2.00 addr 2
rsu0: MAC/BB RTL8712 cut 3, address 5c:d9:98:45:52:e0
uvideo0 at uhub1 port 4 configuration 1 interface 0 "Apple Inc. Built-in
iSight" rev 2.00/1.89 addr 3
video0 at uvideo0
ugen0 at uhub1 port 4 configuration 1 "Apple Inc. Built-in iSight" rev
2.00/1.89 addr 3
uhub7 at uhub4 port 2 "Apple Inc. BRCM2046 Hub" rev 2.00/1.00 addr 2
ugen1 at uhub7 port 1 "Apple Inc. Bluetooth USB Host Controller" rev 2.00/1.80
addr 3
uhidev0 at uhub7 port 2 configuration 1 interface 0 "Apple Computer product
0x820a" rev 2.00/1.00 addr 4
uhidev0: iclass 3/1, 1 report id
ukbd0 at uhidev0 reportid 1: 8 modifier keys, 6 key codes
wskbd0 at ukbd0: console keyboard, using wsdisplay0
uhidev1 at uhub7 port 3 configuration 1 interface 0 "Apple Computer product
0x820b" rev 2.00/1.00 addr 5
uhidev1: iclass 3/1, 2 report ids
ums0 at uhidev1 reportid 2: 3 buttons
wsmouse0 at ums0 mux 0
uhidev2 at uhub6 port 1 configuration 1 interface 0 "Apple Computer, Inc. IR
Receiver" rev 2.00/0.16 addr 2
uhidev2: iclass 3/0, 38 report ids
uhid0 at uhidev2 reportid 36: input=4, output=0, feature=0
uhid1 at uhidev2 reportid 37: input=4, output=0, feature=0
uhid2 at uhidev2 reportid 38: input=4, output=0, feature=0
uhidev3 at uhub6 port 2 configuration 1 interface 0 "Apple, Inc. Apple Internal
Keyboard / Trackpad" rev 2.00/0.70 addr 3
uhidev3: iclass 3/1, 9 report ids
ukbd1 at uhidev3 reportid 1: 8 modifier keys, 6 key codes, country code 33
wskbd1 at ukbd1 mux 1
wskbd1: connecting to wsdisplay0
uhid3 at uhidev3 reportid 9: input=0, output=0, feature=3
uhidev4 at uhub6 port 2 configuration 1 interface 1 "Apple, Inc. Apple Internal
Keyboard / Trackpad" rev 2.00/0.70 addr 3
uhidev4: iclass 3/0, 68 report ids
uhid4 at uhidev4 reportid 68: input=511, output=0, feature=0
uhidev5 at uhub6 port 2 configuration 1 interface 2 "Apple, Inc. Apple Internal
Keyboard / Trackpad" rev 2.00/0.70 addr 3
uhidev5: iclass 3/1, 2 report ids
ums1 at uhidev5 reportid 2: 3 buttons
wsmouse1 at ums1 mux 0
vscsi0 at root
scsibus0 at vscsi0: 256 targets
softraid0 at root
scsibus1 at softraid0: 256 targets
root on wd0a (4607b599287f3079.a) swap on wd0b dump on wd0b
sd0 at scsibus1 targ 1 lun 0: <OPENBSD, SR CRYPTO, 004> SCSI2 0/direct fixed
sd0: 56164MB, 512 bytes/sec, 115024872 sec total