Lines Matching +full:static +full:- +full:config
1 // SPDX-License-Identifier: GPL-2.0-or-later
12 #include <linux/dma-map-ops.h>
15 #include <linux/soc/ti/omap1-io.h>
24 /* These routines should handle the standard chip-specific modes
27 * Some board-*.c files will need to set up additional mux options,
32 * - 1611B H2 (with usb1 mini-AB) using standard Mini-B or OTG cables
33 * - 5912 OSK OHCI (with usb0 standard-A), standard A-to-B cables
34 * - 5912 OSK UDC, with *nonstandard* A-to-A cable
35 * - 1510 Innovator UDC with bundled usb0 cable
36 * - 1510 Innovator OHCI with bundled usb1/usb2 cable
37 * - 1510 Innovator OHCI with custom usb0 cable, feeding 5V VBUS
38 * - 1710 custom development board using alternate pin group
39 * - 1710 H3 (with usb1 mini-AB) using standard Mini-B or OTG cables
50 static void __init
51 omap_otg_init(struct omap_usb_config *config) in omap_otg_init() argument
66 if (config->pins[0] > 2) /* alt pingroup 2 */ in omap_otg_init()
68 syscon |= config->usb0_init(config->pins[0], is_usb0_device(config)); in omap_otg_init()
69 syscon |= config->usb1_init(config->pins[1]); in omap_otg_init()
70 syscon |= config->usb2_init(config->pins[2], alt_pingroup); in omap_otg_init()
74 syscon = config->hmc_mode; in omap_otg_init()
77 if (config->otg) in omap_otg_init()
85 printk("USB: hmc %d", config->hmc_mode); in omap_otg_init()
87 pr_cont(", usb2 alt %d wires", config->pins[2]); in omap_otg_init()
88 else if (config->pins[0]) in omap_otg_init()
89 pr_cont(", usb0 %d wires%s", config->pins[0], in omap_otg_init()
90 is_usb0_device(config) ? " (dev)" : ""); in omap_otg_init()
91 if (config->pins[1]) in omap_otg_init()
92 pr_cont(", usb1 %d wires", config->pins[1]); in omap_otg_init()
93 if (!alt_pingroup && config->pins[2]) in omap_otg_init()
94 pr_cont(", usb2 %d wires", config->pins[2]); in omap_otg_init()
95 if (config->otg) in omap_otg_init()
96 pr_cont(", Mini-AB on usb%d", config->otg - 1); in omap_otg_init()
113 if (config->otg || config->register_dev) { in omap_otg_init()
114 struct platform_device *udc_device = config->udc_device; in omap_otg_init()
118 udc_device->dev.platform_data = config; in omap_otg_init()
126 if (config->otg || config->register_host) { in omap_otg_init()
127 struct platform_device *ohci_device = config->ohci_device; in omap_otg_init()
131 ohci_device->dev.platform_data = config; in omap_otg_init()
139 if (config->otg) { in omap_otg_init()
140 struct platform_device *otg_device = config->otg_device; in omap_otg_init()
144 otg_device->dev.platform_data = config; in omap_otg_init()
155 static void omap_otg_init(struct omap_usb_config *config) {} in omap_otg_init() argument
160 static struct resource udc_resources[] = {
178 static u64 udc_dmamask = ~(u32)0;
180 static struct platform_device udc_device = {
182 .id = -1,
191 static inline void udc_device_init(struct omap_usb_config *pdata) in udc_device_init()
193 pdata->udc_device = &udc_device; in udc_device_init()
198 static inline void udc_device_init(struct omap_usb_config *pdata) in udc_device_init()
205 static u64 ohci_dmamask = ~(u32)0;
207 static struct resource ohci_resources[] = {
219 static struct platform_device ohci_device = {
221 .id = -1,
230 static inline void ohci_device_init(struct omap_usb_config *pdata) in ohci_device_init()
235 pdata->ohci_device = &ohci_device; in ohci_device_init()
236 pdata->ocpi_enable = &ocpi_enable; in ohci_device_init()
241 static struct resource otg_resources[] = {
253 static struct platform_device otg_device = {
255 .id = -1,
260 static inline void otg_device_init(struct omap_usb_config *pdata) in otg_device_init()
262 pdata->otg_device = &otg_device; in otg_device_init()
267 static inline void otg_device_init(struct omap_usb_config *pdata) in otg_device_init()
273 static u32 __init omap1_usb0_init(unsigned nwires, unsigned is_device) in omap1_usb0_init()
281 /* pulldown D+/D- */ in omap1_usb0_init()
300 /* This works on 1510-Innovator */ in omap1_usb0_init()
305 * - peripheral should configure VBUS detection! in omap1_usb0_init()
306 * - only peripherals may use the internal D+/D- pulldowns in omap1_usb0_init()
307 * - OTG support on this port not yet written in omap1_usb0_init()
319 /* alternate pin config, external transceiver */ in omap1_usb0_init()
321 printk(KERN_ERR "no usb0 alt pin config on 15xx\n"); in omap1_usb0_init()
364 printk(KERN_ERR "illegal usb%d %d-wire transceiver\n", in omap1_usb0_init()
371 static u32 __init omap1_usb1_init(unsigned nwires) in omap1_usb1_init()
430 printk(KERN_ERR "illegal usb%d %d-wire transceiver\n", in omap1_usb1_init()
437 static u32 __init omap1_usb2_init(unsigned nwires, unsigned alt_pingroup) in omap1_usb2_init()
503 printk(KERN_ERR "illegal usb%d %d-wire transceiver\n", in omap1_usb2_init()
511 /* OMAP-1510 OHCI has its own MMU for DMA */
523 * Bus address is physical address, except for OMAP-1510 Local Bus.
524 * OMAP-1510 bus address is translated into a Local Bus address if the
530 * OMAP-1510 specific Local Bus clock on/off
532 static int omap_1510_local_bus_power(int on) in omap_1510_local_bus_power()
545 * OMAP-1510 specific Local Bus initialization
547 * See also arch/mach-omap/memory.h for __virt_to_dma() and
551 static int omap_1510_local_bus_init(void) in omap_1510_local_bus_init()
579 static void omap_1510_local_bus_reset(void) in omap_1510_local_bus_reset()
593 static void __init omap_1510_usb_init(struct omap_usb_config *config) in omap_1510_usb_init() argument
598 config->usb0_init(config->pins[0], is_usb0_device(config)); in omap_1510_usb_init()
599 config->usb1_init(config->pins[1]); in omap_1510_usb_init()
600 config->usb2_init(config->pins[2], 0); in omap_1510_usb_init()
603 val |= (config->hmc_mode << 1); in omap_1510_usb_init()
606 printk("USB: hmc %d", config->hmc_mode); in omap_1510_usb_init()
607 if (config->pins[0]) in omap_1510_usb_init()
608 pr_cont(", usb0 %d wires%s", config->pins[0], in omap_1510_usb_init()
609 is_usb0_device(config) ? " (dev)" : ""); in omap_1510_usb_init()
610 if (config->pins[1]) in omap_1510_usb_init()
611 pr_cont(", usb1 %d wires", config->pins[1]); in omap_1510_usb_init()
612 if (config->pins[2]) in omap_1510_usb_init()
613 pr_cont(", usb2 %d wires", config->pins[2]); in omap_1510_usb_init()
636 if (config->register_dev) { in omap_1510_usb_init()
639 udc_device.dev.platform_data = config; in omap_1510_usb_init()
647 if (IS_ENABLED(CONFIG_USB_OHCI_HCD) && config->register_host) { in omap_1510_usb_init()
650 ohci_device.dev.platform_data = config; in omap_1510_usb_init()
652 OMAP1510_LB_OFFSET, (u64)-1); in omap_1510_usb_init()
658 config->lb_reset = omap_1510_local_bus_reset; in omap_1510_usb_init()
663 static inline void omap_1510_usb_init(struct omap_usb_config *config) {} in omap_1510_usb_init() argument
674 pdata->usb0_init = omap1_usb0_init; in omap1_usb_init()
675 pdata->usb1_init = omap1_usb1_init; in omap1_usb_init()
676 pdata->usb2_init = omap1_usb2_init; in omap1_usb_init()