diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/dev/rk3568/rk3568_usb.c b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/dev/rk3568/rk3568_usb.c index 1a6761c42..e2ec728b0 100644 --- a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/dev/rk3568/rk3568_usb.c +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/dev/rk3568/rk3568_usb.c @@ -1,10 +1,3 @@ #include "rk3568_usb.h" -int enable_dwc3_rk3568(){ - return 0; -}; - -int disable_dwc3_rk3568(){ - return 0; -}; diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/dev/rk3568/rk3568_usb.h b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/dev/rk3568/rk3568_usb.h index 52eddeff1..0b6b443ad 100644 --- a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/dev/rk3568/rk3568_usb.h +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/dev/rk3568/rk3568_usb.h @@ -1,6 +1,8 @@ #ifndef RK3568_USB_H_ #define RK3568_USB_H_ -int enable_rk3568_usb = 0; +#include "dwc3.h" + + #endif diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/Makefile b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/Makefile index f2783839d..f79b6fc78 100644 --- a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/Makefile +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/Makefile @@ -1,4 +1,4 @@ -SRC_DIR := xhci +SRC_DIR := xhci dwc3 -include $(KERNEL_ROOT)/compiler.mk \ No newline at end of file +include $(KERNEL_ROOT)/compiler.mk diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/dwc3/Makefile b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/dwc3/Makefile new file mode 100644 index 000000000..02ff013b2 --- /dev/null +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/dwc3/Makefile @@ -0,0 +1,11 @@ +include $(KERNEL_ROOT)/services/drivers/usb/components/usb.mk + +objs += dwc3.o + +all: ${objs} + @echo "generate $^" + @mv $^ $(KERNEL_ROOT)/services/drivers/usb/components + +%.o: %.c + @echo "cc $^" + @${cc} ${cflags} ${c_useropts} ${INC_DIR} -o $@ -c $^ diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/dwc3/dwc3.c b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/dwc3/dwc3.c new file mode 100644 index 000000000..22e6d852f --- /dev/null +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/dwc3/dwc3.c @@ -0,0 +1 @@ +#include "dwc3.h" diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/dwc3/dwc3.h b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/dwc3/dwc3.h new file mode 100644 index 000000000..893db2789 --- /dev/null +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/dwc3/dwc3.h @@ -0,0 +1,16 @@ +#ifndef DWC3_H_ +#define DWC3_H_ + + +#include "usbh_core.h" +#include "usbh_hub.h" +#include "xhci_reg.h" +#include "xhci.h" +#include "gadget.h" + + + + + + +#endif diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/dwc3/gadget.h b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/dwc3/gadget.h new file mode 100644 index 000000000..f3100e07e --- /dev/null +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/dwc3/gadget.h @@ -0,0 +1,28 @@ +#ifndef GADGET_H_ +#define GADGET_H_ + +#include +#include +#include "usbh_core.h" + +struct usb_gadget { + int speed; + int max_speed; + int state; + uint8_t is_dualspeed:1; + uint8_t is_otg:1; + uint8_t is_a_peripheral:1; + uint8_t b_hnp_enable:1; + uint8_t a_hnp_support:1; + uint8_t a_alt_hnp_support:1; + uint8_t quirk_ep_out_aligned_size:1; + const char *name; + void *dev; +}; + + + + + + +#endif diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/usb.mk b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/usb.mk index 331859e78..b6f00e2a2 100644 --- a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/usb.mk +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/usb.mk @@ -43,6 +43,7 @@ INC_DIR = -I$(KERNEL_ROOT)/services/drivers/usb/ \ -I$(KERNEL_ROOT)/services/drivers/usb/components/mem \ -I$(KERNEL_ROOT)/services/drivers/usb/components/osal \ -I$(KERNEL_ROOT)/services/drivers/usb/components/port \ + -I$(KERNEL_ROOT)/services/drivers/usb/components/port/dwc3 \ -I$(KERNEL_ROOT)/services/drivers/usb/components/port/xhci \ -I$(KERNEL_ROOT)/services/drivers/usb/usb_service \ -I$(KERNEL_ROOT)/services//semaphore \