1 diff -Naru linux/drivers/usb/host/Config.in linux-new/drivers/usb/host/Config.in
2 --- linux/drivers/usb/host/Config.in 2003-11-16 20:07:42.000000000 -0500
3 +++ linux-new/drivers/usb/host/Config.in 2003-12-18 14:19:37.000000000 -0500
5 dep_tristate ' SL811HS Alternate (x86, StrongARM, isosynchronous mode)' CONFIG_USB_SL811HS_ALT $CONFIG_USB $CONFIG_EXPERIMENTAL
6 dep_tristate ' SL811HS (x86, StrongARM) support, old driver' CONFIG_USB_SL811HS $CONFIG_USB $CONFIG_EXPERIMENTAL
8 +dep_tristate ' Non-PCI OHCI support' CONFIG_USB_NON_PCI_OHCI $CONFIG_USB_OHCI
9 diff -Naru linux/drivers/usb/host/usb-ohci.c linux-new/drivers/usb/host/usb-ohci.c
10 --- linux/drivers/usb/host/usb-ohci.c 2003-08-13 13:19:23.000000000 -0400
11 +++ linux-new/drivers/usb/host/usb-ohci.c 2003-12-18 14:19:53.000000000 -0500
13 hc_release_ohci (ohci);
16 +#ifndef CONFIG_USB_NON_PCI_OHCI
17 ohci->flags = id->driver_data;
19 /* Check for NSC87560. We have to look at the bridge (fn1) to identify
21 printk (KERN_INFO __FILE__ ": Using NSC SuperIO setup\n");
22 if (ohci->flags & OHCI_QUIRK_AMD756)
23 printk (KERN_INFO __FILE__ ": AMD756 erratum 4 workaround\n");
26 if (hc_reset (ohci) < 0) {
27 hc_release_ohci (ohci);
28 @@ -2580,8 +2582,10 @@
32 +#ifndef CONFIG_USB_NON_PCI_OHCI
33 if (ohci->pci_latency)
34 pci_write_config_byte (ohci->ohci_dev, PCI_LATENCY_TIMER, ohci->pci_latency);
41 /*-------------------------------------------------------------------------*/
43 +#ifndef CONFIG_USB_NON_PCI_OHCI
44 /* configured so that an OHCI device is always provided */
45 /* always called with process context; sleeping is OK */
47 @@ -2658,6 +2663,88 @@
51 +#else /* CONFIG_USB_NON_PCI_OHCI */
54 +static int ohci_base=0, ohci_len=0;
55 +static int ohci_irq=-1;
57 +MODULE_PARM(ohci_base, "i");
58 +MODULE_PARM(ohci_len, "i");
59 +MODULE_PARM(ohci_irq, "i");
60 +MODULE_PARM_DESC(ohci_base, "IO Base address of OHCI Oper. registers");
61 +MODULE_PARM_DESC(ohci_len, "IO length of OHCI Oper. registers");
62 +MODULE_PARM_DESC(ohci_irq, "IRQ for OHCI interrupts");
65 +static struct pci_dev bogus_pcidev;
67 +static struct pci_driver ohci_pci_driver = {
72 +ohci_non_pci_init (void)
76 + if (!ohci_base || !ohci_len || (ohci_irq < 0))
79 + if (!request_mem_region (ohci_base, ohci_len, ohci_pci_driver.name)) {
80 + dbg ("controller already in use");
84 + mem_base = ioremap_nocache (ohci_base, ohci_len);
86 + err("Error mapping OHCI memory");
91 + * Fill in the bogus pci_dev. Only those members actually
92 + * dereferenced in this driver are initialized.
94 + memset(&bogus_pcidev, 0, sizeof(struct pci_dev));
95 + strcpy(bogus_pcidev.name, "non-PCI OHCI");
96 + strcpy(bogus_pcidev.slot_name, "builtin");
97 + bogus_pcidev.resource[0].name = "OHCI Operational Registers";
98 + bogus_pcidev.resource[0].start = ohci_base;
99 + bogus_pcidev.resource[0].end = ohci_base + ohci_len;
100 + bogus_pcidev.resource[0].flags = 0;
101 + bogus_pcidev.irq = ohci_irq;
103 + return hc_found_ohci (&bogus_pcidev, bogus_pcidev.irq, mem_base, NULL);
109 +ohci_setup (char* options)
113 + if (!options || !*options)
116 + for(this_opt=strtok(options,",");this_opt;this_opt=strtok(NULL,",")) {
117 + if (!strncmp(this_opt, "base:", 5)) {
118 + ohci_base = simple_strtoul(this_opt+5, NULL, 0);
119 + } else if (!strncmp(this_opt, "len:", 4)) {
120 + ohci_len = simple_strtoul(this_opt+4, NULL, 0);
121 + } else if (!strncmp(this_opt, "irq:", 4)) {
122 + ohci_irq = simple_strtoul(this_opt+4, NULL, 0);
128 +__setup("usb_ohci=", ohci_setup);
130 +#endif /* !MODULE */
132 +#endif /* CONFIG_USB_NON_PCI_OHCI */
134 /*-------------------------------------------------------------------------*/
136 @@ -2698,6 +2785,7 @@
140 +#ifndef CONFIG_USB_NON_PCI_OHCI
143 /*-------------------------------------------------------------------------*/
144 @@ -2936,20 +3024,29 @@
145 resume: ohci_pci_resume,
148 +#endif /* CONFIG_USB_NON_PCI_OHCI */
151 /*-------------------------------------------------------------------------*/
153 static int __init ohci_hcd_init (void)
155 +#ifndef CONFIG_USB_NON_PCI_OHCI
156 return pci_module_init (&ohci_pci_driver);
158 + return ohci_non_pci_init();
162 /*-------------------------------------------------------------------------*/
164 static void __exit ohci_hcd_cleanup (void)
166 +#ifndef CONFIG_USB_NON_PCI_OHCI
167 pci_unregister_driver (&ohci_pci_driver);
169 + ohci_pci_remove(&bogus_pcidev);
173 module_init (ohci_hcd_init);