From e44ae64451caa54fd2469ecc60bd4ef39581cd6d Mon Sep 17 00:00:00 2001 From: xj Date: Tue, 25 Jun 2024 23:39:18 -0700 Subject: [PATCH] Add address of USB3.0 host controller registers in RK3568 --- .../drivers/usb/components/port/xhci/usb_hc_xhci.c | 11 ++++++++++- .../drivers/usb/components/port/xhci/usb_hc_xhci.h | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.c b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.c index cf81dd396..aaca03d1c 100644 --- a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.c +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.c @@ -84,7 +84,16 @@ __WEAK void usb_hc_free() /* one may get xhci register base address by PCIe bus emuration */ __WEAK unsigned long usb_hc_get_register_base(uint32_t id) { - return 0U; + unsigned long base_addr; + + if(USB3_0_ID == id) + base_addr = USB3_0_BASE_ADDR; + else if(USB3_1_ID == id) + base_addr = USB3_1_BASE_ADDR; + else + base_addr = 0; + + return base_addr; } diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.h b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.h index fb1c1bed0..1bc444f4e 100644 --- a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.h +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.h @@ -48,6 +48,8 @@ extern "C" { /* * Address of USB3 host control base Register in RK3568. */ +#define USB3_0_ID 0 +#define USB3_1_ID 1 #define USB3_0_BASE_ADDR 0xFCC00000 #define USB3_1_BASE_ADDR 0xFD000000