OK, I gave up coding is not my thing, need help.
Linux code:
static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
{
void __iomem *base;
u32 control;
if (!mmio_resource_enabled(pdev, 0))
return;
base = pci_ioremap_bar(pdev, 0);
if (base == NULL)
return;
control = readl(base + OHCI_CONTROL);
...
/* reset controller, preserving RWC (and possibly IR) */
writel(control & OHCI_CTRL_MASK, base + OHCI_CONTROL);
/*
* disable interrupts
*/
writel(~(u32)0, base + OHCI_INTRDISABLE);
writel(~(u32)0, base + OHCI_INTRSTATUS);
iounmap(base);
}
What I did(don't laugh):
int uhci_reset (pci_dt_t *pci_dev)
{
uint32_t base, control;
#define OHCI_CTRL_MASK (1 << 9)
#define OHCI_CONTROL 0x04
#define OHCI_INTRDISABLE 0x14
#define OHCI_INTRSTATUS 0x0c
base = pci_config_read32(pci_dev->dev.addr, 0x10);
control = base + OHCI_CONTROL;
verbose("OHCI controller [%04x:%04x] at %02x:%2x.%x control %x(base %x)\n",
pci_dev->vendor_id, pci_dev->device_id,
pci_dev->dev.bits.bus, pci_dev->dev.bits.dev, pci_dev->dev.bits.func,
control, base);
/* reset controller, preserving RWC (and possibly IR) */
outl (control & OHCI_CTRL_MASK, control);
delay(10);
/*
* disable interrupts
*/
outl(~(UInt32)0, base + OHCI_INTRDISABLE);
outl(~(UInt32)0, base + OHCI_INTRSTATUS);
return 1;
}
OHCI controller [10de:0aa5] at 00:04.0 control d3108004(base d3108000)
Setting Legacy USB Off on controller [10de:0aa6] at 00:04.1
Legacy USB Off Done
EHCI controller [10de:0aa6] at 00:04.1 DMA @d3109200
OHCI controller [10de:0aa7] at 00:06.0 control d3107004(base d3107000)
Setting Legacy USB Off on controller [10de:0aa9] at 00:06.1
Legacy USB Off Done
EHCI controller [10de:0aa9] at 00:06.1 DMA @d3109100
Is not OK since I still get that damn message from apple driver, so what I did wrong?