Patrick Delaunay | 22929e1 | 2018-10-26 09:02:52 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 2 | /* |
| 3 | * Generic DWC3 Glue layer |
| 4 | * |
| 5 | * Copyright (C) 2016 - 2018 Xilinx, Inc. |
| 6 | * |
| 7 | * Based on dwc3-omap.c. |
| 8 | */ |
| 9 | |
| 10 | #include <common.h> |
Jean-Jacques Hiblot | 93991cf | 2018-11-29 10:52:49 +0100 | [diff] [blame] | 11 | #include <asm-generic/io.h> |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 12 | #include <dm.h> |
| 13 | #include <dm/device-internal.h> |
| 14 | #include <dm/lists.h> |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 15 | #include <dwc3-uboot.h> |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 16 | #include <linux/usb/ch9.h> |
| 17 | #include <linux/usb/gadget.h> |
| 18 | #include <malloc.h> |
| 19 | #include <usb.h> |
| 20 | #include "core.h" |
| 21 | #include "gadget.h" |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 22 | #include <reset.h> |
| 23 | #include <clk.h> |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 24 | |
Jean-Jacques Hiblot | 3a38a0a | 2019-09-11 11:33:48 +0200 | [diff] [blame^] | 25 | struct dwc3_generic_plat { |
| 26 | fdt_addr_t base; |
| 27 | u32 maximum_speed; |
| 28 | enum usb_dr_mode dr_mode; |
| 29 | }; |
| 30 | |
Jean-Jacques Hiblot | 687ab54 | 2018-11-29 10:52:42 +0100 | [diff] [blame] | 31 | #if CONFIG_IS_ENABLED(DM_USB_GADGET) |
Jean-Jacques Hiblot | 3a38a0a | 2019-09-11 11:33:48 +0200 | [diff] [blame^] | 32 | struct dwc3_generic_priv { |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 33 | struct dwc3 dwc3; |
| 34 | struct phy *phys; |
| 35 | int num_phys; |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 36 | }; |
| 37 | |
Jean-Jacques Hiblot | ff8d755 | 2018-11-29 10:52:43 +0100 | [diff] [blame] | 38 | int dm_usb_gadget_handle_interrupts(struct udevice *dev) |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 39 | { |
Jean-Jacques Hiblot | 3a38a0a | 2019-09-11 11:33:48 +0200 | [diff] [blame^] | 40 | struct dwc3_generic_priv *priv = dev_get_priv(dev); |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 41 | struct dwc3 *dwc3 = &priv->dwc3; |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 42 | |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 43 | dwc3_gadget_uboot_handle_interrupt(dwc3); |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 44 | |
| 45 | return 0; |
| 46 | } |
| 47 | |
| 48 | static int dwc3_generic_peripheral_probe(struct udevice *dev) |
| 49 | { |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 50 | int rc; |
Jean-Jacques Hiblot | 3a38a0a | 2019-09-11 11:33:48 +0200 | [diff] [blame^] | 51 | struct dwc3_generic_priv *priv = dev_get_priv(dev); |
| 52 | struct dwc3_generic_plat *plat = dev_get_platdata(dev); |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 53 | struct dwc3 *dwc3 = &priv->dwc3; |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 54 | |
Jean-Jacques Hiblot | 3a38a0a | 2019-09-11 11:33:48 +0200 | [diff] [blame^] | 55 | dwc3->maximum_speed = plat->maximum_speed; |
| 56 | dwc3->dr_mode = plat->dr_mode; |
| 57 | |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 58 | rc = dwc3_setup_phy(dev, &priv->phys, &priv->num_phys); |
| 59 | if (rc) |
| 60 | return rc; |
| 61 | |
Jean-Jacques Hiblot | 3a38a0a | 2019-09-11 11:33:48 +0200 | [diff] [blame^] | 62 | dwc3->regs = map_physmem(plat->base, DWC3_OTG_REGS_END, MAP_NOCACHE); |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 63 | dwc3->regs += DWC3_GLOBALS_REGS_START; |
| 64 | dwc3->dev = dev; |
| 65 | |
| 66 | rc = dwc3_init(dwc3); |
| 67 | if (rc) { |
| 68 | unmap_physmem(dwc3->regs, MAP_NOCACHE); |
| 69 | return rc; |
| 70 | } |
| 71 | |
| 72 | return 0; |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 73 | } |
| 74 | |
| 75 | static int dwc3_generic_peripheral_remove(struct udevice *dev) |
| 76 | { |
Jean-Jacques Hiblot | 3a38a0a | 2019-09-11 11:33:48 +0200 | [diff] [blame^] | 77 | struct dwc3_generic_priv *priv = dev_get_priv(dev); |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 78 | struct dwc3 *dwc3 = &priv->dwc3; |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 79 | |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 80 | dwc3_remove(dwc3); |
| 81 | dwc3_shutdown_phy(dev, priv->phys, priv->num_phys); |
| 82 | unmap_physmem(dwc3->regs, MAP_NOCACHE); |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 83 | |
| 84 | return 0; |
| 85 | } |
| 86 | |
| 87 | static int dwc3_generic_peripheral_ofdata_to_platdata(struct udevice *dev) |
| 88 | { |
Jean-Jacques Hiblot | 3a38a0a | 2019-09-11 11:33:48 +0200 | [diff] [blame^] | 89 | struct dwc3_generic_plat *plat = dev_get_platdata(dev); |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 90 | int node = dev_of_offset(dev); |
| 91 | |
Jean-Jacques Hiblot | 3a38a0a | 2019-09-11 11:33:48 +0200 | [diff] [blame^] | 92 | plat->base = devfdt_get_addr(dev); |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 93 | |
Jean-Jacques Hiblot | 3a38a0a | 2019-09-11 11:33:48 +0200 | [diff] [blame^] | 94 | plat->maximum_speed = usb_get_maximum_speed(node); |
| 95 | if (plat->maximum_speed == USB_SPEED_UNKNOWN) { |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 96 | pr_err("Invalid usb maximum speed\n"); |
| 97 | return -ENODEV; |
| 98 | } |
| 99 | |
Jean-Jacques Hiblot | 3a38a0a | 2019-09-11 11:33:48 +0200 | [diff] [blame^] | 100 | plat->dr_mode = usb_get_dr_mode(node); |
| 101 | if (plat->dr_mode == USB_DR_MODE_UNKNOWN) { |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 102 | pr_err("Invalid usb mode setup\n"); |
| 103 | return -ENODEV; |
| 104 | } |
| 105 | |
| 106 | return 0; |
| 107 | } |
| 108 | |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 109 | U_BOOT_DRIVER(dwc3_generic_peripheral) = { |
| 110 | .name = "dwc3-generic-peripheral", |
Jean-Jacques Hiblot | 0131162 | 2018-11-29 10:52:46 +0100 | [diff] [blame] | 111 | .id = UCLASS_USB_GADGET_GENERIC, |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 112 | .ofdata_to_platdata = dwc3_generic_peripheral_ofdata_to_platdata, |
| 113 | .probe = dwc3_generic_peripheral_probe, |
| 114 | .remove = dwc3_generic_peripheral_remove, |
Jean-Jacques Hiblot | 3a38a0a | 2019-09-11 11:33:48 +0200 | [diff] [blame^] | 115 | .priv_auto_alloc_size = sizeof(struct dwc3_generic_priv), |
| 116 | .platdata_auto_alloc_size = sizeof(struct dwc3_generic_plat), |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 117 | }; |
Jean-Jacques Hiblot | 687ab54 | 2018-11-29 10:52:42 +0100 | [diff] [blame] | 118 | #endif |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 119 | |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 120 | struct dwc3_glue_data { |
| 121 | struct clk_bulk clks; |
| 122 | struct reset_ctl_bulk resets; |
Jean-Jacques Hiblot | 93991cf | 2018-11-29 10:52:49 +0100 | [diff] [blame] | 123 | fdt_addr_t regs; |
| 124 | }; |
| 125 | |
| 126 | struct dwc3_glue_ops { |
| 127 | void (*select_dr_mode)(struct udevice *dev, int index, |
| 128 | enum usb_dr_mode mode); |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 129 | }; |
| 130 | |
Jean-Jacques Hiblot | d66e54a | 2018-11-29 10:57:40 +0100 | [diff] [blame] | 131 | void dwc3_ti_select_dr_mode(struct udevice *dev, int index, |
| 132 | enum usb_dr_mode mode) |
| 133 | { |
| 134 | #define USBOTGSS_UTMI_OTG_STATUS 0x0084 |
| 135 | #define USBOTGSS_UTMI_OTG_OFFSET 0x0480 |
| 136 | |
| 137 | /* UTMI_OTG_STATUS REGISTER */ |
| 138 | #define USBOTGSS_UTMI_OTG_STATUS_SW_MODE BIT(31) |
| 139 | #define USBOTGSS_UTMI_OTG_STATUS_POWERPRESENT BIT(9) |
| 140 | #define USBOTGSS_UTMI_OTG_STATUS_TXBITSTUFFENABLE BIT(8) |
| 141 | #define USBOTGSS_UTMI_OTG_STATUS_IDDIG BIT(4) |
| 142 | #define USBOTGSS_UTMI_OTG_STATUS_SESSEND BIT(3) |
| 143 | #define USBOTGSS_UTMI_OTG_STATUS_SESSVALID BIT(2) |
| 144 | #define USBOTGSS_UTMI_OTG_STATUS_VBUSVALID BIT(1) |
| 145 | enum dwc3_omap_utmi_mode { |
| 146 | DWC3_OMAP_UTMI_MODE_UNKNOWN = 0, |
| 147 | DWC3_OMAP_UTMI_MODE_HW, |
| 148 | DWC3_OMAP_UTMI_MODE_SW, |
| 149 | }; |
| 150 | |
| 151 | u32 use_id_pin; |
| 152 | u32 host_mode; |
| 153 | u32 reg; |
| 154 | u32 utmi_mode; |
| 155 | u32 utmi_status_offset = USBOTGSS_UTMI_OTG_STATUS; |
| 156 | |
| 157 | struct dwc3_glue_data *glue = dev_get_platdata(dev); |
| 158 | void *base = map_physmem(glue->regs, 0x10000, MAP_NOCACHE); |
| 159 | |
| 160 | if (device_is_compatible(dev, "ti,am437x-dwc3")) |
| 161 | utmi_status_offset += USBOTGSS_UTMI_OTG_OFFSET; |
| 162 | |
| 163 | utmi_mode = dev_read_u32_default(dev, "utmi-mode", |
| 164 | DWC3_OMAP_UTMI_MODE_UNKNOWN); |
| 165 | if (utmi_mode != DWC3_OMAP_UTMI_MODE_HW) { |
| 166 | debug("%s: OTG is not supported. defaulting to PERIPHERAL\n", |
| 167 | dev->name); |
| 168 | mode = USB_DR_MODE_PERIPHERAL; |
| 169 | } |
| 170 | |
| 171 | switch (mode) { |
| 172 | case USB_DR_MODE_PERIPHERAL: |
| 173 | use_id_pin = 0; |
| 174 | host_mode = 0; |
| 175 | break; |
| 176 | case USB_DR_MODE_HOST: |
| 177 | use_id_pin = 0; |
| 178 | host_mode = 1; |
| 179 | break; |
| 180 | case USB_DR_MODE_OTG: |
| 181 | default: |
| 182 | use_id_pin = 1; |
| 183 | host_mode = 0; |
| 184 | break; |
| 185 | } |
| 186 | |
| 187 | reg = readl(base + utmi_status_offset); |
| 188 | |
| 189 | reg &= ~(USBOTGSS_UTMI_OTG_STATUS_SW_MODE); |
| 190 | if (!use_id_pin) |
| 191 | reg |= USBOTGSS_UTMI_OTG_STATUS_SW_MODE; |
| 192 | |
| 193 | writel(reg, base + utmi_status_offset); |
| 194 | |
| 195 | reg &= ~(USBOTGSS_UTMI_OTG_STATUS_SESSEND | |
| 196 | USBOTGSS_UTMI_OTG_STATUS_VBUSVALID | |
| 197 | USBOTGSS_UTMI_OTG_STATUS_IDDIG); |
| 198 | |
| 199 | reg |= USBOTGSS_UTMI_OTG_STATUS_SESSVALID | |
| 200 | USBOTGSS_UTMI_OTG_STATUS_POWERPRESENT; |
| 201 | |
| 202 | if (!host_mode) |
| 203 | reg |= USBOTGSS_UTMI_OTG_STATUS_IDDIG | |
| 204 | USBOTGSS_UTMI_OTG_STATUS_VBUSVALID; |
| 205 | |
| 206 | writel(reg, base + utmi_status_offset); |
| 207 | |
| 208 | unmap_physmem(base, MAP_NOCACHE); |
| 209 | } |
| 210 | |
| 211 | struct dwc3_glue_ops ti_ops = { |
| 212 | .select_dr_mode = dwc3_ti_select_dr_mode, |
| 213 | }; |
| 214 | |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 215 | static int dwc3_glue_bind(struct udevice *parent) |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 216 | { |
| 217 | const void *fdt = gd->fdt_blob; |
| 218 | int node; |
| 219 | int ret; |
| 220 | |
| 221 | for (node = fdt_first_subnode(fdt, dev_of_offset(parent)); node > 0; |
| 222 | node = fdt_next_subnode(fdt, node)) { |
| 223 | const char *name = fdt_get_name(fdt, node, NULL); |
| 224 | enum usb_dr_mode dr_mode; |
| 225 | struct udevice *dev; |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 226 | const char *driver = NULL; |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 227 | |
| 228 | debug("%s: subnode name: %s\n", __func__, name); |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 229 | |
| 230 | dr_mode = usb_get_dr_mode(node); |
| 231 | |
| 232 | switch (dr_mode) { |
| 233 | case USB_DR_MODE_PERIPHERAL: |
| 234 | case USB_DR_MODE_OTG: |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 235 | #if CONFIG_IS_ENABLED(DM_USB_GADGET) |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 236 | debug("%s: dr_mode: OTG or Peripheral\n", __func__); |
| 237 | driver = "dwc3-generic-peripheral"; |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 238 | #endif |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 239 | break; |
| 240 | case USB_DR_MODE_HOST: |
| 241 | debug("%s: dr_mode: HOST\n", __func__); |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 242 | driver = "xhci-dwc3"; |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 243 | break; |
| 244 | default: |
| 245 | debug("%s: unsupported dr_mode\n", __func__); |
| 246 | return -ENODEV; |
| 247 | }; |
| 248 | |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 249 | if (!driver) |
| 250 | continue; |
| 251 | |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 252 | ret = device_bind_driver_to_node(parent, driver, name, |
| 253 | offset_to_ofnode(node), &dev); |
| 254 | if (ret) { |
| 255 | debug("%s: not able to bind usb device mode\n", |
| 256 | __func__); |
| 257 | return ret; |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | return 0; |
| 262 | } |
| 263 | |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 264 | static int dwc3_glue_reset_init(struct udevice *dev, |
| 265 | struct dwc3_glue_data *glue) |
| 266 | { |
| 267 | int ret; |
| 268 | |
| 269 | ret = reset_get_bulk(dev, &glue->resets); |
| 270 | if (ret == -ENOTSUPP) |
| 271 | return 0; |
| 272 | else if (ret) |
| 273 | return ret; |
| 274 | |
| 275 | ret = reset_deassert_bulk(&glue->resets); |
| 276 | if (ret) { |
| 277 | reset_release_bulk(&glue->resets); |
| 278 | return ret; |
| 279 | } |
| 280 | |
| 281 | return 0; |
| 282 | } |
| 283 | |
| 284 | static int dwc3_glue_clk_init(struct udevice *dev, |
| 285 | struct dwc3_glue_data *glue) |
| 286 | { |
| 287 | int ret; |
| 288 | |
| 289 | ret = clk_get_bulk(dev, &glue->clks); |
| 290 | if (ret == -ENOSYS) |
| 291 | return 0; |
| 292 | if (ret) |
| 293 | return ret; |
| 294 | |
| 295 | #if CONFIG_IS_ENABLED(CLK) |
| 296 | ret = clk_enable_bulk(&glue->clks); |
| 297 | if (ret) { |
| 298 | clk_release_bulk(&glue->clks); |
| 299 | return ret; |
| 300 | } |
| 301 | #endif |
| 302 | |
| 303 | return 0; |
| 304 | } |
| 305 | |
| 306 | static int dwc3_glue_probe(struct udevice *dev) |
| 307 | { |
Jean-Jacques Hiblot | 93991cf | 2018-11-29 10:52:49 +0100 | [diff] [blame] | 308 | struct dwc3_glue_ops *ops = (struct dwc3_glue_ops *)dev_get_driver_data(dev); |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 309 | struct dwc3_glue_data *glue = dev_get_platdata(dev); |
Jean-Jacques Hiblot | 93991cf | 2018-11-29 10:52:49 +0100 | [diff] [blame] | 310 | struct udevice *child = NULL; |
| 311 | int index = 0; |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 312 | int ret; |
| 313 | |
Jean-Jacques Hiblot | 93991cf | 2018-11-29 10:52:49 +0100 | [diff] [blame] | 314 | glue->regs = dev_read_addr(dev); |
| 315 | |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 316 | ret = dwc3_glue_clk_init(dev, glue); |
| 317 | if (ret) |
| 318 | return ret; |
| 319 | |
| 320 | ret = dwc3_glue_reset_init(dev, glue); |
| 321 | if (ret) |
| 322 | return ret; |
| 323 | |
Jean-Jacques Hiblot | 93991cf | 2018-11-29 10:52:49 +0100 | [diff] [blame] | 324 | ret = device_find_first_child(dev, &child); |
| 325 | if (ret) |
| 326 | return ret; |
| 327 | |
| 328 | while (child) { |
| 329 | enum usb_dr_mode dr_mode; |
| 330 | |
| 331 | dr_mode = usb_get_dr_mode(dev_of_offset(child)); |
| 332 | device_find_next_child(&child); |
| 333 | if (ops && ops->select_dr_mode) |
| 334 | ops->select_dr_mode(dev, index, dr_mode); |
| 335 | index++; |
| 336 | } |
| 337 | |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 338 | return 0; |
| 339 | } |
| 340 | |
| 341 | static int dwc3_glue_remove(struct udevice *dev) |
| 342 | { |
| 343 | struct dwc3_glue_data *glue = dev_get_platdata(dev); |
| 344 | |
| 345 | reset_release_bulk(&glue->resets); |
| 346 | |
| 347 | clk_release_bulk(&glue->clks); |
| 348 | |
Jean-Jacques Hiblot | e445d46 | 2019-07-05 09:33:56 +0200 | [diff] [blame] | 349 | return 0; |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 350 | } |
| 351 | |
| 352 | static const struct udevice_id dwc3_glue_ids[] = { |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 353 | { .compatible = "xlnx,zynqmp-dwc3" }, |
Jean-Jacques Hiblot | 1c03ade | 2018-12-04 11:12:56 +0100 | [diff] [blame] | 354 | { .compatible = "ti,keystone-dwc3"}, |
Jean-Jacques Hiblot | d66e54a | 2018-11-29 10:57:40 +0100 | [diff] [blame] | 355 | { .compatible = "ti,dwc3", .data = (ulong)&ti_ops }, |
Jean-Jacques Hiblot | 1ce5f1f | 2018-12-04 11:30:50 +0100 | [diff] [blame] | 356 | { .compatible = "ti,am437x-dwc3", .data = (ulong)&ti_ops }, |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 357 | { } |
| 358 | }; |
| 359 | |
| 360 | U_BOOT_DRIVER(dwc3_generic_wrapper) = { |
| 361 | .name = "dwc3-generic-wrapper", |
Jean-Jacques Hiblot | 3b83829 | 2019-07-05 09:33:58 +0200 | [diff] [blame] | 362 | .id = UCLASS_NOP, |
Jean-Jacques Hiblot | 446e3a2 | 2018-11-29 10:52:48 +0100 | [diff] [blame] | 363 | .of_match = dwc3_glue_ids, |
| 364 | .bind = dwc3_glue_bind, |
| 365 | .probe = dwc3_glue_probe, |
| 366 | .remove = dwc3_glue_remove, |
| 367 | .platdata_auto_alloc_size = sizeof(struct dwc3_glue_data), |
| 368 | |
Michal Simek | 49d6745 | 2018-05-18 13:15:06 +0200 | [diff] [blame] | 369 | }; |