xref: /rk3399_rockchip-uboot/include/usb/dwc2_udc.h (revision 1a4f6af8bfd44c8ae6e87a81ff125eed47042cc5)
15d5716eeSMarek Vasut /*
25d5716eeSMarek Vasut  * drivers/usb/gadget/dwc2_udc.h
35d5716eeSMarek Vasut  * Designware DWC2 on-chip full/high speed USB device controllers
45d5716eeSMarek Vasut  * Copyright (C) 2005 for Samsung Electronics
55d5716eeSMarek Vasut  *
65d5716eeSMarek Vasut  * SPDX-License-Identifier:	GPL-2.0+
75d5716eeSMarek Vasut  */
85d5716eeSMarek Vasut 
95d5716eeSMarek Vasut #ifndef __DWC2_USB_GADGET
105d5716eeSMarek Vasut #define __DWC2_USB_GADGET
115d5716eeSMarek Vasut 
125d5716eeSMarek Vasut #define PHY0_SLEEP              (1 << 5)
136187c346SPatrice Chotard #define DWC2_MAX_HW_ENDPOINTS	16
145d5716eeSMarek Vasut 
155d5716eeSMarek Vasut struct dwc2_plat_otg_data {
16fab33579SXu Ziyuan 	void		*priv;
17fab33579SXu Ziyuan 	int		phy_of_node;
185d5716eeSMarek Vasut 	int		(*phy_control)(int on);
195d5716eeSMarek Vasut 	unsigned int	regs_phy;
2092693b5aSPhilipp Tomsich 	uintptr_t	regs_otg;
215d5716eeSMarek Vasut 	unsigned int    usb_phy_ctrl;
225d5716eeSMarek Vasut 	unsigned int    usb_flags;
235d5716eeSMarek Vasut 	unsigned int	usb_gusbcfg;
2447117882SXu Ziyuan 	unsigned int	rx_fifo_sz;
2547117882SXu Ziyuan 	unsigned int	np_tx_fifo_sz;
2647117882SXu Ziyuan 	unsigned int	tx_fifo_sz;
276187c346SPatrice Chotard 	unsigned int	tx_fifo_sz_array[DWC2_MAX_HW_ENDPOINTS];
286187c346SPatrice Chotard 	unsigned char   tx_fifo_sz_nb;
295c4beedbSPatrick Delaunay 	bool		force_b_session_valid;
30*acd7aca8SPatrick Delaunay 	bool		activate_stm_id_vb_detection;
315d5716eeSMarek Vasut };
325d5716eeSMarek Vasut 
335d5716eeSMarek Vasut int dwc2_udc_probe(struct dwc2_plat_otg_data *pdata);
345d5716eeSMarek Vasut 
353015f8beSPatrick Delaunay int dwc2_udc_B_session_valid(struct udevice *dev);
363015f8beSPatrick Delaunay 
375d5716eeSMarek Vasut #endif	/* __DWC2_USB_GADGET */
38