forked from yystopf/xiuos
Adding more USB hardware information for RK3568
This commit is contained in:
parent
bf1947052b
commit
805cd766ea
|
@ -97,6 +97,34 @@ __WEAK unsigned long usb_hc_get_register_base(uint32_t id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
__WEAK int usb_hc_get_register_id(unsigned long base_addr){
|
||||||
|
int id;
|
||||||
|
|
||||||
|
if(USB3_0_BASE_ADDR == base_addr)
|
||||||
|
id = USB3_0_ID;
|
||||||
|
else if(USB3_1_BASE_ADDR == base_addr)
|
||||||
|
id = USB3_1_ID;
|
||||||
|
else
|
||||||
|
id = -1;
|
||||||
|
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
__WEAK unsigned long usb_hc_get_register_vir_base(uint32_t id)
|
||||||
|
{
|
||||||
|
unsigned long base_addr;
|
||||||
|
|
||||||
|
if(USB3_0_ID == id)
|
||||||
|
base_addr = USB3_0_VIRADDR_BASE;
|
||||||
|
else if(USB3_1_ID == id)
|
||||||
|
base_addr = USB3_1_VIRADDR_BASE;
|
||||||
|
else
|
||||||
|
base_addr = 0;
|
||||||
|
|
||||||
|
return base_addr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline struct xhci_host* xhci_get_inst_of_port(struct usbh_hubport *hport) {
|
static inline struct xhci_host* xhci_get_inst_of_port(struct usbh_hubport *hport) {
|
||||||
USB_ASSERT(hport && hport->parent);
|
USB_ASSERT(hport && hport->parent);
|
||||||
|
|
|
@ -57,8 +57,8 @@ extern "C" {
|
||||||
#define USB3_ADDR_OFFSET_UPPER_BOUND 0x07FFF
|
#define USB3_ADDR_OFFSET_UPPER_BOUND 0x07FFF
|
||||||
|
|
||||||
#define USB3_VIRADDR_BASE 0x0000002000000000ULL
|
#define USB3_VIRADDR_BASE 0x0000002000000000ULL
|
||||||
#define USB3_1_VIRADDR_BASE USB3_VIRADDR_BASE
|
#define USB3_0_VIRADDR_BASE USB3_VIRADDR_BASE
|
||||||
#define USB3_2_VIRADDR_BASE USB3_VIRADDR_BASE + USB3_ADDR_OFFSET_UPPER_BOUND
|
#define USB3_1_VIRADDR_BASE USB3_VIRADDR_BASE + USB3_ADDR_OFFSET_UPPER_BOUND
|
||||||
/**
|
/**
|
||||||
* @brief xHCI host controller hardware init.
|
* @brief xHCI host controller hardware init.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue