HPMicro: update hpmicro port files

Signed-off-by: Zhihong Chen <zhihong.chen@hpmicro.com>
This commit is contained in:
Zhihong Chen 2024-11-18 16:24:14 +08:00 committed by sakumisu
parent 6517919bd2
commit 70ef616676
2 changed files with 10 additions and 7 deletions

View File

@ -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

View File

@ -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