> Date: Fri, 16 Dec 2011 17:46:30 -0500 > From: Brian Callahan <kors...@gmail.com> > > sdhc0 at pci3 dev 0 function 0 "Ricoh 5U823 SD/MMC" rev 0x04panic: > kernel diagnostic assertion "(reg & 0x3) == 0" failed: file > "../../../../arch/amd64/pci/pci_machdep.c", line 298
Ugh, I made a typo there. This one should work better. Index: sdhc_pci.c =================================================================== RCS file: /cvs/src/sys/dev/pci/sdhc_pci.c,v retrieving revision 1.11 diff -u -p -r1.11 sdhc_pci.c --- sdhc_pci.c 31 Jul 2011 16:55:01 -0000 1.11 +++ sdhc_pci.c 16 Dec 2011 22:52:15 -0000 @@ -98,11 +98,42 @@ sdhc_pci_attach(struct device *parent, s /* Some RICOH controllers lack a capability register. */ if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_RICOH && - PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_RICOH_R5U823) + PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_RICOH_R5U823) { + reg = pci_conf_read(pa->pa_pc, pa->pa_tag, 0xf8); + reg &= ~0x0000ff00; + reg |= 0x0000fc00; + pci_conf_write(pa->pa_pc, pa->pa_tag, 0xf8, reg); + + reg = pci_conf_read(pa->pa_pc, pa->pa_tag, 0x150); + reg &= ~0x000000ff; + reg |= 0x00000010; + pci_conf_write(pa->pa_pc, pa->pa_tag, 0x150, reg); + + reg = pci_conf_read(pa->pa_pc, pa->pa_tag, 0xf8); + reg &= ~0x0000ff00; + reg |= 0x00000000; + pci_conf_write(pa->pa_pc, pa->pa_tag, 0xf8, reg); + + reg = pci_conf_read(pa->pa_pc, pa->pa_tag, 0xfc); + reg &= ~0x000000ff; + reg |= 0x00000001; + pci_conf_write(pa->pa_pc, pa->pa_tag, 0xfc, reg); + + reg = pci_conf_read(pa->pa_pc, pa->pa_tag, 0xe0); + reg &= ~0x0000ff00; + reg |= 0x00003200; + pci_conf_write(pa->pa_pc, pa->pa_tag, 0xe0, reg); + + reg = pci_conf_read(pa->pa_pc, pa->pa_tag, 0xfc); + reg &= ~0x000000ff; + reg |= 0x00000000; + pci_conf_write(pa->pa_pc, pa->pa_tag, 0xfc, reg); + caps = (0x21 << SDHC_BASE_FREQ_SHIFT) | (0x21 << SDHC_TIMEOUT_FREQ_SHIFT) | SDHC_TIMEOUT_FREQ_UNIT | SDHC_VOLTAGE_SUPP_3_3V | SDHC_DMA_SUPPORT; + } if (pci_intr_map(pa, &ih)) { printf(": can't map interrupt\n");