[U-Boot] [RESEND][PATCH v1 3/4] board: stm32mp1: Add tx_fifo_sz_array support

Marek Vasut marex at denx.de
Mon Mar 18 18:47:03 UTC 2019


On 3/18/19 5:59 PM, Patrice CHOTARD wrote:
> Hi Marek
> 
> +Patrick
> 
> On 3/14/19 1:00 PM, Marek Vasut wrote:
>> On 3/14/19 11:51 AM, Patrice Chotard wrote:
>>> Allows to use an array of tx-fifo-size defined in device tree
>>> as following:
>>>    g-tx-fifo-size = <128 128 64 64 64 64 32 32>;
>>>
>>> Signed-off-by: Patrice Chotard <patrice.chotard at st.com>
>>> ---
>>>
>>>  board/st/stm32mp1/stm32mp1.c | 11 +++++++++--
>>>  1 file changed, 9 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
>>> index 54feca0ecff5..81c080ff3199 100644
>>> --- a/board/st/stm32mp1/stm32mp1.c
>>> +++ b/board/st/stm32mp1/stm32mp1.c
>>> @@ -42,6 +42,7 @@ int board_usb_init(int index, enum usb_init_type init)
>>>  	int node;
>>>  	int phy_provider;
>>>  	int ret;
>>> +	int count;
>>>  
>>>  	/* find the usb otg node */
>>>  	node = fdt_node_offset_by_compatible(blob, -1, "snps,dwc2");
>>> @@ -138,8 +139,14 @@ int board_usb_init(int index, enum usb_init_type init)
>>>  						     "g-rx-fifo-size", 0);
>>>  	stm32mp_otg_data.np_tx_fifo_sz = fdtdec_get_int(blob, node,
>>>  							"g-np-tx-fifo-size", 0);
>>> -	stm32mp_otg_data.tx_fifo_sz = fdtdec_get_int(blob, node,
>>> -						     "g-tx-fifo-size", 0);
>>> +
>>> +	count = fdtdec_get_int_array_count(blob, node, "g-tx-fifo-size",
>>> +			&stm32mp_otg_data.tx_fifo_sz_array[DWC2_SIZE_OFFS],
>>> +			ARRAY_SIZE(stm32mp_otg_data.tx_fifo_sz_array));
>>> +
>>> +	if (count != -FDT_ERR_NOTFOUND)
>>> +		stm32mp_otg_data.tx_fifo_sz_array[DWC2_SIZE_NB_OFFS] = count;
>>
>> This should be in the driver , not board code.
> 
> Ok, Patrick Delaunay will rework the dwc2 gadget driver to be able to
> retrieve device tree properties.
> The series will be sent soon.

Thanks.

That said, are these fixes for current release or stuff for the next one ?

-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list