diff mbox series

[1/4] net: dwc_eth_qos: add i.MX93 support

Message ID 20230727083336.15301-2-sebastien.szymanski@armadeus.com
State Awaiting Upstream
Delegated to: Stefano Babic
Headers show
Series imx93: add DWC EQoS MAC driver support | expand

Commit Message

Sébastien Szymanski July 27, 2023, 8:33 a.m. UTC
Add support for DWC EQoS MAC on i.MX93.

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
---
 drivers/net/dwc_eth_qos.c     | 4 ++++
 drivers/net/dwc_eth_qos_imx.c | 3 +++
 2 files changed, 7 insertions(+)

Comments

Stefano Babic Oct. 16, 2023, 2:22 p.m. UTC | #1
Hi Sebastian,

On 27.07.23 10:33, Sébastien Szymanski wrote:
> Add support for DWC EQoS MAC on i.MX93.
> 
> Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
> ---
>   drivers/net/dwc_eth_qos.c     | 4 ++++
>   drivers/net/dwc_eth_qos_imx.c | 3 +++
>   2 files changed, 7 insertions(+)
> 
> diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c
> index 1e92bd9ca9c0..f70f8afe5831 100644
> --- a/drivers/net/dwc_eth_qos.c
> +++ b/drivers/net/dwc_eth_qos.c
> @@ -1717,6 +1717,10 @@ static const struct udevice_id eqos_ids[] = {
>   		.compatible = "nxp,imx8mp-dwmac-eqos",
>   		.data = (ulong)&eqos_imx_config
>   	},
> +	{
> +		.compatible = "nxp,imx93-dwmac-eqos",
> +		.data = (ulong)&eqos_imx_config
> +	},
>   #endif
>   
>   #if IS_ENABLED(CONFIG_DWC_ETH_QOS_QCOM)
> diff --git a/drivers/net/dwc_eth_qos_imx.c b/drivers/net/dwc_eth_qos_imx.c
> index 60f3f3f5a10f..e3f55dd98173 100644
> --- a/drivers/net/dwc_eth_qos_imx.c
> +++ b/drivers/net/dwc_eth_qos_imx.c
> @@ -181,6 +181,9 @@ static int eqos_set_tx_clk_speed_imx(struct udevice *dev)
>   	ulong rate;
>   	int ret;
>   
> +	if (device_is_compatible(dev, "nxp,imx93-dwmac-eqos"))
> +		return 0;
> +
>   	debug("%s(dev=%p):\n", __func__, dev);
>   
>   	if (eqos->phy->interface == PHY_INTERFACE_MODE_RMII)

Your series breaks Rockchip's boards. For example:

+aarch64-linux-ld.bfd: 
drivers/net/dwc_eth_qos.o:(.rodata.eqos_ids+0x28): undefined reference 
to `eqos_imx_config'
+make[1]: *** [Makefile:1765: u-boot] Error 1
+make: *** [Makefile:177: sub-make] Error 2
    aarch64:  w+   rock-4c-plus-rk3399

But it is just an example, quite all boards are broken. Please check 
this and repost, thanks !

Best regards,
Stefano
Sébastien Szymanski Oct. 17, 2023, 8:50 a.m. UTC | #2
Hi Stefano,

On 10/16/23 16:22, Stefano Babic wrote:
> Hi Sebastian,
> 
> On 27.07.23 10:33, Sébastien Szymanski wrote:
>> Add support for DWC EQoS MAC on i.MX93.
>>
>> Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
>> ---
>>   drivers/net/dwc_eth_qos.c     | 4 ++++
>>   drivers/net/dwc_eth_qos_imx.c | 3 +++
>>   2 files changed, 7 insertions(+)
>>
>> diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c
>> index 1e92bd9ca9c0..f70f8afe5831 100644
>> --- a/drivers/net/dwc_eth_qos.c
>> +++ b/drivers/net/dwc_eth_qos.c
>> @@ -1717,6 +1717,10 @@ static const struct udevice_id eqos_ids[] = {
>>           .compatible = "nxp,imx8mp-dwmac-eqos",
>>           .data = (ulong)&eqos_imx_config
>>       },
>> +    {
>> +        .compatible = "nxp,imx93-dwmac-eqos",
>> +        .data = (ulong)&eqos_imx_config
>> +    },
>>   #endif
>>   #if IS_ENABLED(CONFIG_DWC_ETH_QOS_QCOM)
>> diff --git a/drivers/net/dwc_eth_qos_imx.c 
>> b/drivers/net/dwc_eth_qos_imx.c
>> index 60f3f3f5a10f..e3f55dd98173 100644
>> --- a/drivers/net/dwc_eth_qos_imx.c
>> +++ b/drivers/net/dwc_eth_qos_imx.c
>> @@ -181,6 +181,9 @@ static int eqos_set_tx_clk_speed_imx(struct 
>> udevice *dev)
>>       ulong rate;
>>       int ret;
>> +    if (device_is_compatible(dev, "nxp,imx93-dwmac-eqos"))
>> +        return 0;
>> +
>>       debug("%s(dev=%p):\n", __func__, dev);
>>       if (eqos->phy->interface == PHY_INTERFACE_MODE_RMII)
> 
> Your series breaks Rockchip's boards. For example:
> 
> +aarch64-linux-ld.bfd: 
> drivers/net/dwc_eth_qos.o:(.rodata.eqos_ids+0x28): undefined reference 
> to `eqos_imx_config'
> +make[1]: *** [Makefile:1765: u-boot] Error 1
> +make: *** [Makefile:177: sub-make] Error 2
>     aarch64:  w+   rock-4c-plus-rk3399
> 
> But it is just an example, quite all boards are broken. Please check 
> this and repost, thanks !

