mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-11-28 22:21:49 +01:00
usb: dwc2: correctly handle binding for g-tx-fifo-size
Manage g-tx-fifo-size as a array as specify in the binding. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Marek Vasut <marex@denx.de>
This commit is contained in:
parent
5fa8fe105e
commit
7350a75b51
@ -1039,6 +1039,7 @@ static int dwc2_udc_otg_ofdata_to_platdata(struct udevice *dev)
|
|||||||
int node = dev_of_offset(dev);
|
int node = dev_of_offset(dev);
|
||||||
ulong drvdata;
|
ulong drvdata;
|
||||||
void (*set_params)(struct dwc2_plat_otg_data *data);
|
void (*set_params)(struct dwc2_plat_otg_data *data);
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (usb_get_dr_mode(node) != USB_DR_MODE_PERIPHERAL) {
|
if (usb_get_dr_mode(node) != USB_DR_MODE_PERIPHERAL) {
|
||||||
dev_dbg(dev, "Invalid mode\n");
|
dev_dbg(dev, "Invalid mode\n");
|
||||||
@ -1050,7 +1051,18 @@ static int dwc2_udc_otg_ofdata_to_platdata(struct udevice *dev)
|
|||||||
platdata->rx_fifo_sz = dev_read_u32_default(dev, "g-rx-fifo-size", 0);
|
platdata->rx_fifo_sz = dev_read_u32_default(dev, "g-rx-fifo-size", 0);
|
||||||
platdata->np_tx_fifo_sz = dev_read_u32_default(dev,
|
platdata->np_tx_fifo_sz = dev_read_u32_default(dev,
|
||||||
"g-np-tx-fifo-size", 0);
|
"g-np-tx-fifo-size", 0);
|
||||||
platdata->tx_fifo_sz = dev_read_u32_default(dev, "g-tx-fifo-size", 0);
|
|
||||||
|
platdata->tx_fifo_sz_nb =
|
||||||
|
dev_read_size(dev, "g-tx-fifo-size") / sizeof(u32);
|
||||||
|
if (platdata->tx_fifo_sz_nb > DWC2_MAX_HW_ENDPOINTS)
|
||||||
|
platdata->tx_fifo_sz_nb = DWC2_MAX_HW_ENDPOINTS;
|
||||||
|
if (platdata->tx_fifo_sz_nb) {
|
||||||
|
ret = dev_read_u32_array(dev, "g-tx-fifo-size",
|
||||||
|
platdata->tx_fifo_sz_array,
|
||||||
|
platdata->tx_fifo_sz_nb);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
platdata->force_b_session_valid =
|
platdata->force_b_session_valid =
|
||||||
dev_read_bool(dev, "u-boot,force-b-session-valid");
|
dev_read_bool(dev, "u-boot,force-b-session-valid");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user