瀏覽代碼

HPMicro: update hpmicro port files

Signed-off-by: Zhihong Chen <zhihong.chen@hpmicro.com>
Zhihong Chen 1 年之前
父節點
當前提交
70ef616676
共有 2 個文件被更改,包括 10 次插入7 次删除
  1. 8 3
      port/ehci/usb_glue_hpm.c
  2. 2 4
      port/hpm/usb_dc_hpm.c

+ 8 - 3
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

+ 2 - 4
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