From b8da46fda664d06f0afa2fbd0fab6e2acd603a93 Mon Sep 17 00:00:00 2001 From: Peter Hoyes Date: Fri, 9 Jul 2021 10:52:06 +0100 Subject: [PATCH 01/12] net: Use phys_addr_t for SMC net device addresses Use same type as eth_device->iobase and support addresses greater than INT_MAX. Signed-off-by: Peter Hoyes Reviewed-by: Ramon Fried Reviewed-by: Andre Przywara --- drivers/net/smc91111.c | 2 +- drivers/net/smc911x.c | 2 +- include/netdev.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/smc91111.c b/drivers/net/smc91111.c index ec4e8e928c..61d7f3df69 100644 --- a/drivers/net/smc91111.c +++ b/drivers/net/smc91111.c @@ -1269,7 +1269,7 @@ static void print_packet( byte * buf, int length ) } #endif -int smc91111_initialize(u8 dev_num, int base_addr) +int smc91111_initialize(u8 dev_num, phys_addr_t base_addr) { struct smc91111_priv *priv; struct eth_device *dev; diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index 3afebee440..8f420261fa 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c @@ -478,7 +478,7 @@ static int smc911x_recv(struct eth_device *dev) return ret; } -int smc911x_initialize(u8 dev_num, int base_addr) +int smc911x_initialize(u8 dev_num, phys_addr_t base_addr) { struct smc911x_priv *priv; int ret; diff --git a/include/netdev.h b/include/netdev.h index b960c42106..00a0993a83 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -70,8 +70,8 @@ int rtl8169_initialize(struct bd_info *bis); int scc_initialize(struct bd_info *bis); int sh_eth_initialize(struct bd_info *bis); int skge_initialize(struct bd_info *bis); -int smc91111_initialize(u8 dev_num, int base_addr); -int smc911x_initialize(u8 dev_num, int base_addr); +int smc91111_initialize(u8 dev_num, phys_addr_t base_addr); +int smc911x_initialize(u8 dev_num, phys_addr_t base_addr); int uec_standard_init(struct bd_info *bis); int uli526x_initialize(struct bd_info *bis); int armada100_fec_register(unsigned long base_addr); From d33982d5bc442a0dc720962160019cad518d266e Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Tue, 20 Jul 2021 20:09:51 +0200 Subject: [PATCH 02/12] net: eth-phy: add support of device tree configuration for gpio reset The gpio reset and the assert or deassert delay are defined in generic binding of the ethernet phy in Linux: Documentation/devicetree/bindings/net/ethernet-phy.yaml reset-gpios: maxItems: 1 description: The GPIO phandle and specifier for the PHY reset signal. reset-assert-us: description: Delay after the reset was asserted in microseconds. If this property is missing the delay will be skipped. reset-deassert-us: description: Delay after the reset was deasserted in microseconds. If this property is missing the delay will be skipped. See also U-Boot: doc/device-tree-bindings/net/phy.txt This patch adds the parsing of this common DT properties in the u-class "eth_phy_generic", used by default in the associated driver "eth_phy_generic_drv" This parsing function eth_phy_of_to_plat can be reused by other ethernet phy drivers for this uclass UCLASS_ETH_PHY. Signed-off-by: Patrick Delaunay Reviewed-by: Ramon Fried --- drivers/net/eth-phy-uclass.c | 56 ++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/drivers/net/eth-phy-uclass.c b/drivers/net/eth-phy-uclass.c index 07aebd935e..7abed14392 100644 --- a/drivers/net/eth-phy-uclass.c +++ b/drivers/net/eth-phy-uclass.c @@ -6,12 +6,17 @@ #include #include #include +#include #include #include #include +#include struct eth_phy_device_priv { struct mii_dev *mdio_bus; + struct gpio_desc reset_gpio; + u32 reset_assert_delay; + u32 reset_deassert_delay; }; int eth_phy_binds_nodes(struct udevice *eth_dev) @@ -110,13 +115,64 @@ int eth_phy_get_addr(struct udevice *dev) return reg; } +/* parsing generic properties of devicetree/bindings/net/ethernet-phy.yaml */ +static int eth_phy_of_to_plat(struct udevice *dev) +{ + struct eth_phy_device_priv *uc_priv = dev_get_uclass_priv(dev); + int ret; + + if (!CONFIG_IS_ENABLED(DM_GPIO)) + return 0; + + /* search "reset-gpios" in phy node */ + ret = gpio_request_by_name(dev, "reset-gpios", 0, + &uc_priv->reset_gpio, + GPIOD_IS_OUT); + if (ret != -ENOENT) + return ret; + + uc_priv->reset_assert_delay = dev_read_u32_default(dev, "reset-assert-us", 0); + uc_priv->reset_deassert_delay = dev_read_u32_default(dev, "reset-deassert-us", 0); + + return 0; +} + +void eth_phy_reset(struct udevice *dev, int value) +{ + struct eth_phy_device_priv *uc_priv = dev_get_uclass_priv(dev); + u32 delay; + + if (!CONFIG_IS_ENABLED(DM_GPIO)) + return; + + if (!dm_gpio_is_valid(&uc_priv->reset_gpio)) + return; + + dm_gpio_set_value(&uc_priv->reset_gpio, value); + + delay = value ? uc_priv->reset_assert_delay : uc_priv->reset_deassert_delay; + if (delay) + udelay(delay); +} + +static int eth_phy_pre_probe(struct udevice *dev) +{ + /* Assert and deassert the reset signal */ + eth_phy_reset(dev, 1); + eth_phy_reset(dev, 0); + + return 0; +} + UCLASS_DRIVER(eth_phy_generic) = { .id = UCLASS_ETH_PHY, .name = "eth_phy_generic", .per_device_auto = sizeof(struct eth_phy_device_priv), + .pre_probe = eth_phy_pre_probe, }; U_BOOT_DRIVER(eth_phy_generic_drv) = { .name = "eth_phy_generic_drv", .id = UCLASS_ETH_PHY, + .of_to_plat = eth_phy_of_to_plat, }; From 880ecb09b9d14ca3f3653e7ad8f92c1c8ca89690 Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Tue, 20 Jul 2021 20:09:52 +0200 Subject: [PATCH 03/12] net: eth-phy: use dev_dbg and log_notice Replace debug trace and printf to log macros: - debug() replaced by dev_dbg() when device is available, this macro indicate the device name since commit ceb70bb870ac ("dm: Print device name in dev_xxx like Linux") - printf() replaced by log_notice() to allow dispatch to log backends. Reviewed-by: Ramon Fried Signed-off-by: Patrick Delaunay --- drivers/net/eth-phy-uclass.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/net/eth-phy-uclass.c b/drivers/net/eth-phy-uclass.c index 7abed14392..aa5b05abc8 100644 --- a/drivers/net/eth-phy-uclass.c +++ b/drivers/net/eth-phy-uclass.c @@ -5,8 +5,10 @@ #include #include +#include #include #include +#include #include #include #include @@ -27,25 +29,25 @@ int eth_phy_binds_nodes(struct udevice *eth_dev) mdio_node = dev_read_subnode(eth_dev, "mdio"); if (!ofnode_valid(mdio_node)) { - debug("%s: %s mdio subnode not found!", __func__, - eth_dev->name); + dev_dbg(eth_dev, "%s: %s mdio subnode not found!", __func__, + eth_dev->name); return -ENXIO; } ofnode_for_each_subnode(phy_node, mdio_node) { node_name = ofnode_get_name(phy_node); - debug("* Found child node: '%s'\n", node_name); + dev_dbg(eth_dev, "* Found child node: '%s'\n", node_name); ret = device_bind_driver_to_node(eth_dev, "eth_phy_generic_drv", node_name, phy_node, NULL); if (ret) { - debug(" - Eth phy binding error: %d\n", ret); + dev_dbg(eth_dev, " - Eth phy binding error: %d\n", ret); continue; } - debug(" - bound phy device: '%s'\n", node_name); + dev_dbg(eth_dev, " - bound phy device: '%s'\n", node_name); } return 0; @@ -86,14 +88,14 @@ struct mii_dev *eth_phy_get_mdio_bus(struct udevice *eth_dev) */ uc_priv = (struct eth_phy_device_priv *)(dev_get_uclass_priv(phy_dev)); if (uc_priv->mdio_bus) - printf("Get shared mii bus on %s\n", eth_dev->name); + log_notice("Get shared mii bus on %s\n", eth_dev->name); else - printf("Can't get shared mii bus on %s\n", eth_dev->name); + log_notice("Can't get shared mii bus on %s\n", eth_dev->name); return uc_priv->mdio_bus; } } else { - printf("FEC: can't find phy-handle\n"); + log_notice("FEC: can't find phy-handle\n"); } return NULL; @@ -106,7 +108,7 @@ int eth_phy_get_addr(struct udevice *dev) if (dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0, &phandle_args)) { - debug("Failed to find phy-handle"); + dev_dbg(dev, "Failed to find phy-handle"); return -ENODEV; } From 035d8483acbb7fe035e87d6152c40f631e28be9c Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Tue, 20 Jul 2021 20:09:53 +0200 Subject: [PATCH 04/12] net: eth-phy: manage subnode mdio0 Bind any subnode with name beginning by mdio, mdio0 for example, and not only the "mdio" as namei of subnode. Reviewed-by: Ramon Fried Signed-off-by: Patrick Delaunay --- drivers/net/eth-phy-uclass.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/eth-phy-uclass.c b/drivers/net/eth-phy-uclass.c index aa5b05abc8..293579dc34 100644 --- a/drivers/net/eth-phy-uclass.c +++ b/drivers/net/eth-phy-uclass.c @@ -27,12 +27,18 @@ int eth_phy_binds_nodes(struct udevice *eth_dev) const char *node_name; int ret; - mdio_node = dev_read_subnode(eth_dev, "mdio"); + /* search a subnode named "mdio.*" */ + dev_for_each_subnode(mdio_node, eth_dev) { + node_name = ofnode_get_name(mdio_node); + if (!strncmp(node_name, "mdio", 4)) + break; + } if (!ofnode_valid(mdio_node)) { - dev_dbg(eth_dev, "%s: %s mdio subnode not found!", __func__, + dev_dbg(eth_dev, "%s: %s mdio subnode not found!\n", __func__, eth_dev->name); return -ENXIO; } + dev_dbg(eth_dev, "%s: %s subnode found!\n", __func__, node_name); ofnode_for_each_subnode(phy_node, mdio_node) { node_name = ofnode_get_name(phy_node); From ebf9a91f86363cdf67839233d395621927954cee Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Tue, 20 Jul 2021 20:09:54 +0200 Subject: [PATCH 05/12] net: dwc_eth_qos: remove the field phyaddr of the struct eqos_priv Since the commit commit 6a895d039ba7 ("net: Update eQos driver and FEC driver to use eth phy interfaces") the field phyaddr of driver private data struct eqos_priv is no more used in eqos_start() for the phy_connect() parameter. Now this variable is only initialized in eqos_probe_resources_stm32() it can be removed. Reviewed-by: Ramon Fried Signed-off-by: Patrick Delaunay --- drivers/net/dwc_eth_qos.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c index f048e9d585..a57c35785f 100644 --- a/drivers/net/dwc_eth_qos.c +++ b/drivers/net/dwc_eth_qos.c @@ -307,7 +307,6 @@ struct eqos_priv { struct clk clk_slave_bus; struct mii_dev *mii; struct phy_device *phy; - int phyaddr; u32 max_speed; void *descs; int tx_desc_idx, rx_desc_idx; @@ -1813,7 +1812,6 @@ static int eqos_probe_resources_stm32(struct udevice *dev) if (ret) pr_warn("No phy clock provided %d", ret); - eqos->phyaddr = -1; ret = dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0, &phandle_args); if (!ret) { @@ -1826,9 +1824,6 @@ static int eqos_probe_resources_stm32(struct udevice *dev) if (ret) pr_warn("gpio_request_by_name(phy reset) not provided %d", ret); - - eqos->phyaddr = ofnode_read_u32_default(phandle_args.node, - "reg", -1); } debug("%s: OK\n", __func__); From 9dbdc234a78f88bfa5d1d09046babf960c512298 Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Tue, 20 Jul 2021 20:09:55 +0200 Subject: [PATCH 06/12] net: dwc_eth_qos: use generic ethernet phy for stm32 variant Use the generic ethernet phy which already manages the correct binding for gpio reset, including the assert an deassert delays. Reviewed-by: Ramon Fried Signed-off-by: Patrick Delaunay --- drivers/net/Kconfig | 1 + drivers/net/dwc_eth_qos.c | 50 --------------------------------------- 2 files changed, 1 insertion(+), 50 deletions(-) diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 726ad36b7c..130db9fb39 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -206,6 +206,7 @@ config DWC_ETH_QOS_IMX config DWC_ETH_QOS_STM32 bool "Synopsys DWC Ethernet QOS device support for STM32" depends on DWC_ETH_QOS + select DM_ETH_PHY default y if ARCH_STM32MP help The Synopsys Designware Ethernet QOS IP block with the specific diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c index a57c35785f..9b1746b78b 100644 --- a/drivers/net/dwc_eth_qos.c +++ b/drivers/net/dwc_eth_qos.c @@ -696,29 +696,6 @@ static int eqos_start_resets_tegra186(struct udevice *dev) static int eqos_start_resets_stm32(struct udevice *dev) { - struct eqos_priv *eqos = dev_get_priv(dev); - int ret; - - debug("%s(dev=%p):\n", __func__, dev); - if (dm_gpio_is_valid(&eqos->phy_reset_gpio)) { - ret = dm_gpio_set_value(&eqos->phy_reset_gpio, 1); - if (ret < 0) { - pr_err("dm_gpio_set_value(phy_reset, assert) failed: %d", - ret); - return ret; - } - - udelay(2); - - ret = dm_gpio_set_value(&eqos->phy_reset_gpio, 0); - if (ret < 0) { - pr_err("dm_gpio_set_value(phy_reset, deassert) failed: %d", - ret); - return ret; - } - } - debug("%s: OK\n", __func__); - return 0; } @@ -739,18 +716,6 @@ static int eqos_stop_resets_tegra186(struct udevice *dev) static int eqos_stop_resets_stm32(struct udevice *dev) { - struct eqos_priv *eqos = dev_get_priv(dev); - int ret; - - if (dm_gpio_is_valid(&eqos->phy_reset_gpio)) { - ret = dm_gpio_set_value(&eqos->phy_reset_gpio, 1); - if (ret < 0) { - pr_err("dm_gpio_set_value(phy_reset, assert) failed: %d", - ret); - return ret; - } - } - return 0; } @@ -1772,7 +1737,6 @@ static int eqos_probe_resources_stm32(struct udevice *dev) struct eqos_priv *eqos = dev_get_priv(dev); int ret; phy_interface_t interface; - struct ofnode_phandle_args phandle_args; debug("%s(dev=%p):\n", __func__, dev); @@ -1812,20 +1776,6 @@ static int eqos_probe_resources_stm32(struct udevice *dev) if (ret) pr_warn("No phy clock provided %d", ret); - ret = dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0, - &phandle_args); - if (!ret) { - /* search "reset-gpios" in phy node */ - ret = gpio_request_by_name_nodev(phandle_args.node, - "reset-gpios", 0, - &eqos->phy_reset_gpio, - GPIOD_IS_OUT | - GPIOD_IS_OUT_ACTIVE); - if (ret) - pr_warn("gpio_request_by_name(phy reset) not provided %d", - ret); - } - debug("%s: OK\n", __func__); return 0; From c6a0df2d1dee30d241ce9831178f5de17dd4a61e Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Tue, 20 Jul 2021 20:09:56 +0200 Subject: [PATCH 07/12] net: dwc: add a common empty ops eqos_null_ops Add a common empty ops: eqos_null_ops() to remove the duplicated empty functions and reduce the driver size for stm32 and imx config. This patch also aligns the prototype of ops 'eqos_stop_clks' with other eqos ops by adding return value. Reviewed-by: Ramon Fried Signed-off-by: Patrick Delaunay --- drivers/net/dwc_eth_qos.c | 97 +++++++++------------------------------ 1 file changed, 22 insertions(+), 75 deletions(-) diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c index 9b1746b78b..79eb6cc926 100644 --- a/drivers/net/dwc_eth_qos.c +++ b/drivers/net/dwc_eth_qos.c @@ -281,7 +281,7 @@ struct eqos_ops { int (*eqos_remove_resources)(struct udevice *dev); int (*eqos_stop_resets)(struct udevice *dev); int (*eqos_start_resets)(struct udevice *dev); - void (*eqos_stop_clks)(struct udevice *dev); + int (*eqos_stop_clks)(struct udevice *dev); int (*eqos_start_clks)(struct udevice *dev); int (*eqos_calibrate_pads)(struct udevice *dev); int (*eqos_disable_calibration)(struct udevice *dev); @@ -613,12 +613,7 @@ err: #endif } -static int eqos_start_clks_imx(struct udevice *dev) -{ - return 0; -} - -static void eqos_stop_clks_tegra186(struct udevice *dev) +static int eqos_stop_clks_tegra186(struct udevice *dev) { #ifdef CONFIG_CLK struct eqos_priv *eqos = dev_get_priv(dev); @@ -633,9 +628,10 @@ static void eqos_stop_clks_tegra186(struct udevice *dev) #endif debug("%s: OK\n", __func__); + return 0; } -static void eqos_stop_clks_stm32(struct udevice *dev) +static int eqos_stop_clks_stm32(struct udevice *dev) { #ifdef CONFIG_CLK struct eqos_priv *eqos = dev_get_priv(dev); @@ -648,11 +644,7 @@ static void eqos_stop_clks_stm32(struct udevice *dev) #endif debug("%s: OK\n", __func__); -} - -static void eqos_stop_clks_imx(struct udevice *dev) -{ - /* empty */ + return 0; } static int eqos_start_resets_tegra186(struct udevice *dev) @@ -694,16 +686,6 @@ static int eqos_start_resets_tegra186(struct udevice *dev) return 0; } -static int eqos_start_resets_stm32(struct udevice *dev) -{ - return 0; -} - -static int eqos_start_resets_imx(struct udevice *dev) -{ - return 0; -} - static int eqos_stop_resets_tegra186(struct udevice *dev) { struct eqos_priv *eqos = dev_get_priv(dev); @@ -714,16 +696,6 @@ static int eqos_stop_resets_tegra186(struct udevice *dev) return 0; } -static int eqos_stop_resets_stm32(struct udevice *dev) -{ - return 0; -} - -static int eqos_stop_resets_imx(struct udevice *dev) -{ - return 0; -} - static int eqos_calibrate_pads_tegra186(struct udevice *dev) { struct eqos_priv *eqos = dev_get_priv(dev); @@ -812,26 +784,6 @@ static ulong eqos_get_tick_clk_rate_imx(struct udevice *dev) return imx_get_eqos_csr_clk(); } -static int eqos_calibrate_pads_stm32(struct udevice *dev) -{ - return 0; -} - -static int eqos_calibrate_pads_imx(struct udevice *dev) -{ - return 0; -} - -static int eqos_disable_calibration_stm32(struct udevice *dev) -{ - return 0; -} - -static int eqos_disable_calibration_imx(struct udevice *dev) -{ - return 0; -} - static int eqos_set_full_duplex(struct udevice *dev) { struct eqos_priv *eqos = dev_get_priv(dev); @@ -928,11 +880,6 @@ static int eqos_set_tx_clk_speed_tegra186(struct udevice *dev) return 0; } -static int eqos_set_tx_clk_speed_stm32(struct udevice *dev) -{ - return 0; -} - static int eqos_set_tx_clk_speed_imx(struct udevice *dev) { struct eqos_priv *eqos = dev_get_priv(dev); @@ -1881,11 +1828,6 @@ static int eqos_remove_resources_stm32(struct udevice *dev) return 0; } -static int eqos_remove_resources_imx(struct udevice *dev) -{ - return 0; -} - static int eqos_probe(struct udevice *dev) { struct eqos_priv *eqos = dev_get_priv(dev); @@ -1974,6 +1916,11 @@ static int eqos_remove(struct udevice *dev) return 0; } +static int eqos_null_ops(struct udevice *dev) +{ + return 0; +} + static const struct eth_ops eqos_ops = { .start = eqos_start, .stop = eqos_stop, @@ -2019,13 +1966,13 @@ static struct eqos_ops eqos_stm32_ops = { .eqos_flush_buffer = eqos_flush_buffer_generic, .eqos_probe_resources = eqos_probe_resources_stm32, .eqos_remove_resources = eqos_remove_resources_stm32, - .eqos_stop_resets = eqos_stop_resets_stm32, - .eqos_start_resets = eqos_start_resets_stm32, + .eqos_stop_resets = eqos_null_ops, + .eqos_start_resets = eqos_null_ops, .eqos_stop_clks = eqos_stop_clks_stm32, .eqos_start_clks = eqos_start_clks_stm32, - .eqos_calibrate_pads = eqos_calibrate_pads_stm32, - .eqos_disable_calibration = eqos_disable_calibration_stm32, - .eqos_set_tx_clk_speed = eqos_set_tx_clk_speed_stm32, + .eqos_calibrate_pads = eqos_null_ops, + .eqos_disable_calibration = eqos_null_ops, + .eqos_set_tx_clk_speed = eqos_null_ops, .eqos_get_tick_clk_rate = eqos_get_tick_clk_rate_stm32 }; @@ -2046,13 +1993,13 @@ static struct eqos_ops eqos_imx_ops = { .eqos_inval_buffer = eqos_inval_buffer_generic, .eqos_flush_buffer = eqos_flush_buffer_generic, .eqos_probe_resources = eqos_probe_resources_imx, - .eqos_remove_resources = eqos_remove_resources_imx, - .eqos_stop_resets = eqos_stop_resets_imx, - .eqos_start_resets = eqos_start_resets_imx, - .eqos_stop_clks = eqos_stop_clks_imx, - .eqos_start_clks = eqos_start_clks_imx, - .eqos_calibrate_pads = eqos_calibrate_pads_imx, - .eqos_disable_calibration = eqos_disable_calibration_imx, + .eqos_remove_resources = eqos_null_ops, + .eqos_stop_resets = eqos_null_ops, + .eqos_start_resets = eqos_null_ops, + .eqos_stop_clks = eqos_null_ops, + .eqos_start_clks = eqos_null_ops, + .eqos_calibrate_pads = eqos_null_ops, + .eqos_disable_calibration = eqos_null_ops, .eqos_set_tx_clk_speed = eqos_set_tx_clk_speed_imx, .eqos_get_tick_clk_rate = eqos_get_tick_clk_rate_imx }; From a5db6e1d814f41ba9a7ae3e2996b7d3d86e94099 Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Tue, 20 Jul 2021 20:15:28 +0200 Subject: [PATCH 08/12] net: eth-phy: define LOG_CATEGORY Define LOG_CATEGORY to allow filtering with log command. Signed-off-by: Patrick Delaunay Reviewed-by: Ramon Fried --- drivers/net/eth-phy-uclass.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/eth-phy-uclass.c b/drivers/net/eth-phy-uclass.c index 293579dc34..c04bab944d 100644 --- a/drivers/net/eth-phy-uclass.c +++ b/drivers/net/eth-phy-uclass.c @@ -3,6 +3,8 @@ * Copyright 2020 NXP */ +#define LOG_CATEGORY UCLASS_ETH_PHY + #include #include #include From b547f4bd9e15de1002bd45839c0fe95b0bea799a Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Tue, 20 Jul 2021 20:15:29 +0200 Subject: [PATCH 09/12] net: dwc_eth_qos: define LOG_CATEGORY Define LOG_CATEGORY to allow filtering with log command. Signed-off-by: Patrick Delaunay Reviewed-by: Ramon Fried --- drivers/net/dwc_eth_qos.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c index 79eb6cc926..585101804d 100644 --- a/drivers/net/dwc_eth_qos.c +++ b/drivers/net/dwc_eth_qos.c @@ -27,6 +27,8 @@ * all clock and reset signals to the HW block. */ +#define LOG_CATEGORY UCLASS_ETH + #include #include #include From 79d191efa10b1b3822084eb2008b7917b3c4700f Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Tue, 20 Jul 2021 20:15:30 +0200 Subject: [PATCH 10/12] net: define LOG_CATEGORY Define LOG_CATEGORY to allow filtering with log command. Signed-off-by: Patrick Delaunay Reviewed-by: Ramon Fried --- net/eth-uclass.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/eth-uclass.c b/net/eth-uclass.c index 5146bd6666..c2a97d723a 100644 --- a/net/eth-uclass.c +++ b/net/eth-uclass.c @@ -5,6 +5,8 @@ * Joe Hershberger, National Instruments */ +#define LOG_CATEGORY UCLASS_ETH + #include #include #include From b9b7b5e49c2635eeb0b53c54fd2db51626de467d Mon Sep 17 00:00:00 2001 From: Cosmin-Florin Aluchenesei Date: Wed, 21 Jul 2021 19:13:11 +0300 Subject: [PATCH 11/12] drivers: net: aquantia: fix unsigned compared against 0 Change the reg variable to not be unsigned so that we not get into an unsigned compared against 0. Signed-off-by: Cosmin-Florin Aluchenesei Reviewed-by: Ramon Fried --- drivers/net/phy/aquantia.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c index 9061afa620..d3d35a75d0 100644 --- a/drivers/net/phy/aquantia.c +++ b/drivers/net/phy/aquantia.c @@ -3,7 +3,7 @@ * Aquantia PHY drivers * * Copyright 2014 Freescale Semiconductor, Inc. - * Copyright 2018 NXP + * Copyright 2018, 2021 NXP */ #include #include @@ -554,8 +554,9 @@ int aquantia_config(struct phy_device *phydev) int aquantia_startup(struct phy_device *phydev) { - u32 reg, speed; + u32 speed; int i = 0; + int reg; phydev->duplex = DUPLEX_FULL; From 669884ea6f290e5ec912a2fe4d10c687a04cd239 Mon Sep 17 00:00:00 2001 From: Cosmin-Florin Aluchenesei Date: Wed, 21 Jul 2021 19:13:33 +0300 Subject: [PATCH 12/12] net: fsl-mc: fix logically dead code The result of dpio_close() is actually taken into account. Signed-off-by: Cosmin-Florin Aluchenesei Reviewed-by: Ramon Fried --- drivers/net/fsl-mc/mc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c index 972db4cf3a..914ec001ec 100644 --- a/drivers/net/fsl-mc/mc.c +++ b/drivers/net/fsl-mc/mc.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2014 Freescale Semiconductor, Inc. - * Copyright 2017-2018, 2020 NXP + * Copyright 2017-2018, 2020-2021 NXP */ #include #include @@ -1126,7 +1126,7 @@ static int dpio_exit(void) goto err; } - dpio_close(dflt_mc_io, MC_CMD_NO_FLAGS, dflt_dpio->dpio_handle); + err = dpio_close(dflt_mc_io, MC_CMD_NO_FLAGS, dflt_dpio->dpio_handle); if (err < 0) { printf("dpio_close() failed: %d\n", err); goto err;