Lines Matching +full:imx23 +full:- +full:usbphy

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2010-2012 Semihalf
70 * refers to them as "core" and "non-core" registers. A set of core register
71 * exists for each OTG or EHCI device. There is a single set of non-core
77 * non-core registers by using a pair of resource address/size values (two
81 * whose reg property describes the non-core registers. The way we handle FDT
82 * data, this means that the resources (memory-mapped register range) for the
83 * non-core registers belongs to a device other than the echi devices.
96 * two parts: a set of imx-specific registers at an offset of 0 from the
110 * - "fsl,imx23-usb", "fsl,imx27-usb";
111 * - "fsl,imx25-usb", "fsl,imx27-usb";
112 * - "fsl,imx28-usb", "fsl,imx27-usb";
113 * - "fsl,imx51-usb", "fsl,imx27-usb";
114 * - "fsl,imx53-usb", "fsl,imx27-usb";
115 * - "fsl,imx6q-usb", "fsl,imx27-usb";
119 * - fsl,usbmisc = <&usbmisc 0>;
120 * - fsl,usbphy = <&usbphy0>;
123 * usbphy drivers where needed; this data is mentioned here just to keep all the
124 * imx-FDT-usb-related info in one place. Here are the usbphy compat strings
126 * - "nop-usbphy"
127 * - "usb-nop-xceiv";
128 * - "fsl,imx23-usbphy"
129 * - "fsl,imx28-usbphy", "fsl,imx23-usbphy";
130 * - "fsl,imx6q-usbphy", "fsl,imx23-usbphy";
134 /*-----------------------------------------------------------------------------
136 *---------------------------------------------------------------------------*/
147 {"fsl,imx6q-usbmisc", true},
148 {"fsl,imx51-usbmisc", true},
149 {"fsl,imx25-usbmisc", true},
160 reg = bus_read_4(sc->mmio, index * sizeof(uint32_t)); in imx_usbmisc_set_ctrl()
161 bus_write_4(sc->mmio, index * sizeof(uint32_t), reg | bits); in imx_usbmisc_set_ctrl()
172 reg = bus_read_4(sc->mmio, index * sizeof(uint32_t)); in imx_usbmisc_clr_ctrl()
173 bus_write_4(sc->mmio, index * sizeof(uint32_t), reg & ~bits); in imx_usbmisc_clr_ctrl()
184 if (ofw_bus_search_compatible(dev, usbmisc_compat_data)->ocd_data) { in imx_usbmisc_probe()
198 if (sc->mmio != NULL) in imx_usbmisc_detach()
199 bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mmio); in imx_usbmisc_detach()
214 sc->mmio = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, in imx_usbmisc_attach()
216 if (sc->mmio == NULL) { in imx_usbmisc_attach()
244 * DEFAULT-1000 seems good.
247 0, 0, BUS_PASS_DEFAULT - 1000);
249 /*-----------------------------------------------------------------------------
251 *---------------------------------------------------------------------------*/
254 * Each EHCI device in the SoC has some SoC-specific per-device registers at an
268 {"fsl,imx6q-usb", 1},
269 {"fsl,imx53-usb", 1},
270 {"fsl,imx51-usb", 1},
271 {"fsl,imx28-usb", 1},
272 {"fsl,imx27-usb", 1},
273 {"fsl,imx25-usb", 1},
274 {"fsl,imx23-usb", 1},
297 if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { in imx_ehci_probe()
313 esc = &sc->ehci_softc; in imx_ehci_detach()
319 if (esc->sc_flags & EHCI_SCFLG_DONEINIT) in imx_ehci_detach()
321 if (esc->sc_intr_hdl != NULL) in imx_ehci_detach()
322 bus_teardown_intr(dev, esc->sc_irq_res, in imx_ehci_detach()
323 esc->sc_intr_hdl); in imx_ehci_detach()
324 if (sc->ehci_irq_res != NULL) in imx_ehci_detach()
326 sc->ehci_irq_res); in imx_ehci_detach()
327 if (sc->ehci_mem_res != NULL) in imx_ehci_detach()
329 sc->ehci_mem_res); in imx_ehci_detach()
331 usb_bus_mem_free_all(&esc->sc_bus, &ehci_iterate_hw_softc); in imx_ehci_detach()
346 node = ofw_bus_get_node(sc->dev); in imx_ehci_disable_oc()
350 device_printf(sc->dev, "failed to retrieve fsl,usbmisc " in imx_ehci_disable_oc()
357 device_printf(sc->dev, "usbmisc device not found, " in imx_ehci_disable_oc()
374 sc->dev = dev; in imx_ehci_attach()
375 esc = &sc->ehci_softc; in imx_ehci_attach()
380 sc->ehci_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, in imx_ehci_attach()
382 if (sc->ehci_mem_res == NULL) { in imx_ehci_attach()
389 sc->ehci_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, in imx_ehci_attach()
391 if (sc->ehci_irq_res == NULL) { in imx_ehci_attach()
397 esc->sc_io_tag = rman_get_bustag(sc->ehci_mem_res); in imx_ehci_attach()
398 esc->sc_bus.parent = dev; in imx_ehci_attach()
399 esc->sc_bus.devices = esc->sc_devices; in imx_ehci_attach()
400 esc->sc_bus.devices_max = EHCI_MAX_DEVICES; in imx_ehci_attach()
401 esc->sc_bus.dma_bits = 32; in imx_ehci_attach()
404 if (usb_bus_mem_alloc_all(&esc->sc_bus, USB_GET_DMA_TAG(dev), in imx_ehci_attach()
415 err = bus_space_subregion(esc->sc_io_tag, in imx_ehci_attach()
416 rman_get_bushandle(sc->ehci_mem_res), in imx_ehci_attach()
417 IMX_EHCI_REG_OFF, IMX_EHCI_REG_SIZE, &esc->sc_io_hdl); in imx_ehci_attach()
425 err = bus_setup_intr(dev, sc->ehci_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, in imx_ehci_attach()
426 NULL, (driver_intr_t *)ehci_interrupt, esc, &esc->sc_intr_hdl); in imx_ehci_attach()
436 if (OF_hasprop(ofw_bus_get_node(sc->dev), "disable-over-current")) in imx_ehci_attach()
440 esc->sc_bus.bdev = device_add_child(dev, "usbus", DEVICE_UNIT_ANY); in imx_ehci_attach()
441 if (esc->sc_bus.bdev == NULL) { in imx_ehci_attach()
445 device_set_ivars(esc->sc_bus.bdev, &esc->sc_bus); in imx_ehci_attach()
447 esc->sc_id_vendor = USB_VENDOR_FREESCALE; in imx_ehci_attach()
448 strlcpy(esc->sc_vendor, "Freescale", sizeof(esc->sc_vendor)); in imx_ehci_attach()
451 * Set flags that affect ehci_init() behavior, and hook our post-reset in imx_ehci_attach()
454 esc->sc_flags |= EHCI_SCFLG_NORESTERM | EHCI_SCFLG_TT; in imx_ehci_attach()
455 esc->sc_vendor_post_reset = imx_ehci_post_reset; in imx_ehci_attach()
456 esc->sc_vendor_get_port_speed = ehci_get_port_speed_portsc; in imx_ehci_attach()
464 esc->sc_flags |= EHCI_SCFLG_DONEINIT; in imx_ehci_attach()
467 err = device_probe_and_attach(esc->sc_bus.bdev); in imx_ehci_attach()