RE: [PATCH v11 17/38] net: cirrus: add DT support for Cirrus EP93xx

From: Sai Krishna Gajula
Date: Mon Jul 15 2024 - 12:03:05 EST



> -----Original Message-----
> From: Nikita Shubin via B4 Relay
> <devnull+nikita.shubin.maquefel.me@xxxxxxxxxx>
> Sent: Monday, July 15, 2024 2:08 PM
> To: Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>; David S. Miller
> <davem@xxxxxxxxxxxxx>; Eric Dumazet <edumazet@xxxxxxxxxx>; Jakub
> Kicinski <kuba@xxxxxxxxxx>; Paolo Abeni <pabeni@xxxxxxxxxx>
> Cc: netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Andrew Lunn
> <andrew@xxxxxxx>
> Subject: [PATCH v11 17/38] net: cirrus: add DT support for Cirrus
> EP93xx
>
> From: Nikita Shubin <nikita. shubin@ maquefel. me> - add OF ID match table -
> get phy_id from the device tree, as part of mdio - copy_addr is now always
> used, as there is no SoC/board that aren't - dropped platform header Signed-
> off-by: Nikita
> From: Nikita Shubin <nikita.shubin@xxxxxxxxxxx>
>
> - add OF ID match table
> - get phy_id from the device tree, as part of mdio
> - copy_addr is now always used, as there is no SoC/board that aren't
> - dropped platform header
>
> Signed-off-by: Nikita Shubin <nikita.shubin@xxxxxxxxxxx>
> Tested-by: Alexander Sverdlin <alexander.sverdlin@xxxxxxxxx>
> Reviewed-by: Andrew Lunn <andrew@xxxxxxx>
> Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

This patch seemed to be for net-next, in case NET, Fixes tag is required. Please check.

> ---
> drivers/net/ethernet/cirrus/ep93xx_eth.c | 63 ++++++++++++++++--------------
> --
> 1 file changed, 32 insertions(+), 31 deletions(-)
>
> diff --git a/drivers/net/ethernet/cirrus/ep93xx_eth.c
> b/drivers/net/ethernet/cirrus/ep93xx_eth.c
> index 1f495cfd7959..2523d9c9d1b8 100644
> --- a/drivers/net/ethernet/cirrus/ep93xx_eth.c
> +++ b/drivers/net/ethernet/cirrus/ep93xx_eth.c
> @@ -16,13 +16,12 @@
> #include <linux/ethtool.h>
> #include <linux/interrupt.h>
> #include <linux/moduleparam.h>
> +#include <linux/of.h>
> #include <linux/platform_device.h>
> #include <linux/delay.h>
> #include <linux/io.h>
> #include <linux/slab.h>
>
> -#include <linux/platform_data/eth-ep93xx.h>
> -
> #define DRV_MODULE_NAME "ep93xx-eth"
>
> #define RX_QUEUE_ENTRIES 64
> @@ -738,25 +737,6 @@ static const struct net_device_ops
> ep93xx_netdev_ops = {
> .ndo_set_mac_address = eth_mac_addr,
> };
>
> -static struct net_device *ep93xx_dev_alloc(struct ep93xx_eth_data *data) -{
> - struct net_device *dev;
> -
> - dev = alloc_etherdev(sizeof(struct ep93xx_priv));
> - if (dev == NULL)
> - return NULL;
> -
> - eth_hw_addr_set(dev, data->dev_addr);
> -
> - dev->ethtool_ops = &ep93xx_ethtool_ops;
> - dev->netdev_ops = &ep93xx_netdev_ops;
> -
> - dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM;
> -
> - return dev;
> -}
> -
> -
> static void ep93xx_eth_remove(struct platform_device *pdev) {
> struct net_device *dev;
> @@ -786,27 +766,47 @@ static void ep93xx_eth_remove(struct
> platform_device *pdev)
>
> static int ep93xx_eth_probe(struct platform_device *pdev) {
> - struct ep93xx_eth_data *data;
> struct net_device *dev;
> struct ep93xx_priv *ep;
> struct resource *mem;
> + void __iomem *base_addr;
> + struct device_node *np;

Small nit, please check if reverse x-mas tree order need to be follow here.

> + u32 phy_id;
> int irq;
> int err;
>

...

> static struct platform_driver ep93xx_eth_driver = {
> .probe = ep93xx_eth_probe,
> .remove_new = ep93xx_eth_remove,
> .driver = {
> .name = "ep93xx-eth",
> + .of_match_table = ep93xx_eth_of_ids,
> },
> };
>
>
> --
> 2.43.2
>
>