Lines Matching refs:base
64 #define UDC_DWC2_EP_FIFO(base, idx) ((mem_addr_t)base + 0x1000 * (idx + 1)) argument
174 return config->base; in dwc2_get_base()
207 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in dwc2_get_dxepctl_reg() local
211 return (mem_addr_t)&base->out_ep[ep_idx].doepctl; in dwc2_get_dxepctl_reg()
213 return (mem_addr_t)&base->in_ep[ep_idx].diepctl; in dwc2_get_dxepctl_reg()
220 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in dwc2_ftx_avail() local
221 mem_addr_t reg = (mem_addr_t)&base->in_ep[idx].dtxfsts; in dwc2_ftx_avail()
253 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in dwc2_flush_rx_fifo() local
254 mem_addr_t grstctl_reg = (mem_addr_t)&base->grstctl; in dwc2_flush_rx_fifo()
263 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in dwc2_flush_tx_fifo() local
264 mem_addr_t grstctl_reg = (mem_addr_t)&base->grstctl; in dwc2_flush_tx_fifo()
277 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in dwc2_get_txfdep() local
280 dieptxf = sys_read32((mem_addr_t)&base->dieptxf[f_idx]); in dwc2_get_txfdep()
288 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in dwc2_get_txfaddr() local
291 dieptxf = sys_read32((mem_addr_t)&base->dieptxf[f_idx]); in dwc2_get_txfaddr()
300 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in dwc2_set_txf() local
306 sys_write32(dieptxf, (mem_addr_t)&base->dieptxf[f_idx]); in dwc2_set_txf()
313 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in dwc2_set_epint() local
314 mem_addr_t reg = (mem_addr_t)&base->daintmsk; in dwc2_set_epint()
371 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in dwc2_tx_fifo_write() local
375 mem_addr_t dieptsiz_reg = (mem_addr_t)&base->in_ep[ep_idx].dieptsiz; in dwc2_tx_fifo_write()
377 mem_addr_t diepctl_reg = (mem_addr_t)&base->in_ep[ep_idx].diepctl; in dwc2_tx_fifo_write()
378 mem_addr_t diepint_reg = (mem_addr_t)&base->in_ep[ep_idx].diepint; in dwc2_tx_fifo_write()
476 (mem_addr_t)&base->in_ep[ep_idx].diepdma); in dwc2_tx_fifo_write()
528 sys_write32(val, UDC_DWC2_EP_FIFO(base, ep_idx)); in dwc2_tx_fifo_write()
545 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in dwc2_read_fifo() local
552 net_buf_add_le32(buf, sys_read32(UDC_DWC2_EP_FIFO(base, ep))); in dwc2_read_fifo()
559 sys_put_le32(sys_read32(UDC_DWC2_EP_FIFO(base, ep)), r); in dwc2_read_fifo()
567 (void)sys_read32(UDC_DWC2_EP_FIFO(base, ep)); in dwc2_read_fifo()
578 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in dwc2_prep_rx() local
581 mem_addr_t doeptsiz_reg = (mem_addr_t)&base->out_ep[ep_idx].doeptsiz; in dwc2_prep_rx()
638 (mem_addr_t)&base->out_ep[ep_idx].doepdma); in dwc2_prep_rx()
856 struct usb_dwc2_reg *const base = config->base; in dwc2_backup_registers() local
860 backup->gotgctl = sys_read32((mem_addr_t)&base->gotgctl); in dwc2_backup_registers()
861 backup->gahbcfg = sys_read32((mem_addr_t)&base->gahbcfg); in dwc2_backup_registers()
862 backup->gusbcfg = sys_read32((mem_addr_t)&base->gusbcfg); in dwc2_backup_registers()
863 backup->gintmsk = sys_read32((mem_addr_t)&base->gintmsk); in dwc2_backup_registers()
864 backup->grxfsiz = sys_read32((mem_addr_t)&base->grxfsiz); in dwc2_backup_registers()
865 backup->gnptxfsiz = sys_read32((mem_addr_t)&base->gnptxfsiz); in dwc2_backup_registers()
866 backup->gi2cctl = sys_read32((mem_addr_t)&base->gi2cctl); in dwc2_backup_registers()
867 backup->glpmcfg = sys_read32((mem_addr_t)&base->glpmcfg); in dwc2_backup_registers()
868 backup->gdfifocfg = sys_read32((mem_addr_t)&base->gdfifocfg); in dwc2_backup_registers()
871 backup->dieptxf[i - 1] = sys_read32((mem_addr_t)&base->dieptxf[i - 1]); in dwc2_backup_registers()
874 backup->dcfg = sys_read32((mem_addr_t)&base->dcfg); in dwc2_backup_registers()
875 backup->dctl = sys_read32((mem_addr_t)&base->dctl); in dwc2_backup_registers()
876 backup->diepmsk = sys_read32((mem_addr_t)&base->diepmsk); in dwc2_backup_registers()
877 backup->doepmsk = sys_read32((mem_addr_t)&base->doepmsk); in dwc2_backup_registers()
878 backup->daintmsk = sys_read32((mem_addr_t)&base->daintmsk); in dwc2_backup_registers()
884 backup->diepctl[i] = sys_read32((mem_addr_t)&base->in_ep[i].diepctl); in dwc2_backup_registers()
890 backup->dieptsiz[i] = sys_read32((mem_addr_t)&base->in_ep[i].dieptsiz); in dwc2_backup_registers()
891 backup->diepdma[i] = sys_read32((mem_addr_t)&base->in_ep[i].diepdma); in dwc2_backup_registers()
895 backup->doepctl[i] = sys_read32((mem_addr_t)&base->out_ep[i].doepctl); in dwc2_backup_registers()
901 backup->doeptsiz[i] = sys_read32((mem_addr_t)&base->out_ep[i].doeptsiz); in dwc2_backup_registers()
902 backup->doepdma[i] = sys_read32((mem_addr_t)&base->out_ep[i].doepdma); in dwc2_backup_registers()
906 backup->pcgcctl = sys_read32((mem_addr_t)&base->pcgcctl); in dwc2_backup_registers()
913 struct usb_dwc2_reg *const base = config->base; in dwc2_restore_essential_registers() local
918 sys_write32(backup->glpmcfg, (mem_addr_t)&base->glpmcfg); in dwc2_restore_essential_registers()
919 sys_write32(backup->gi2cctl, (mem_addr_t)&base->gi2cctl); in dwc2_restore_essential_registers()
920 sys_write32(pcgcctl, (mem_addr_t)&base->pcgcctl); in dwc2_restore_essential_registers()
923 (mem_addr_t)&base->gahbcfg); in dwc2_restore_essential_registers()
925 sys_write32(0xFFFFFFFFUL, (mem_addr_t)&base->gintsts); in dwc2_restore_essential_registers()
926 sys_write32(USB_DWC2_GINTSTS_RSTRDONEINT, (mem_addr_t)&base->gintmsk); in dwc2_restore_essential_registers()
928 sys_write32(backup->gusbcfg, (mem_addr_t)&base->gusbcfg); in dwc2_restore_essential_registers()
929 sys_write32(backup->dcfg, (mem_addr_t)&base->dcfg); in dwc2_restore_essential_registers()
932 sys_write32(backup->dcfg, (mem_addr_t)&base->dcfg); in dwc2_restore_essential_registers()
938 sys_write32(pcgcctl, (mem_addr_t)&base->pcgcctl); in dwc2_restore_essential_registers()
942 sys_write32(pcgcctl, (mem_addr_t)&base->pcgcctl); in dwc2_restore_essential_registers()
948 struct usb_dwc2_reg *const base = config->base; in dwc2_restore_device_registers() local
952 sys_write32(backup->gotgctl, (mem_addr_t)&base->gotgctl); in dwc2_restore_device_registers()
953 sys_write32(backup->gahbcfg, (mem_addr_t)&base->gahbcfg); in dwc2_restore_device_registers()
954 sys_write32(backup->gusbcfg, (mem_addr_t)&base->gusbcfg); in dwc2_restore_device_registers()
955 sys_write32(backup->gintmsk, (mem_addr_t)&base->gintmsk); in dwc2_restore_device_registers()
956 sys_write32(backup->grxfsiz, (mem_addr_t)&base->grxfsiz); in dwc2_restore_device_registers()
957 sys_write32(backup->gnptxfsiz, (mem_addr_t)&base->gnptxfsiz); in dwc2_restore_device_registers()
958 sys_write32(backup->gdfifocfg, (mem_addr_t)&base->gdfifocfg); in dwc2_restore_device_registers()
961 sys_write32(backup->dieptxf[i - 1], (mem_addr_t)&base->dieptxf[i - 1]); in dwc2_restore_device_registers()
965 sys_write32(backup->dctl, (mem_addr_t)&base->dctl); in dwc2_restore_device_registers()
968 sys_write32(backup->diepmsk, (mem_addr_t)&base->diepmsk); in dwc2_restore_device_registers()
969 sys_write32(backup->doepmsk, (mem_addr_t)&base->doepmsk); in dwc2_restore_device_registers()
970 sys_write32(backup->daintmsk, (mem_addr_t)&base->daintmsk); in dwc2_restore_device_registers()
976 sys_write32(backup->dieptsiz[i], (mem_addr_t)&base->in_ep[i].dieptsiz); in dwc2_restore_device_registers()
977 sys_write32(backup->diepdma[i], (mem_addr_t)&base->in_ep[i].diepdma); in dwc2_restore_device_registers()
978 sys_write32(backup->diepctl[i], (mem_addr_t)&base->in_ep[i].diepctl); in dwc2_restore_device_registers()
982 sys_write32(backup->doeptsiz[i], (mem_addr_t)&base->out_ep[i].doeptsiz); in dwc2_restore_device_registers()
983 sys_write32(backup->doepdma[i], (mem_addr_t)&base->out_ep[i].doepdma); in dwc2_restore_device_registers()
984 sys_write32(backup->doepctl[i], (mem_addr_t)&base->out_ep[i].doepctl); in dwc2_restore_device_registers()
992 struct usb_dwc2_reg *const base = config->base; in dwc2_enter_hibernation() local
994 mem_addr_t gpwrdn_reg = (mem_addr_t)&base->gpwrdn; in dwc2_enter_hibernation()
995 mem_addr_t pcgcctl_reg = (mem_addr_t)&base->pcgcctl; in dwc2_enter_hibernation()
1040 struct usb_dwc2_reg *const base = config->base; in dwc2_exit_hibernation() local
1042 mem_addr_t gpwrdn_reg = (mem_addr_t)&base->gpwrdn; in dwc2_exit_hibernation()
1043 mem_addr_t pcgcctl_reg = (mem_addr_t)&base->pcgcctl; in dwc2_exit_hibernation()
1082 dwc2_wait_for_bit(dev, (mem_addr_t)&base->gintsts, USB_DWC2_GINTSTS_RSTRDONEINT); in dwc2_exit_hibernation()
1084 sys_write32(0xFFFFFFFFUL, (mem_addr_t)&base->gintsts); in dwc2_exit_hibernation()
1097 sys_write32(priv->backup.gusbcfg, (mem_addr_t)&base->gusbcfg); in dwc2_exit_hibernation()
1098 sys_write32(priv->backup.dcfg, (mem_addr_t)&base->dcfg); in dwc2_exit_hibernation()
1099 sys_write32(priv->backup.dctl, (mem_addr_t)&base->dctl); in dwc2_exit_hibernation()
1105 sys_set_bits((mem_addr_t)&base->dctl, USB_DWC2_DCTL_PWRONPRGDONE); in dwc2_exit_hibernation()
1109 (mem_addr_t)&base->dctl); in dwc2_exit_hibernation()
1113 sys_write32(0xFFFFFFFFUL, (mem_addr_t)&base->gintsts); in dwc2_exit_hibernation()
1278 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in udc_dwc2_ep_activate() local
1292 dxepctl_reg = (mem_addr_t)&base->out_ep[ep_idx].doepctl; in udc_dwc2_ep_activate()
1299 dxepctl_reg = (mem_addr_t)&base->in_ep[ep_idx].diepctl; in udc_dwc2_ep_activate()
1345 i, sys_read32((mem_addr_t)&base->dieptxf[i - 1U]), i, dxepctl); in udc_dwc2_ep_activate()
1386 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in udc_dwc2_ep_disable() local
1422 dctl_reg = (mem_addr_t)&base->dctl; in udc_dwc2_ep_disable()
1423 gintsts_reg = (mem_addr_t)&base->gintsts; in udc_dwc2_ep_disable()
1424 doepint_reg = (mem_addr_t)&base->out_ep[ep_idx].doepint; in udc_dwc2_ep_disable()
1463 diepint_reg = (mem_addr_t)&base->in_ep[ep_idx].diepint; in udc_dwc2_ep_disable()
1632 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in udc_dwc2_set_address() local
1633 mem_addr_t dcfg_reg = (mem_addr_t)&base->dcfg; in udc_dwc2_set_address()
1652 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in udc_dwc2_test_mode() local
1653 mem_addr_t dctl_reg = (mem_addr_t)&base->dctl; in udc_dwc2_test_mode()
1710 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in dwc2_core_soft_reset() local
1711 mem_addr_t grstctl_reg = (mem_addr_t)&base->grstctl; in dwc2_core_soft_reset()
1750 struct usb_dwc2_reg *const base = config->base; in udc_dwc2_init_controller() local
1751 mem_addr_t grxfsiz_reg = (mem_addr_t)&base->grxfsiz; in udc_dwc2_init_controller()
1752 mem_addr_t gahbcfg_reg = (mem_addr_t)&base->gahbcfg; in udc_dwc2_init_controller()
1753 mem_addr_t gusbcfg_reg = (mem_addr_t)&base->gusbcfg; in udc_dwc2_init_controller()
1754 mem_addr_t dcfg_reg = (mem_addr_t)&base->dcfg; in udc_dwc2_init_controller()
1770 priv->ghwcfg1 = sys_read32((mem_addr_t)&base->ghwcfg1); in udc_dwc2_init_controller()
1771 ghwcfg2 = sys_read32((mem_addr_t)&base->ghwcfg2); in udc_dwc2_init_controller()
1772 ghwcfg3 = sys_read32((mem_addr_t)&base->ghwcfg3); in udc_dwc2_init_controller()
1773 ghwcfg4 = sys_read32((mem_addr_t)&base->ghwcfg4); in udc_dwc2_init_controller()
1924 val = sys_read32((mem_addr_t)&base->gnptxfsiz); in udc_dwc2_init_controller()
1963 sys_write32(gnptxfsiz, (mem_addr_t)&base->gnptxfsiz); in udc_dwc2_init_controller()
1990 (mem_addr_t)&base->gintmsk); in udc_dwc2_init_controller()
1998 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in udc_dwc2_enable() local
2019 sys_set_bits((mem_addr_t)&base->gahbcfg, USB_DWC2_GAHBCFG_GLBINTRMASK); in udc_dwc2_enable()
2023 sys_clear_bits((mem_addr_t)&base->dctl, USB_DWC2_DCTL_SFTDISCON); in udc_dwc2_enable()
2024 LOG_DBG("Enable device %p", base); in udc_dwc2_enable()
2033 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in udc_dwc2_disable() local
2034 mem_addr_t dctl_reg = (mem_addr_t)&base->dctl; in udc_dwc2_disable()
2058 sys_clear_bits((mem_addr_t)&base->gahbcfg, USB_DWC2_GAHBCFG_GLBINTRMASK); in udc_dwc2_disable()
2222 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in dwc2_on_bus_reset() local
2244 sys_write32(doepmsk, (mem_addr_t)&base->doepmsk); in dwc2_on_bus_reset()
2245 sys_set_bits((mem_addr_t)&base->diepmsk, USB_DWC2_DIEPINT_XFERCOMPL); in dwc2_on_bus_reset()
2249 sys_set_bits((mem_addr_t)&base->gintmsk, in dwc2_on_bus_reset()
2254 sys_clear_bits((mem_addr_t)&base->dcfg, USB_DWC2_DCFG_DEVADDR_MASK); in dwc2_on_bus_reset()
2262 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in dwc2_handle_enumdone() local
2266 dsts = sys_read32((mem_addr_t)&base->dsts); in dwc2_handle_enumdone()
2274 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in dwc2_read_fifo_setup() local
2292 sys_put_le32(sys_read32(UDC_DWC2_EP_FIFO(base, ep)), in dwc2_read_fifo_setup()
2298 sys_read32(UDC_DWC2_EP_FIFO(base, ep)); in dwc2_read_fifo_setup()
2307 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in dwc2_handle_rxflvl() local
2315 grxstsp = sys_read32((mem_addr_t)&base->grxstsp); in dwc2_handle_rxflvl()
2372 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in dwc2_handle_iepint() local
2377 diepmsk = sys_read32((mem_addr_t)&base->diepmsk); in dwc2_handle_iepint()
2378 daint = sys_read32((mem_addr_t)&base->daint); in dwc2_handle_iepint()
2381 mem_addr_t diepint_reg = (mem_addr_t)&base->in_ep[n].diepint; in dwc2_handle_iepint()
2402 sys_write32(USB_DWC2_GINTSTS_IEPINT, (mem_addr_t)&base->gintsts); in dwc2_handle_iepint()
2410 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in dwc2_handle_out_xfercompl() local
2416 doeptsiz = sys_read32((mem_addr_t)&base->out_ep[ep_idx].doeptsiz); in dwc2_handle_out_xfercompl()
2479 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in dwc2_handle_oepint() local
2485 doepmsk = sys_read32((mem_addr_t)&base->doepmsk); in dwc2_handle_oepint()
2486 daint = sys_read32((mem_addr_t)&base->daint); in dwc2_handle_oepint()
2489 mem_addr_t doepint_reg = (mem_addr_t)&base->out_ep[n].doepint; in dwc2_handle_oepint()
2519 addr = sys_read32((mem_addr_t)&base->out_ep[0].doepdma); in dwc2_handle_oepint()
2544 sys_write32(USB_DWC2_GINTSTS_OEPINT, (mem_addr_t)&base->gintsts); in dwc2_handle_oepint()
2554 struct usb_dwc2_reg *const base = config->base; in dwc2_handle_incompisoin() local
2556 mem_addr_t gintsts_reg = (mem_addr_t)&base->gintsts; in dwc2_handle_incompisoin()
2608 struct usb_dwc2_reg *const base = config->base; in dwc2_handle_incompisoout() local
2610 mem_addr_t gintsts_reg = (mem_addr_t)&base->gintsts; in dwc2_handle_incompisoout()
2655 struct usb_dwc2_reg *const base = config->base; in udc_dwc2_isr_handler() local
2657 mem_addr_t gintsts_reg = (mem_addr_t)&base->gintsts; in udc_dwc2_isr_handler()
2662 uint32_t gpwrdn = sys_read32((mem_addr_t)&base->gpwrdn); in udc_dwc2_isr_handler()
2666 sys_write32(gpwrdn, (mem_addr_t)&base->gpwrdn); in udc_dwc2_isr_handler()
2688 gintmsk = sys_read32((mem_addr_t)&base->gintmsk); in udc_dwc2_isr_handler()
2701 dsts = sys_read32((mem_addr_t)&base->dsts); in udc_dwc2_isr_handler()
2772 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in dwc2_handle_hibernation_exit() local
2793 sys_clear_bits((mem_addr_t)&base->dctl, USB_DWC2_DCTL_RMTWKUPSIG); in dwc2_handle_hibernation_exit()
2836 struct usb_dwc2_reg *const base = dwc2_get_base(dev); in dwc2_thread_handler() local
2927 sys_set_bits((mem_addr_t)&base->dctl, USB_DWC2_DCTL_RMTWKUPSIG); in dwc2_thread_handler()
2935 sys_clear_bits((mem_addr_t)&base->dctl, USB_DWC2_DCTL_RMTWKUPSIG); in dwc2_thread_handler()
3070 .base = (struct usb_dwc2_reg *)UDC_DWC2_DT_INST_REG_ADDR(n), \