[PATCH net-next v3 10/10] net: ti: icssg-prueth: Add ICSSG Ethernet driver for AM65x SR1.0 platforms

Diogo Ivo diogo.ivo at siemens.com
Tue Feb 27 04:05:14 PST 2024


On 2/22/24 13:31, Simon Horman wrote:
> On Wed, Feb 21, 2024 at 03:24:16PM +0000, Diogo Ivo wrote:
>> Add the PRUeth driver for the ICSSG subsystem found in AM65x SR1.0 devices.
>> The main differences that set SR1.0 and SR2.0 apart are the missing TXPRU
>> core in SR1.0, two extra DMA channels for management purposes and different
>> firmware that needs to be configured accordingly.
>>
>> Based on the work of Roger Quadros, Vignesh Raghavendra and
>> Grygorii Strashko in TI's 5.10 SDK [1].
>>
>> [1]: https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.ti.com%2Fcgit%2Fti-linux-kernel%2Fti-linux-kernel%2Ftree%2F%3Fh%3Dti-linux-5.10.y&data=05%7C02%7Cdiogo.ivo%40siemens.com%7Cfebc5e0f6a1b476c366d08dc33aa89ee%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C638442054773860177%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=YxcCwUMV7Zzyycb1Ss6xoCq9BK1vYsvuoF30XXA2tRI%3D&reserved=0
>>
>> Co-developed-by: Jan Kiszka <jan.kiszka at siemens.com>
>> Signed-off-by: Jan Kiszka <jan.kiszka at siemens.com>
>> Signed-off-by: Diogo Ivo <diogo.ivo at siemens.com>
> 
> ...
> 
>> diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c b/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c
> 
> ...
> 

...

>> +	config.rx_flow_id = emac->rx_flow_id_base; /* flow id for host port */
>> +	config.rx_mgr_flow_id = emac->rx_mgm_flow_id_base; /* for mgm ch */
>> +	config.rand_seed = get_random_u32();
> 
> Hi Diogo and Jan,
> 
> The fields of config above are all __le32.
> However the last three lines above assign host byte-order values to these
> fields. This does not seem correct.
> 
> This is flagged by Sparse along with some problems.
> Please ensure that new Sparse warnings are not introduced.
> 

You are correct, thank you for catching the inconsistency, this will be
fixed in v4.

...

>> +static int emac_send_command_sr1(struct prueth_emac *emac, u32 cmd)
>> +{
>> +	dma_addr_t desc_dma, buf_dma;
>> +	struct prueth_tx_chn *tx_chn;
>> +	struct cppi5_host_desc_t *first_desc;
>> +	u32 *data = emac->cmd_data;
>> +	u32 pkt_len = sizeof(emac->cmd_data);
>> +	void **swdata;
>> +	int ret = 0;
>> +	u32 *epib;
> 
> In new Networking code please express local variables in reverse xmas tree
> order - longest line to shortest.

Noted, will fix for v4.

...

> There is also one such problem in Patch 06/10.
Here xmastree reported the same problem in patch 08/10 rather than 
06/10, I assumed you meant that one.

Best regards,
Diogo



More information about the linux-arm-kernel mailing list