https://source.denx.de/u-boot/custodians/u-boot-imx/-/blob/99807515b8eeff11487a278c956ed1893d54e61e/drivers/net/dwc_eth_qos.c#L1720

That's because, for some reason, the "nxp,imx93-dwmac-eqos" ended up in 
the if CONFIG_DWC_ETH_QOS_ROCKCHIP / def statement... I'll send a v2.

Also, I am confused: why did I receive mails saying other patches of 
this series have been applied ?

Regards,

> 
> Best regards,
> Stefano
>
Stefano Babic Oct. 17, 2023, 9:01 a.m. UTC | #3
On 17.10.23 10:50, Sébastien Szymanski wrote:
> Hi Stefano,
> 
> On 10/16/23 16:22, Stefano Babic wrote:
>> Hi Sebastian,
>>
>> On 27.07.23 10:33, Sébastien Szymanski wrote:
>>> Add support for DWC EQoS MAC on i.MX93.
>>>
>>> Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
>>> ---
>>>   drivers/net/dwc_eth_qos.c     | 4 ++++
>>>   drivers/net/dwc_eth_qos_imx.c | 3 +++
>>>   2 files changed, 7 insertions(+)
>>>
>>> diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c
>>> index 1e92bd9ca9c0..f70f8afe5831 100644
>>> --- a/drivers/net/dwc_eth_qos.c
>>> +++ b/drivers/net/dwc_eth_qos.c
>>> @@ -1717,6 +1717,10 @@ static const struct udevice_id eqos_ids[] = {
>>>           .compatible = "nxp,imx8mp-dwmac-eqos",
>>>           .data = (ulong)&eqos_imx_config
>>>       },
>>> +    {
>>> +        .compatible = "nxp,imx93-dwmac-eqos",
>>> +        .data = (ulong)&eqos_imx_config
>>> +    },
>>>   #endif
>>>   #if IS_ENABLED(CONFIG_DWC_ETH_QOS_QCOM)
>>> diff --git a/drivers/net/dwc_eth_qos_imx.c 
>>> b/drivers/net/dwc_eth_qos_imx.c
>>> index 60f3f3f5a10f..e3f55dd98173 100644
>>> --- a/drivers/net/dwc_eth_qos_imx.c
>>> +++ b/drivers/net/dwc_eth_qos_imx.c
>>> @@ -181,6 +181,9 @@ static int eqos_set_tx_clk_speed_imx(struct 
>>> udevice *dev)
>>>       ulong rate;
>>>       int ret;
>>> +    if (device_is_compatible(dev, "nxp,imx93-dwmac-eqos"))
>>> +        return 0;
>>> +
>>>       debug("%s(dev=%p):\n", __func__, dev);
>>>       if (eqos->phy->interface == PHY_INTERFACE_MODE_RMII)
>>
>> Your series breaks Rockchip's boards. For example:
>>
>> +aarch64-linux-ld.bfd: 
>> drivers/net/dwc_eth_qos.o:(.rodata.eqos_ids+0x28): undefined reference 
>> to `eqos_imx_config'
>> +make[1]: *** [Makefile:1765: u-boot] Error 1
>> +make: *** [Makefile:177: sub-make] Error 2
>>     aarch64:  w+   rock-4c-plus-rk3399
>>
>> But it is just an example, quite all boards are broken. Please check 
>> this and repost, thanks !
> 
> https://source.denx.de/u-boot/custodians/u-boot-imx/-/blob/99807515b8eeff11487a278c956ed1893d54e61e/drivers/net/dwc_eth_qos.c#L1720
> 
> That's because, for some reason, the "nxp,imx93-dwmac-eqos" ended up in 
> the if CONFIG_DWC_ETH_QOS_ROCKCHIP / def statement... I'll send a v2.
> 
> Also, I am confused: why did I receive mails saying other patches of 
> this series have been applied ?

This is my mistake, I forget to drop the series from the list when I 
removed from my tree, sorry for that.

I will wait for V2.

Regards,
Stefano

> 
> Regards,
> 
>>
>> Best regards,
>> Stefano
>>
>
diff mbox series

Patch

diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c
index 1e92bd9ca9c0..f70f8afe5831 100644
--- a/drivers/net/dwc_eth_qos.c
+++ b/drivers/net/dwc_eth_qos.c
@@ -1717,6 +1717,10 @@  static const struct udevice_id eqos_ids[] = {
 		.compatible = "nxp,imx8mp-dwmac-eqos",
 		.data = (ulong)&eqos_imx_config
 	},
+	{
+		.compatible = "nxp,imx93-dwmac-eqos",
+		.data = (ulong)&eqos_imx_config
+	},
 #endif
 
 #if IS_ENABLED(CONFIG_DWC_ETH_QOS_QCOM)
diff --git a/drivers/net/dwc_eth_qos_imx.c b/drivers/net/dwc_eth_qos_imx.c
index 60f3f3f5a10f..e3f55dd98173 100644
--- a/drivers/net/dwc_eth_qos_imx.c
+++ b/drivers/net/dwc_eth_qos_imx.c
@@ -181,6 +181,9 @@  static int eqos_set_tx_clk_speed_imx(struct udevice *dev)
 	ulong rate;
 	int ret;
 
+	if (device_is_compatible(dev, "nxp,imx93-dwmac-eqos"))
+		return 0;
+
 	debug("%s(dev=%p):\n", __func__, dev);
 
 	if (eqos->phy->interface == PHY_INTERFACE_MODE_RMII)