forked from xuos/xiuos
Adding more USB hardware information for RK3568
This commit is contained in:
parent
7ed436a8c8
commit
41a4e81d7d
|
@ -38,7 +38,7 @@ Modification: replant and redefine some xhci data structure, so that the cherryU
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright聽: (C)聽2022聽Phytium聽Information聽Technology,聽Inc.
|
* Copyright : (C) 2022 Phytium Information Technology, Inc.
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
*
|
*
|
||||||
* This program is OPEN SOURCE software: you can redistribute it and/or modify it
|
* This program is OPEN SOURCE software: you can redistribute it and/or modify it
|
||||||
|
@ -53,20 +53,34 @@ Modification: replant and redefine some xhci data structure, so that the cherryU
|
||||||
* FilePath: xhci.c
|
* FilePath: xhci.c
|
||||||
* Date: 2022-07-19 09:26:25
|
* Date: 2022-07-19 09:26:25
|
||||||
* LastEditTime: 2022-07-19 09:26:25
|
* LastEditTime: 2022-07-19 09:26:25
|
||||||
* Description: 聽This file is for xhci functions implmentation.
|
* Description: This file is for xhci functions implmentation.
|
||||||
*
|
*
|
||||||
* Modify聽History:
|
* Modify History:
|
||||||
* Ver聽聽聽Who聽聽聽聽聽聽聽聽Date聽聽聽聽聽聽聽聽聽Changes
|
* Ver Who Date Changes
|
||||||
* -----聽------聽聽聽聽聽--------聽聽聽聽--------------------------------------
|
* ----- ------ -------- --------------------------------------
|
||||||
* 1.0 zhugengyu 2022/9/19 init commit
|
* 1.0 zhugengyu 2022/9/19 init commit
|
||||||
* 2.0 zhugengyu 2023/3/29 support usb3.0 device attached at roothub
|
* 2.0 zhugengyu 2023/3/29 support usb3.0 device attached at roothub
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*************************************************
|
||||||
|
File name: xhci.c
|
||||||
|
Description: adopt cherry USB to XiZi AIOT.
|
||||||
|
Others: CherryUSB third-party/cherryusb/port/xhci/xhci.c for references
|
||||||
|
https://gitee.com/phytium_embedded/phytium-free-rtos-sdk/blob/master/third-party/cherryusb/port/xhci/xhci.c
|
||||||
|
|
||||||
|
History:
|
||||||
|
1. Date: 2024-06-28
|
||||||
|
Author: AIIT XUOS Lab
|
||||||
|
Modification: Modify xhci_probe functions in order to adopt to XiZi AIOT.
|
||||||
|
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
#include "usbh_core.h"
|
#include "usbh_core.h"
|
||||||
#include "usbh_hub.h"
|
#include "usbh_hub.h"
|
||||||
|
|
||||||
#include "xhci_reg.h"
|
#include "xhci_reg.h"
|
||||||
#include "xhci.h"
|
#include "xhci.h"
|
||||||
|
#include "usb_hc_xhci.h"
|
||||||
|
|
||||||
|
|
||||||
/** @file
|
/** @file
|
||||||
|
@ -171,8 +185,20 @@ static void xhci_init ( struct xhci_host *xhci, void *regs ) {
|
||||||
size_t rtsoff;
|
size_t rtsoff;
|
||||||
size_t dboff;
|
size_t dboff;
|
||||||
|
|
||||||
|
int id;
|
||||||
|
uint64_t cap_vir_addr;
|
||||||
|
|
||||||
/* Locate capability, operational, runtime, and doorbell registers */
|
/* Locate capability, operational, runtime, and doorbell registers */
|
||||||
xhci->cap = regs;
|
xhci->cap = regs;
|
||||||
|
|
||||||
|
id = usb_hc_get_register_id(regs);
|
||||||
|
|
||||||
|
cap_vir_addr = usb_hc_get_register_vir_base(id);
|
||||||
|
|
||||||
|
if(!mmap(cap_vir_addr, regs, USB3_ADDR_OFFSET_UPPER_BOUND, true)){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
caplength = readb ( xhci->cap + XHCI_CAP_CAPLENGTH );
|
caplength = readb ( xhci->cap + XHCI_CAP_CAPLENGTH );
|
||||||
rtsoff = readl ( xhci->cap + XHCI_CAP_RTSOFF );
|
rtsoff = readl ( xhci->cap + XHCI_CAP_RTSOFF );
|
||||||
dboff = readl ( xhci->cap + XHCI_CAP_DBOFF );
|
dboff = readl ( xhci->cap + XHCI_CAP_DBOFF );
|
||||||
|
|
Loading…
Reference in New Issue