summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2024-03-27 20:43:11 +0800
committersakumisu <[email protected]>2024-03-27 20:43:18 +0800
commit68708c0f3a94ef2cfd6f5128c826599b6b91bb82 (patch)
treec41a30846c316edb74dc96a575b1bc9eea8c1ff4
parent5cd50410e67fdc612c3217994bf39d5dc3f9c7c9 (diff)
fix aic irq param num and add usbh_init api
-rw-r--r--port/ehci/usb_glue_aic.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/port/ehci/usb_glue_aic.c b/port/ehci/usb_glue_aic.c
index e986f9f4..0d0db4d6 100644
--- a/port/ehci/usb_glue_aic.c
+++ b/port/ehci/usb_glue_aic.c
@@ -12,7 +12,7 @@
extern void USBH_IRQHandler(uint8_t busid);
-static void aic_ehci_isr(void *arg)
+static void aic_ehci_isr(int vector, void *arg)
{
struct usbh_bus *bus = (struct usbh_bus *)arg;
extern void USBH_IRQHandler(uint8_t busid);
@@ -139,3 +139,35 @@ void usb_ehci_dcache_clean_invalidate(uintptr_t addr, uint32_t len)
{
aicos_dcache_clean_invalid_range((size_t *)addr, len);
}
+
+int usbh_init(void)
+{
+#if defined(AIC_USING_USB0_HOST) || defined(AIC_USING_USB1_HOST)
+ int bus_id = 0;
+#endif
+
+#ifdef AIC_USING_USB0_HOST
+ usbh_initialize(bus_id, USB_HOST0_BASE);
+ bus_id++;
+#endif
+
+#ifdef AIC_USING_USB1_HOST
+ usbh_initialize(bus_id, USB_HOST1_BASE);
+ bus_id++;
+#endif
+
+ return 0;
+}
+
+#if defined(KERNEL_RTTHREAD)
+#include <rtthread.h>
+#include <rtdevice.h>
+
+INIT_ENV_EXPORT(usbh_init);
+
+#if defined (RT_USING_FINSH)
+#include <finsh.h>
+
+MSH_CMD_EXPORT_ALIAS(lsusb, lsusb, list usb device);
+#endif
+#endif \ No newline at end of file