Lines Matching refs:dwc
40 static void dwc3_set_mode(struct dwc3 *dwc, u32 mode) in dwc3_set_mode() argument
44 reg = dwc3_readl(dwc->regs, DWC3_GCTL); in dwc3_set_mode()
47 dwc3_writel(dwc->regs, DWC3_GCTL, reg); in dwc3_set_mode()
54 static int dwc3_core_soft_reset(struct dwc3 *dwc) in dwc3_core_soft_reset() argument
59 reg = dwc3_readl(dwc->regs, DWC3_GCTL); in dwc3_core_soft_reset()
61 dwc3_writel(dwc->regs, DWC3_GCTL, reg); in dwc3_core_soft_reset()
64 reg = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0)); in dwc3_core_soft_reset()
66 dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg); in dwc3_core_soft_reset()
69 reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)); in dwc3_core_soft_reset()
71 dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); in dwc3_core_soft_reset()
76 reg = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0)); in dwc3_core_soft_reset()
78 dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg); in dwc3_core_soft_reset()
81 reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)); in dwc3_core_soft_reset()
83 dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); in dwc3_core_soft_reset()
88 reg = dwc3_readl(dwc->regs, DWC3_GCTL); in dwc3_core_soft_reset()
90 dwc3_writel(dwc->regs, DWC3_GCTL, reg); in dwc3_core_soft_reset()
100 static void dwc3_free_one_event_buffer(struct dwc3 *dwc, in dwc3_free_one_event_buffer() argument
114 static struct dwc3_event_buffer *dwc3_alloc_one_event_buffer(struct dwc3 *dwc, in dwc3_alloc_one_event_buffer() argument
119 evt = devm_kzalloc((struct udevice *)dwc->dev, sizeof(*evt), in dwc3_alloc_one_event_buffer()
124 evt->dwc = dwc; in dwc3_alloc_one_event_buffer()
140 static void dwc3_free_event_buffers(struct dwc3 *dwc) in dwc3_free_event_buffers() argument
145 for (i = 0; i < dwc->num_event_buffers; i++) { in dwc3_free_event_buffers()
146 evt = dwc->ev_buffs[i]; in dwc3_free_event_buffers()
148 dwc3_free_one_event_buffer(dwc, evt); in dwc3_free_event_buffers()
160 static int dwc3_alloc_event_buffers(struct dwc3 *dwc, unsigned length) in dwc3_alloc_event_buffers() argument
165 num = DWC3_NUM_INT(dwc->hwparams.hwparams1); in dwc3_alloc_event_buffers()
166 dwc->num_event_buffers = num; in dwc3_alloc_event_buffers()
168 dwc->ev_buffs = memalign(CONFIG_SYS_CACHELINE_SIZE, in dwc3_alloc_event_buffers()
169 sizeof(*dwc->ev_buffs) * num); in dwc3_alloc_event_buffers()
170 if (!dwc->ev_buffs) in dwc3_alloc_event_buffers()
176 evt = dwc3_alloc_one_event_buffer(dwc, length); in dwc3_alloc_event_buffers()
178 dev_err(dwc->dev, "can't allocate event buffer\n"); in dwc3_alloc_event_buffers()
181 dwc->ev_buffs[i] = evt; in dwc3_alloc_event_buffers()
193 static int dwc3_event_buffers_setup(struct dwc3 *dwc) in dwc3_event_buffers_setup() argument
198 for (n = 0; n < dwc->num_event_buffers; n++) { in dwc3_event_buffers_setup()
199 evt = dwc->ev_buffs[n]; in dwc3_event_buffers_setup()
200 dev_dbg(dwc->dev, "Event buf %p dma %08llx length %d\n", in dwc3_event_buffers_setup()
206 dwc3_writel(dwc->regs, DWC3_GEVNTADRLO(n), in dwc3_event_buffers_setup()
208 dwc3_writel(dwc->regs, DWC3_GEVNTADRHI(n), in dwc3_event_buffers_setup()
210 dwc3_writel(dwc->regs, DWC3_GEVNTSIZ(n), in dwc3_event_buffers_setup()
212 dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(n), 0); in dwc3_event_buffers_setup()
218 static void dwc3_event_buffers_cleanup(struct dwc3 *dwc) in dwc3_event_buffers_cleanup() argument
223 for (n = 0; n < dwc->num_event_buffers; n++) { in dwc3_event_buffers_cleanup()
224 evt = dwc->ev_buffs[n]; in dwc3_event_buffers_cleanup()
228 dwc3_writel(dwc->regs, DWC3_GEVNTADRLO(n), 0); in dwc3_event_buffers_cleanup()
229 dwc3_writel(dwc->regs, DWC3_GEVNTADRHI(n), 0); in dwc3_event_buffers_cleanup()
230 dwc3_writel(dwc->regs, DWC3_GEVNTSIZ(n), DWC3_GEVNTSIZ_INTMASK in dwc3_event_buffers_cleanup()
232 dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(n), 0); in dwc3_event_buffers_cleanup()
236 static int dwc3_alloc_scratch_buffers(struct dwc3 *dwc) in dwc3_alloc_scratch_buffers() argument
238 if (!dwc->has_hibernation) in dwc3_alloc_scratch_buffers()
241 if (!dwc->nr_scratch) in dwc3_alloc_scratch_buffers()
244 dwc->scratchbuf = kmalloc_array(dwc->nr_scratch, in dwc3_alloc_scratch_buffers()
246 if (!dwc->scratchbuf) in dwc3_alloc_scratch_buffers()
252 static int dwc3_setup_scratch_buffers(struct dwc3 *dwc) in dwc3_setup_scratch_buffers() argument
258 if (!dwc->has_hibernation) in dwc3_setup_scratch_buffers()
261 if (!dwc->nr_scratch) in dwc3_setup_scratch_buffers()
264 scratch_addr = dma_map_single(dwc->scratchbuf, in dwc3_setup_scratch_buffers()
265 dwc->nr_scratch * DWC3_SCRATCHBUF_SIZE, in dwc3_setup_scratch_buffers()
267 if (dma_mapping_error(dwc->dev, scratch_addr)) { in dwc3_setup_scratch_buffers()
268 dev_err(dwc->dev, "failed to map scratch buffer\n"); in dwc3_setup_scratch_buffers()
273 dwc->scratch_addr = scratch_addr; in dwc3_setup_scratch_buffers()
277 ret = dwc3_send_gadget_generic_command(dwc, in dwc3_setup_scratch_buffers()
284 ret = dwc3_send_gadget_generic_command(dwc, in dwc3_setup_scratch_buffers()
292 dma_unmap_single((void *)(uintptr_t)dwc->scratch_addr, dwc->nr_scratch * in dwc3_setup_scratch_buffers()
299 static void dwc3_free_scratch_buffers(struct dwc3 *dwc) in dwc3_free_scratch_buffers() argument
301 if (!dwc->has_hibernation) in dwc3_free_scratch_buffers()
304 if (!dwc->nr_scratch) in dwc3_free_scratch_buffers()
307 dma_unmap_single((void *)(uintptr_t)dwc->scratch_addr, dwc->nr_scratch * in dwc3_free_scratch_buffers()
309 kfree(dwc->scratchbuf); in dwc3_free_scratch_buffers()
312 static void dwc3_core_num_eps(struct dwc3 *dwc) in dwc3_core_num_eps() argument
314 struct dwc3_hwparams *parms = &dwc->hwparams; in dwc3_core_num_eps()
316 dwc->num_in_eps = DWC3_NUM_IN_EPS(parms); in dwc3_core_num_eps()
317 dwc->num_out_eps = DWC3_NUM_EPS(parms) - dwc->num_in_eps; in dwc3_core_num_eps()
319 dev_vdbg(dwc->dev, "found %d IN and %d OUT endpoints\n", in dwc3_core_num_eps()
320 dwc->num_in_eps, dwc->num_out_eps); in dwc3_core_num_eps()
323 static void dwc3_cache_hwparams(struct dwc3 *dwc) in dwc3_cache_hwparams() argument
325 struct dwc3_hwparams *parms = &dwc->hwparams; in dwc3_cache_hwparams()
327 parms->hwparams0 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS0); in dwc3_cache_hwparams()
328 parms->hwparams1 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS1); in dwc3_cache_hwparams()
329 parms->hwparams2 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS2); in dwc3_cache_hwparams()
330 parms->hwparams3 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS3); in dwc3_cache_hwparams()
331 parms->hwparams4 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS4); in dwc3_cache_hwparams()
332 parms->hwparams5 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS5); in dwc3_cache_hwparams()
333 parms->hwparams6 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS6); in dwc3_cache_hwparams()
334 parms->hwparams7 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS7); in dwc3_cache_hwparams()
335 parms->hwparams8 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS8); in dwc3_cache_hwparams()
338 static void dwc3_hsphy_mode_setup(struct dwc3 *dwc) in dwc3_hsphy_mode_setup() argument
340 enum usb_phy_interface hsphy_mode = dwc->hsphy_mode; in dwc3_hsphy_mode_setup()
344 reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)); in dwc3_hsphy_mode_setup()
363 dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); in dwc3_hsphy_mode_setup()
370 static void dwc3_phy_setup(struct dwc3 *dwc) in dwc3_phy_setup() argument
374 reg = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0)); in dwc3_phy_setup()
382 if (dwc->revision > DWC3_REVISION_194A) in dwc3_phy_setup()
385 if (dwc->u2ss_inp3_quirk) in dwc3_phy_setup()
388 if (dwc->req_p1p2p3_quirk) in dwc3_phy_setup()
391 if (dwc->del_p1p2p3_quirk) in dwc3_phy_setup()
394 if (dwc->del_phy_power_chg_quirk) in dwc3_phy_setup()
397 if (dwc->lfps_filter_quirk) in dwc3_phy_setup()
400 if (dwc->rx_detect_poll_quirk) in dwc3_phy_setup()
403 if (dwc->tx_de_emphasis_quirk) in dwc3_phy_setup()
404 reg |= DWC3_GUSB3PIPECTL_TX_DEEPH(dwc->tx_de_emphasis); in dwc3_phy_setup()
411 if (dwc->dis_u3_susphy_quirk || CONFIG_IS_ENABLED(ARCH_ROCKCHIP)) in dwc3_phy_setup()
414 dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg); in dwc3_phy_setup()
416 dwc3_hsphy_mode_setup(dwc); in dwc3_phy_setup()
420 reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)); in dwc3_phy_setup()
428 if (dwc->revision > DWC3_REVISION_194A) in dwc3_phy_setup()
431 if (dwc->dis_u2_susphy_quirk || CONFIG_IS_ENABLED(ARCH_ROCKCHIP)) in dwc3_phy_setup()
434 if (dwc->dis_enblslpm_quirk) in dwc3_phy_setup()
437 if (dwc->dis_u2_freeclk_exists_quirk) in dwc3_phy_setup()
440 if (dwc->usb2_phyif_utmi_width == 16) { in dwc3_phy_setup()
446 dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); in dwc3_phy_setup()
457 static int dwc3_core_init(struct dwc3 *dwc) in dwc3_core_init() argument
460 u32 hwparams4 = dwc->hwparams.hwparams4; in dwc3_core_init()
464 reg = dwc3_readl(dwc->regs, DWC3_GSNPSID); in dwc3_core_init()
467 dev_err(dwc->dev, "this is not a DesignWare USB3 DRD Core\n"); in dwc3_core_init()
471 dwc->revision = reg; in dwc3_core_init()
474 if (DWC3_GHWPARAMS3_SSPHY_IFC(dwc->hwparams.hwparams3) == in dwc3_core_init()
476 if (dwc->maximum_speed == USB_SPEED_SUPER) in dwc3_core_init()
477 dwc->maximum_speed = USB_SPEED_HIGH; in dwc3_core_init()
482 dwc3_writel(dwc->regs, DWC3_DCTL, DWC3_DCTL_CSFTRST); in dwc3_core_init()
484 reg = dwc3_readl(dwc->regs, DWC3_DCTL); in dwc3_core_init()
490 dev_err(dwc->dev, "Reset Timed Out\n"); in dwc3_core_init()
495 ret = dwc3_core_soft_reset(dwc); in dwc3_core_init()
499 if (dwc->revision >= DWC3_REVISION_250A) { in dwc3_core_init()
500 reg = dwc3_readl(dwc->regs, DWC3_GUCTL1); in dwc3_core_init()
502 if (dwc->maximum_speed == USB_SPEED_HIGH || in dwc3_core_init()
503 dwc->maximum_speed == USB_SPEED_FULL) in dwc3_core_init()
506 dwc3_writel(dwc->regs, DWC3_GUCTL1, reg); in dwc3_core_init()
509 reg = dwc3_readl(dwc->regs, DWC3_GCTL); in dwc3_core_init()
512 switch (DWC3_GHWPARAMS1_EN_PWROPT(dwc->hwparams.hwparams1)) { in dwc3_core_init()
526 if ((dwc->dr_mode == USB_DR_MODE_HOST || in dwc3_core_init()
527 dwc->dr_mode == USB_DR_MODE_OTG) && in dwc3_core_init()
528 (dwc->revision >= DWC3_REVISION_210A && in dwc3_core_init()
529 dwc->revision <= DWC3_REVISION_250A)) in dwc3_core_init()
536 dwc->nr_scratch = DWC3_GHWPARAMS4_HIBER_SCRATCHBUFS(hwparams4); in dwc3_core_init()
545 dev_dbg(dwc->dev, "No power optimization available\n"); in dwc3_core_init()
549 if (dwc->hwparams.hwparams6 & DWC3_GHWPARAMS6_EN_FPGA) { in dwc3_core_init()
550 dev_dbg(dwc->dev, "it is on FPGA board\n"); in dwc3_core_init()
551 dwc->is_fpga = true; in dwc3_core_init()
554 if(dwc->disable_scramble_quirk && !dwc->is_fpga) in dwc3_core_init()
558 if (dwc->disable_scramble_quirk && dwc->is_fpga) in dwc3_core_init()
563 if (dwc->u2exit_lfps_quirk) in dwc3_core_init()
572 if (dwc->revision < DWC3_REVISION_190A) in dwc3_core_init()
575 dwc3_core_num_eps(dwc); in dwc3_core_init()
577 dwc3_writel(dwc->regs, DWC3_GCTL, reg); in dwc3_core_init()
579 dwc3_phy_setup(dwc); in dwc3_core_init()
581 ret = dwc3_alloc_scratch_buffers(dwc); in dwc3_core_init()
585 ret = dwc3_setup_scratch_buffers(dwc); in dwc3_core_init()
592 dwc3_free_scratch_buffers(dwc); in dwc3_core_init()
598 static void dwc3_core_exit(struct dwc3 *dwc) in dwc3_core_exit() argument
600 dwc3_free_scratch_buffers(dwc); in dwc3_core_exit()
603 static int dwc3_core_init_mode(struct dwc3 *dwc) in dwc3_core_init_mode() argument
607 switch (dwc->dr_mode) { in dwc3_core_init_mode()
609 dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_DEVICE); in dwc3_core_init_mode()
610 ret = dwc3_gadget_init(dwc); in dwc3_core_init_mode()
617 dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_HOST); in dwc3_core_init_mode()
618 ret = dwc3_host_init(dwc); in dwc3_core_init_mode()
625 dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_OTG); in dwc3_core_init_mode()
626 ret = dwc3_host_init(dwc); in dwc3_core_init_mode()
632 ret = dwc3_gadget_init(dwc); in dwc3_core_init_mode()
639 dev_err(dev, "Unsupported mode of operation %d\n", dwc->dr_mode); in dwc3_core_init_mode()
646 static void dwc3_gadget_run(struct dwc3 *dwc) in dwc3_gadget_run() argument
648 dwc3_writel(dwc->regs, DWC3_DCTL, DWC3_DCTL_RUN_STOP); in dwc3_gadget_run()
652 static void dwc3_core_exit_mode(struct dwc3 *dwc) in dwc3_core_exit_mode() argument
654 switch (dwc->dr_mode) { in dwc3_core_exit_mode()
656 dwc3_gadget_exit(dwc); in dwc3_core_exit_mode()
659 dwc3_host_exit(dwc); in dwc3_core_exit_mode()
662 dwc3_host_exit(dwc); in dwc3_core_exit_mode()
663 dwc3_gadget_exit(dwc); in dwc3_core_exit_mode()
674 dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_DEVICE); in dwc3_core_exit_mode()
675 dwc3_gadget_run(dwc); in dwc3_core_exit_mode()
693 struct dwc3 *dwc; in dwc3_uboot_init() local
706 sizeof(*dwc) + DWC3_ALIGN_MASK, GFP_KERNEL); in dwc3_uboot_init()
710 dwc = PTR_ALIGN(mem, DWC3_ALIGN_MASK + 1); in dwc3_uboot_init()
711 dwc->mem = mem; in dwc3_uboot_init()
713 dwc->regs = (void *)(uintptr_t)(dwc3_dev->base + in dwc3_uboot_init()
728 dwc->check_linksts = true; in dwc3_uboot_init()
729 dwc->ts = get_timer(0); in dwc3_uboot_init()
730 dwc->maximum_speed = dwc3_dev->maximum_speed; in dwc3_uboot_init()
731 dwc->has_lpm_erratum = dwc3_dev->has_lpm_erratum; in dwc3_uboot_init()
734 dwc->is_utmi_l1_suspend = dwc3_dev->is_utmi_l1_suspend; in dwc3_uboot_init()
738 dwc->needs_fifo_resize = dwc3_dev->tx_fifo_resize; in dwc3_uboot_init()
739 dwc->dr_mode = dwc3_dev->dr_mode; in dwc3_uboot_init()
741 dwc->disable_scramble_quirk = dwc3_dev->disable_scramble_quirk; in dwc3_uboot_init()
742 dwc->u2exit_lfps_quirk = dwc3_dev->u2exit_lfps_quirk; in dwc3_uboot_init()
743 dwc->u2ss_inp3_quirk = dwc3_dev->u2ss_inp3_quirk; in dwc3_uboot_init()
744 dwc->req_p1p2p3_quirk = dwc3_dev->req_p1p2p3_quirk; in dwc3_uboot_init()
745 dwc->del_p1p2p3_quirk = dwc3_dev->del_p1p2p3_quirk; in dwc3_uboot_init()
746 dwc->del_phy_power_chg_quirk = dwc3_dev->del_phy_power_chg_quirk; in dwc3_uboot_init()
747 dwc->lfps_filter_quirk = dwc3_dev->lfps_filter_quirk; in dwc3_uboot_init()
748 dwc->rx_detect_poll_quirk = dwc3_dev->rx_detect_poll_quirk; in dwc3_uboot_init()
749 dwc->dis_u3_susphy_quirk = dwc3_dev->dis_u3_susphy_quirk; in dwc3_uboot_init()
750 dwc->dis_u2_susphy_quirk = dwc3_dev->dis_u2_susphy_quirk; in dwc3_uboot_init()
751 dwc->dis_u1u2_quirk = dwc3_dev->dis_u2_susphy_quirk; in dwc3_uboot_init()
753 dwc->tx_de_emphasis_quirk = dwc3_dev->tx_de_emphasis_quirk; in dwc3_uboot_init()
758 if (dwc->maximum_speed == USB_SPEED_UNKNOWN) in dwc3_uboot_init()
759 dwc->maximum_speed = USB_SPEED_SUPER; in dwc3_uboot_init()
760 else if (dwc->maximum_speed == USB_SPEED_SUPER && in dwc3_uboot_init()
762 dwc->maximum_speed = USB_SPEED_HIGH; in dwc3_uboot_init()
764 dwc->lpm_nyet_threshold = lpm_nyet_threshold; in dwc3_uboot_init()
765 dwc->tx_de_emphasis = tx_de_emphasis; in dwc3_uboot_init()
767 dwc->hird_threshold = hird_threshold in dwc3_uboot_init()
768 | (dwc->is_utmi_l1_suspend << 4); in dwc3_uboot_init()
770 dwc->hsphy_mode = dwc3_dev->hsphy_mode; in dwc3_uboot_init()
772 dwc->index = dwc3_dev->index; in dwc3_uboot_init()
775 dwc->usb2_phyif_utmi_width = dwc3_dev->usb2_phyif_utmi_width; in dwc3_uboot_init()
782 dwc->usb2_phyif_utmi_width = in dwc3_uboot_init()
785 dwc3_cache_hwparams(dwc); in dwc3_uboot_init()
787 ret = dwc3_alloc_event_buffers(dwc, DWC3_EVENT_BUFFERS_SIZE); in dwc3_uboot_init()
789 dev_err(dwc->dev, "failed to allocate event buffers\n"); in dwc3_uboot_init()
794 dwc->dr_mode = USB_DR_MODE_HOST; in dwc3_uboot_init()
796 dwc->dr_mode = USB_DR_MODE_PERIPHERAL; in dwc3_uboot_init()
798 if (dwc->dr_mode == USB_DR_MODE_UNKNOWN) in dwc3_uboot_init()
799 dwc->dr_mode = USB_DR_MODE_OTG; in dwc3_uboot_init()
801 ret = dwc3_core_init(dwc); in dwc3_uboot_init()
807 ret = dwc3_event_buffers_setup(dwc); in dwc3_uboot_init()
809 dev_err(dwc->dev, "failed to setup event buffers\n"); in dwc3_uboot_init()
813 ret = dwc3_core_init_mode(dwc); in dwc3_uboot_init()
817 list_add_tail(&dwc->list, &dwc3_list); in dwc3_uboot_init()
822 dwc3_event_buffers_cleanup(dwc); in dwc3_uboot_init()
825 dwc3_core_exit(dwc); in dwc3_uboot_init()
828 dwc3_free_event_buffers(dwc); in dwc3_uboot_init()
846 struct dwc3 *dwc; in dwc3_uboot_exit() local
848 list_for_each_entry(dwc, &dwc3_list, list) { in dwc3_uboot_exit()
849 if (dwc->index != index) in dwc3_uboot_exit()
852 dwc3_core_exit_mode(dwc); in dwc3_uboot_exit()
853 dwc3_event_buffers_cleanup(dwc); in dwc3_uboot_exit()
854 dwc3_free_event_buffers(dwc); in dwc3_uboot_exit()
855 dwc3_core_exit(dwc); in dwc3_uboot_exit()
856 list_del(&dwc->list); in dwc3_uboot_exit()
857 kfree(dwc->mem); in dwc3_uboot_exit()
872 struct dwc3 *dwc = NULL; in dwc3_uboot_handle_interrupt() local
874 list_for_each_entry(dwc, &dwc3_list, list) { in dwc3_uboot_handle_interrupt()
875 if (dwc->index != index) in dwc3_uboot_handle_interrupt()
878 dwc3_gadget_uboot_handle_interrupt(dwc); in dwc3_uboot_handle_interrupt()
974 void dwc3_of_parse(struct dwc3 *dwc) in dwc3_of_parse() argument
977 struct udevice *dev = dwc->dev; in dwc3_of_parse()
994 dwc->hsphy_mode = usb_get_phy_mode(dev->node); in dwc3_of_parse()
996 dwc->has_lpm_erratum = dev_read_bool(dev, in dwc3_of_parse()
1002 dwc->is_utmi_l1_suspend = dev_read_bool(dev, in dwc3_of_parse()
1008 dwc->disable_scramble_quirk = dev_read_bool(dev, in dwc3_of_parse()
1010 dwc->u2exit_lfps_quirk = dev_read_bool(dev, in dwc3_of_parse()
1012 dwc->u2ss_inp3_quirk = dev_read_bool(dev, in dwc3_of_parse()
1014 dwc->req_p1p2p3_quirk = dev_read_bool(dev, in dwc3_of_parse()
1016 dwc->del_p1p2p3_quirk = dev_read_bool(dev, in dwc3_of_parse()
1018 dwc->del_phy_power_chg_quirk = dev_read_bool(dev, in dwc3_of_parse()
1020 dwc->lfps_filter_quirk = dev_read_bool(dev, in dwc3_of_parse()
1022 dwc->rx_detect_poll_quirk = dev_read_bool(dev, in dwc3_of_parse()
1024 dwc->dis_u3_susphy_quirk = dev_read_bool(dev, in dwc3_of_parse()
1026 dwc->dis_u2_susphy_quirk = dev_read_bool(dev, in dwc3_of_parse()
1028 dwc->dis_enblslpm_quirk = dev_read_bool(dev, in dwc3_of_parse()
1030 dwc->dis_u2_freeclk_exists_quirk = dev_read_bool(dev, in dwc3_of_parse()
1032 dwc->tx_de_emphasis_quirk = dev_read_bool(dev, in dwc3_of_parse()
1038 dwc->lpm_nyet_threshold = lpm_nyet_threshold; in dwc3_of_parse()
1039 dwc->tx_de_emphasis = tx_de_emphasis; in dwc3_of_parse()
1041 dwc->hird_threshold = hird_threshold in dwc3_of_parse()
1042 | (dwc->is_utmi_l1_suspend << 4); in dwc3_of_parse()
1045 int dwc3_init(struct dwc3 *dwc) in dwc3_init() argument
1049 dwc3_cache_hwparams(dwc); in dwc3_init()
1051 ret = dwc3_alloc_event_buffers(dwc, DWC3_EVENT_BUFFERS_SIZE); in dwc3_init()
1053 dev_err(dwc->dev, "failed to allocate event buffers\n"); in dwc3_init()
1057 ret = dwc3_core_init(dwc); in dwc3_init()
1063 ret = dwc3_event_buffers_setup(dwc); in dwc3_init()
1065 dev_err(dwc->dev, "failed to setup event buffers\n"); in dwc3_init()
1069 ret = dwc3_core_init_mode(dwc); in dwc3_init()
1076 dwc3_event_buffers_cleanup(dwc); in dwc3_init()
1079 dwc3_core_exit(dwc); in dwc3_init()
1082 dwc3_free_event_buffers(dwc); in dwc3_init()
1087 void dwc3_remove(struct dwc3 *dwc) in dwc3_remove() argument
1089 dwc3_core_exit_mode(dwc); in dwc3_remove()
1090 dwc3_event_buffers_cleanup(dwc); in dwc3_remove()
1091 dwc3_free_event_buffers(dwc); in dwc3_remove()
1092 dwc3_core_exit(dwc); in dwc3_remove()
1093 kfree(dwc->mem); in dwc3_remove()