diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/xhci.c b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/xhci.c index 911782a2f..41aa8200d 100644 --- a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/xhci.c +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/xhci.c @@ -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. * * 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 * Date: 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: - * Ver聽聽聽Who聽聽聽聽聽聽聽聽Date聽聽聽聽聽聽聽聽聽Changes - * -----聽------聽聽聽聽聽--------聽聽聽聽-------------------------------------- + * Modify History: + * Ver   Who        Date         Changes + * ----- ------     --------    -------------------------------------- * 1.0 zhugengyu 2022/9/19 init commit * 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_hub.h" #include "xhci_reg.h" #include "xhci.h" +#include "usb_hc_xhci.h" /** @file @@ -171,8 +185,20 @@ static void xhci_init ( struct xhci_host *xhci, void *regs ) { size_t rtsoff; size_t dboff; + int id; + uint64_t cap_vir_addr; + /* Locate capability, operational, runtime, and doorbell registers */ 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 ); rtsoff = readl ( xhci->cap + XHCI_CAP_RTSOFF ); dboff = readl ( xhci->cap + XHCI_CAP_DBOFF );