Port-ofppc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pci_attach_hook() tweaks



Frank Wille says;

Hmm... I hope so. At the moment the primary channel works fine with irq 14,
but who knows what happens when switching to compatible mode?

Let's try to see the following hack can make the 2nd channel compat mode
(by its nature this kind of tweak is highly target dependent to make the
code ugly...)

void
pci_attach_hook(struct device *parent,
   struct device *self, struct pcibus_attach_args *pba)
{
       pcitag_t tag;
       pcireg_t reg;

       /* if not bus0, then bailout */
       /* VIA PCIIDE */
       tag = pci_make_tag(pba->pba_pc, pba->pba_bus, 12, 1);
       /* 09: use "compatiblity mode" */
       reg = pci_conf_read(pba->pba_pc, tag, 0x08);
       reg = (reg & 0xffff00ff) | (0x8a << 8);
       pci_conf_write(pba->pba_pc, tag, 0x8, reg);
       /* 3d: remove PCI pin designation */
       reg = pci_conf_read(pba->pba_pc, tag, 0x3c);
       reg = (reg & 0xffff00ff);
       pci_conf_write(pba->pba_pc, tag, 0x3c, reg);
}

Toru Nishimura / ALKYL Technology



Home | Main Index | Thread Index | Old Index