mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-12 07:57:21 +00:00
763bb106f6
All TX fifo size can be different, add tx_fifo_sz_array[] into dwc2_plat_otg_data to be able to set them. tx_fifo_sz_array[] is 17 Bytes long and can contains max 16 tx fifo size (synopsys IP supports max 16 IN endpoints). First entry of tx_fifo_sz_array[] is the number of valid fifo size the array contains. In case of tx_fifo_sz_array[] doesn't contains the same number of element than max hardware endpoint, display a warning message. Compatibility with board which doesn't use tx_fifo_sz_array[] (Rockchip rk322x/rk3128/rv1108/rk3288/rk3036) is kept. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
35 lines
880 B
C
35 lines
880 B
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
/*
|
|
* drivers/usb/gadget/dwc2_udc.h
|
|
* Designware DWC2 on-chip full/high speed USB device controllers
|
|
* Copyright (C) 2005 for Samsung Electronics
|
|
*/
|
|
|
|
#ifndef __DWC2_USB_GADGET
|
|
#define __DWC2_USB_GADGET
|
|
|
|
#define PHY0_SLEEP (1 << 5)
|
|
#define DWC2_MAX_HW_ENDPOINTS 16
|
|
|
|
struct dwc2_plat_otg_data {
|
|
void *priv;
|
|
int phy_of_node;
|
|
int (*phy_control)(int on);
|
|
uintptr_t regs_phy;
|
|
uintptr_t regs_otg;
|
|
unsigned int usb_phy_ctrl;
|
|
unsigned int usb_flags;
|
|
unsigned int usb_gusbcfg;
|
|
unsigned int rx_fifo_sz;
|
|
unsigned int np_tx_fifo_sz;
|
|
unsigned int tx_fifo_sz;
|
|
unsigned int tx_fifo_sz_array[DWC2_MAX_HW_ENDPOINTS];
|
|
unsigned char tx_fifo_sz_nb;
|
|
bool force_b_session_valid;
|
|
};
|
|
|
|
int dwc2_udc_probe(struct dwc2_plat_otg_data *pdata);
|
|
|
|
int dwc2_udc_B_session_valid(struct udevice *dev);
|
|
|
|
#endif /* __DWC2_USB_GADGET */
|