Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'net-cleanup-arc-emac'

Johan Jonker says:

====================
cleanup arc emac

The Rockchip emac binding for rk3036/rk3066/rk3188 has been converted to YAML
with the ethernet-phy node in a mdio node. This requires some driver fixes
by someone that can do hardware testing.

In order to make a future fix easier make the driver 'Rockchip only'
by removing the obsolete part of the arc emac driver.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+2 -154
-46
Documentation/devicetree/bindings/net/arc_emac.txt
··· 1 - * Synopsys ARC EMAC 10/100 Ethernet driver (EMAC) 2 - 3 - Required properties: 4 - - compatible: Should be "snps,arc-emac" 5 - - reg: Address and length of the register set for the device 6 - - interrupts: Should contain the EMAC interrupts 7 - - max-speed: see ethernet.txt file in the same directory. 8 - - phy: see ethernet.txt file in the same directory. 9 - 10 - Optional properties: 11 - - phy-reset-gpios : Should specify the gpio for phy reset 12 - - phy-reset-duration : Reset duration in milliseconds. Should present 13 - only if property "phy-reset-gpios" is available. Missing the property 14 - will have the duration be 1 millisecond. Numbers greater than 1000 are 15 - invalid and 1 millisecond will be used instead. 16 - 17 - Clock handling: 18 - The clock frequency is needed to calculate and set polling period of EMAC. 19 - It must be provided by one of: 20 - - clock-frequency: CPU frequency. 21 - - clocks: reference to the clock supplying the EMAC. 22 - 23 - Child nodes of the driver are the individual PHY devices connected to the 24 - MDIO bus. They must have a "reg" property given the PHY address on the MDIO bus. 25 - 26 - Examples: 27 - 28 - ethernet@c0fc2000 { 29 - compatible = "snps,arc-emac"; 30 - reg = <0xc0fc2000 0x3c>; 31 - interrupts = <6>; 32 - mac-address = [ 00 11 22 33 44 55 ]; 33 - 34 - clock-frequency = <80000000>; 35 - /* or */ 36 - clocks = <&emac_clock>; 37 - 38 - max-speed = <100>; 39 - phy = <&phy0>; 40 - 41 - #address-cells = <1>; 42 - #size-cells = <0>; 43 - phy0: ethernet-phy@0 { 44 - reg = <1>; 45 - }; 46 - };
-4
arch/arm/boot/dts/rockchip/rk3066a.dtsi
··· 879 879 &wdt { 880 880 compatible = "rockchip,rk3066-wdt", "snps,dw-wdt"; 881 881 }; 882 - 883 - &emac { 884 - compatible = "rockchip,rk3066-emac"; 885 - };
+2 -5
arch/arm/boot/dts/rockchip/rk3xxx.dtsi
··· 194 194 }; 195 195 196 196 emac: ethernet@10204000 { 197 - compatible = "snps,arc-emac"; 197 + compatible = "rockchip,rk3066-emac"; 198 198 reg = <0x10204000 0x3c>; 199 199 interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>; 200 - 201 - rockchip,grf = <&grf>; 202 - 203 200 clocks = <&cru HCLK_EMAC>, <&cru SCLK_MAC>; 204 201 clock-names = "hclk", "macref"; 205 202 max-speed = <100>; 206 203 phy-mode = "rmii"; 207 - 204 + rockchip,grf = <&grf>; 208 205 status = "disabled"; 209 206 }; 210 207
-10
drivers/net/ethernet/arc/Kconfig
··· 23 23 select PHYLIB 24 24 select CRC32 25 25 26 - config ARC_EMAC 27 - tristate "ARC EMAC support" 28 - select ARC_EMAC_CORE 29 - depends on OF_IRQ 30 - depends on ARC || COMPILE_TEST 31 - help 32 - On some legacy ARC (Synopsys) FPGA boards such as ARCAngel4/ML50x 33 - non-standard on-chip ethernet device ARC EMAC 10/100 is used. 34 - Say Y here if you have such a board. If unsure, say N. 35 - 36 26 config EMAC_ROCKCHIP 37 27 tristate "Rockchip EMAC support" 38 28 select ARC_EMAC_CORE
-1
drivers/net/ethernet/arc/Makefile
··· 5 5 6 6 arc_emac-objs := emac_main.o emac_mdio.o 7 7 obj-$(CONFIG_ARC_EMAC_CORE) += arc_emac.o 8 - obj-$(CONFIG_ARC_EMAC) += emac_arc.o 9 8 obj-$(CONFIG_EMAC_ROCKCHIP) += emac_rockchip.o
-88
drivers/net/ethernet/arc/emac_arc.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /** 3 - * DOC: emac_arc.c - ARC EMAC specific glue layer 4 - * 5 - * Copyright (C) 2014 Romain Perier 6 - * 7 - * Romain Perier <romain.perier@gmail.com> 8 - */ 9 - 10 - #include <linux/etherdevice.h> 11 - #include <linux/module.h> 12 - #include <linux/of_net.h> 13 - #include <linux/platform_device.h> 14 - 15 - #include "emac.h" 16 - 17 - #define DRV_NAME "emac_arc" 18 - 19 - static int emac_arc_probe(struct platform_device *pdev) 20 - { 21 - struct device *dev = &pdev->dev; 22 - struct arc_emac_priv *priv; 23 - phy_interface_t interface; 24 - struct net_device *ndev; 25 - int err; 26 - 27 - if (!dev->of_node) 28 - return -ENODEV; 29 - 30 - ndev = alloc_etherdev(sizeof(struct arc_emac_priv)); 31 - if (!ndev) 32 - return -ENOMEM; 33 - platform_set_drvdata(pdev, ndev); 34 - SET_NETDEV_DEV(ndev, dev); 35 - 36 - priv = netdev_priv(ndev); 37 - priv->drv_name = DRV_NAME; 38 - 39 - err = of_get_phy_mode(dev->of_node, &interface); 40 - if (err) { 41 - if (err == -ENODEV) 42 - interface = PHY_INTERFACE_MODE_MII; 43 - else 44 - goto out_netdev; 45 - } 46 - 47 - priv->clk = devm_clk_get(dev, "hclk"); 48 - if (IS_ERR(priv->clk)) { 49 - dev_err(dev, "failed to retrieve host clock from device tree\n"); 50 - err = -EINVAL; 51 - goto out_netdev; 52 - } 53 - 54 - err = arc_emac_probe(ndev, interface); 55 - out_netdev: 56 - if (err) 57 - free_netdev(ndev); 58 - return err; 59 - } 60 - 61 - static void emac_arc_remove(struct platform_device *pdev) 62 - { 63 - struct net_device *ndev = platform_get_drvdata(pdev); 64 - 65 - arc_emac_remove(ndev); 66 - free_netdev(ndev); 67 - } 68 - 69 - static const struct of_device_id emac_arc_dt_ids[] = { 70 - { .compatible = "snps,arc-emac" }, 71 - { /* Sentinel */ } 72 - }; 73 - MODULE_DEVICE_TABLE(of, emac_arc_dt_ids); 74 - 75 - static struct platform_driver emac_arc_driver = { 76 - .probe = emac_arc_probe, 77 - .remove_new = emac_arc_remove, 78 - .driver = { 79 - .name = DRV_NAME, 80 - .of_match_table = emac_arc_dt_ids, 81 - }, 82 - }; 83 - 84 - module_platform_driver(emac_arc_driver); 85 - 86 - MODULE_AUTHOR("Romain Perier <romain.perier@gmail.com>"); 87 - MODULE_DESCRIPTION("ARC EMAC platform driver"); 88 - MODULE_LICENSE("GPL");