summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhihong Chen <[email protected]>2023-08-26 12:02:12 +0800
committersakumisu <[email protected]>2023-08-26 12:45:31 +0800
commitb9915e0e1b17668c8e004fef4fa5ff397358dedd (patch)
treef8fa870053be2653adc70b8673176b4bb04fe3e0
parent13877907440a80bee1e0b34f21d2f46643e67c21 (diff)
port: hpmicro: separate host and device USB instance config
- separate host and device USB instance config Signed-off-by: Zhihong Chen <[email protected]>
-rw-r--r--port/ehci/usb_glue_hpm.c14
-rw-r--r--port/ehci/usb_hc_ehci.c2
-rw-r--r--port/hpm/usb_dc_hpm.c10
3 files changed, 13 insertions, 13 deletions
diff --git a/port/ehci/usb_glue_hpm.c b/port/ehci/usb_glue_hpm.c
index 4425ddba..9034ea7a 100644
--- a/port/ehci/usb_glue_hpm.c
+++ b/port/ehci/usb_glue_hpm.c
@@ -7,8 +7,8 @@
#error "hpm ehci must set CONFIG_USB_EHCI_HPMICRO=1"
#endif
-#if !defined(CONFIG_HPM_USB_BASE) || !defined(CONFIG_HPM_USB_IRQn)
-#error "hpm ehci must config CONFIG_HPM_USB_BASE and CONFIG_HPM_USB_IRQn"
+#if !defined(CONFIG_HPM_USBH_BASE) || !defined(CONFIG_HPM_USBH_IRQn)
+#error "hpm ehci must config CONFIG_HPM_USBH_BASE and CONFIG_HPM_USBH_IRQn"
#endif
static void usb_host_mode_init(USB_Type *ptr)
@@ -32,20 +32,20 @@ static void usb_host_mode_init(USB_Type *ptr)
void usb_hc_low_level_init()
{
- usb_phy_init((USB_Type *)CONFIG_HPM_USB_BASE);
- intc_m_enable_irq(CONFIG_HPM_USB_IRQn);
+ usb_phy_init((USB_Type *)CONFIG_HPM_USBH_BASE);
+ intc_m_enable_irq(CONFIG_HPM_USBH_IRQn);
}
void usb_hc_low_level2_init()
{
- usb_host_mode_init((USB_Type *)CONFIG_HPM_USB_BASE);
+ usb_host_mode_init((USB_Type *)CONFIG_HPM_USBH_BASE);
}
uint8_t usbh_get_port_speed(const uint8_t port)
{
uint8_t speed;
- speed = usb_get_port_speed((USB_Type *)CONFIG_HPM_USB_BASE);
+ speed = usb_get_port_speed((USB_Type *)CONFIG_HPM_USBH_BASE);
if (speed == 0x00) {
return USB_SPEED_FULL;
@@ -66,4 +66,4 @@ void isr_usb(void)
{
USBH_IRQHandler();
}
-SDK_DECLARE_EXT_ISR_M(CONFIG_HPM_USB_IRQn, isr_usb) \ No newline at end of file
+SDK_DECLARE_EXT_ISR_M(CONFIG_HPM_USBH_IRQn, isr_usb)
diff --git a/port/ehci/usb_hc_ehci.c b/port/ehci/usb_hc_ehci.c
index 8179f34c..f53bd944 100644
--- a/port/ehci/usb_hc_ehci.c
+++ b/port/ehci/usb_hc_ehci.c
@@ -742,7 +742,7 @@ static int usbh_reset_port(const uint8_t port)
uint32_t regval;
#if defined(CONFIG_USB_EHCI_HPMICRO) && CONFIG_USB_EHCI_HPMICRO
- if ((*(volatile uint32_t *)(CONFIG_HPM_USB_BASE + 0x224) & 0xc0) == (2 << 6)) { /* Hardcode for hpm */
+ if ((*(volatile uint32_t *)(CONFIG_HPM_USBH_BASE + 0x224) & 0xc0) == (2 << 6)) { /* Hardcode for hpm */
EHCI_HCOR->portsc[port - 1] |= (1 << 29);
} else {
EHCI_HCOR->portsc[port - 1] &= ~(1 << 29);
diff --git a/port/hpm/usb_dc_hpm.c b/port/hpm/usb_dc_hpm.c
index dc1a43d1..930e2438 100644
--- a/port/hpm/usb_dc_hpm.c
+++ b/port/hpm/usb_dc_hpm.c
@@ -10,8 +10,8 @@
#define USB_NUM_BIDIR_ENDPOINTS USB_SOC_DCD_MAX_ENDPOINT_COUNT
#endif
-#if !defined(CONFIG_HPM_USB_BASE) || !defined(CONFIG_HPM_USB_IRQn)
-#error "hpm dcd must config CONFIG_HPM_USB_BASE and CONFIG_HPM_USB_IRQn"
+#if !defined(CONFIG_HPM_USBD_BASE) || !defined(CONFIG_HPM_USBD_IRQn)
+#error "hpm dcd must config CONFIG_HPM_USBD_BASE and CONFIG_HPM_USBD_IRQn"
#endif
/* USBSTS, USBINTR */
@@ -66,7 +66,7 @@ int usb_dc_init(void)
memset(&g_hpm_udc, 0, sizeof(struct hpm_udc));
g_hpm_udc.handle = &usb_device_handle[0];
- g_hpm_udc.handle->regs = (USB_Type *)CONFIG_HPM_USB_BASE;
+ g_hpm_udc.handle->regs = (USB_Type *)CONFIG_HPM_USBD_BASE;
g_hpm_udc.handle->dcd_data = &_dcd_data;
uint32_t int_mask;
@@ -75,7 +75,7 @@ int usb_dc_init(void)
usb_device_init(g_hpm_udc.handle, int_mask);
- intc_m_enable_irq(CONFIG_HPM_USB_IRQn);
+ intc_m_enable_irq(CONFIG_HPM_USBD_IRQn);
return 0;
}
@@ -287,4 +287,4 @@ void isr_usb(void)
{
USBD_IRQHandler();
}
-SDK_DECLARE_EXT_ISR_M(CONFIG_HPM_USB_IRQn, isr_usb)
+SDK_DECLARE_EXT_ISR_M(CONFIG_HPM_USBD_IRQn, isr_usb)