From 70ef61667605af28399c95bdb008a717e90fbff2 Mon Sep 17 00:00:00 2001 From: Zhihong Chen Date: Mon, 18 Nov 2024 16:24:14 +0800 Subject: [PATCH] HPMicro: update hpmicro port files Signed-off-by: Zhihong Chen --- port/ehci/usb_glue_hpm.c | 11 ++++++++--- port/hpm/usb_dc_hpm.c | 6 ++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/port/ehci/usb_glue_hpm.c b/port/ehci/usb_glue_hpm.c index 17724008..40105a94 100644 --- a/port/ehci/usb_glue_hpm.c +++ b/port/ehci/usb_glue_hpm.c @@ -35,6 +35,11 @@ static void usb_host_mode_init(USB_Type *ptr) /* Set parallel transceiver width */ ptr->PORTSC1 &= ~USB_PORTSC1_PTW_MASK; +#ifdef CONFIG_USB_HOST_FORCE_FULL_SPEED + /* Set usb forced to full speed mode */ + ptr->PORTSC1 |= USB_PORTSC1_PFSC_MASK; +#endif + /* Not use interrupt threshold. */ ptr->USBCMD &= ~USB_USBCMD_ITC_MASK; } @@ -53,7 +58,7 @@ void usb_hc_low_level_init(struct usbh_bus *bus) #endif } - usb_phy_init((USB_Type *)(bus->hcd.reg_base)); + usb_phy_init((USB_Type *)(bus->hcd.reg_base), true); intc_m_enable_irq(_hcd_irqnum[bus->hcd.hcd_id]); } @@ -86,18 +91,18 @@ uint8_t usbh_get_port_speed(struct usbh_bus *bus, const uint8_t port) extern void USBH_IRQHandler(uint8_t busid); +SDK_DECLARE_EXT_ISR_M(IRQn_USB0, isr_usbh0) void isr_usbh0(void) { USBH_IRQHandler(_hcd_busid[0]); } -SDK_DECLARE_EXT_ISR_M(IRQn_USB0, isr_usbh0) #ifdef HPM_USB1_BASE +SDK_DECLARE_EXT_ISR_M(IRQn_USB1, isr_usbh1) void isr_usbh1(void) { USBH_IRQHandler(_hcd_busid[1]); } -SDK_DECLARE_EXT_ISR_M(IRQn_USB1, isr_usbh1) #endif #endif diff --git a/port/hpm/usb_dc_hpm.c b/port/hpm/usb_dc_hpm.c index 625c8b11..b663fd9a 100644 --- a/port/hpm/usb_dc_hpm.c +++ b/port/hpm/usb_dc_hpm.c @@ -128,8 +128,6 @@ int usbd_set_remote_wakeup(uint8_t busid) } usb_force_port_resume(ptr); - while (ptr->PORTSC1 & USB_PORTSC1_FPR_MASK) { - } return 0; } @@ -362,18 +360,18 @@ void USBD_IRQHandler(uint8_t busid) #if !defined(USBD_USE_CUSTOM_ISR) || !USBD_USE_CUSTOM_ISR +SDK_DECLARE_EXT_ISR_M(IRQn_USB0, isr_usbd0) void isr_usbd0(void) { USBD_IRQHandler(_dcd_busid[0]); } -SDK_DECLARE_EXT_ISR_M(IRQn_USB0, isr_usbd0) #ifdef HPM_USB1_BASE +SDK_DECLARE_EXT_ISR_M(IRQn_USB1, isr_usbd1) void isr_usbd1(void) { USBD_IRQHandler(_dcd_busid[1]); } -SDK_DECLARE_EXT_ISR_M(IRQn_USB1, isr_usbd1) #endif #endif