mv643xx_eth: device tree bindings
Subsystems (7)
v2 cover mv643xx_eth: device tree bindings
Hi all,
This patch serie implements mv643xx_eth device tree bindings. I opted for the reuse of the bindings already defined in Documentation/devicetree/bindings/marvell.txt so that we do not create any confusion.
For reference, I have included the mv643xx-eth related nodes in the corresponding Kirkwood, Dove and Orion5x .dtsi files so you can more easily test on your own platforms.
I tested these on a custom 88F6181-based boards.
Florian Fainelli (5):
mv643xx_eth: add Device Tree bindings
mv643xx_eth: update Device Tree bindings documentation
ARM: kirkwood: add device node entries for the gigabit interfaces
ARM: orion5x: add gigabit ethernet device tree node
ARM: dove: add gigabit device tree nodes to dove.dtsi
Documentation/devicetree/bindings/marvell.txt | 25 +++++- arch/arm/boot/dts/dove.dtsi | 25 ++++++ arch/arm/boot/dts/kirkwood.dtsi | 46 ++++++++++ arch/arm/boot/dts/orion5x.dtsi | 23 +++++ drivers/net/ethernet/marvell/mv643xx_eth.c | 120 ++++++++++++++++++++++++- 5 files changed, 234 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.10.4
PATCH v2 1/5 mv643xx_eth: add Device Tree bindings
This patch adds Device Tree bindings following the already defined bindings at Documentation/devicetree/bindings/marvell.txt. The binding documentation is also enhanced with new optionnal properties required for supporting certain devices (RX/TX queue and SRAM). Since we now have proper support for the orion MDIO bus driver, there is no need to fiddle around with device tree phandles. PHY-less (MAC connected to switch) configurations are supported by not specifying any phy phandle for an ethernet node.
---
- properly ifdef of_platform_bus_probe with CONFIG_OF
- handle of_platform_bus_probe errors and cleanup accordingly
- use of_property_read_u32 where applicable
- parse "duplex" and "speed" property in PHY-less configuration
Documentation/devicetree/bindings/marvell.txt | 25 +++++- drivers/net/ethernet/marvell/mv643xx_eth.c | 120 ++++++++++++++++++++++++- 2 files changed, 140 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/marvell.txt +23 -2
@@ -112,9 +112,14 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd. Required properties: - #address-cells : <1> - #size-cells : <0> - - compatible : "marvell,mv64360-eth-block" + - compatible : "marvell,mv64360-eth-block", "marvell,mv64360-eth-group", + "marvell,mv643xx-eth-block" - reg : Offset and length of the register set for this block + Optional properties: + - tx-csum-limit : Hardware limit above which transmit checksumming + is disabled. + Example Discovery Ethernet block node: ethernet-block at 2000 { #address-cells = <1>;
@@ -130,7 +135,7 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd. Required properties: - device_type : Should be "network". - - compatible : Should be "marvell,mv64360-eth". + - compatible : Should be "marvell,mv64360-eth", "marvell,mv643xx-eth". - reg : Should be <0>, <1>, or <2>, according to which registers within the silicon block the device uses. - interrupts : <a> where a is the interrupt number for the port.
@@ -140,6 +145,22 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd. controller. - local-mac-address : 6 bytes, MAC address + Optional properties: + - clocks : Phandle to the clock control device and gate bit + - clock-names : String describing the clock gate bit + - speed : Speed to force the link (10, 100, 1000), used when no + phy property is defined + - duplex : Duplex to force the link (0: half, 1: full), used when no + phy property is defined + - rx-queue-count : number of RX queues to use + - tx-queue-count : number of TX queues to use + - rx-queue-size : size of the RX queue (in bytes) + - tx-queue-size : size of the TX queue (in bytes) + - rx-sram-addr : address of the SRAM for RX path (non 0 means used) + - rx-sram-size : size of the SRAM for RX path (non 0 means used) + - tx-sram-addr : address of the SRAM for TX path (non 0 means used) + - tx-sram-size : size of the SRAM for TX path (non 0 means used) + Example Discovery Ethernet port node: ethernet at 0 { device_type = "network";
drivers/net/ethernet/marvell/mv643xx_eth.c +117 -3
205 lines not on this page · raw message
Signature · 1 line
1.7.10.4
Re: [PATCH 1/5 v2] mv643xx_eth: add Device Tree bindings
Hi Florian
Quoted 101 lines · Florian Fainelli
This patch adds Device Tree bindings following the already defined bindings at
Documentation/devicetree/bindings/marvell.txt. The binding documentation is also enhanced with new optionnal properties required for supporting certain devices (RX/TX queue and SRAM). Since we now have proper support for the orion MDIO bus driver, there is no need to fiddle around with device tree phandles. PHY-less (MAC connected to switch) configurations are supported by not specifying any phy phandle for an ethernet node.Signed-off-by Florian Fainelli <[email protected]>---
- properly ifdefof_platform_bus_probewithCONFIG_OF
- handleof_platform_bus_probeerrors and cleanup accordingly
- useof_property_read_u32where applicable
- parse "duplex" and "speed" property in PHY-less configurationDocumentation/devicetree/bindings/marvell.txt | 25 +++++- drivers/net/ethernet/marvell/mv643xx_eth.c | 120 ++++++++++++++++++++++++- 2 files changed, 140 insertions(+), 5 deletions(-)Documentation/devicetree/bindings/marvell.txt +23
-2@@ -112,9 +112,14 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd. Required properties: - #address-cells : <1> - #size-cells : <0> - - compatible : "marvell,mv64360-eth-block" + - compatible : "marvell,mv64360-eth-block", "marvell,mv64360-eth-group", + "marvell,mv643xx-eth-block" - reg : Offset and length of the register set for this block + Optional properties: + - tx-csum-limit : Hardware limit above which transmit checksumming + is disabled. + Example Discovery Ethernet block node: ethernet-block at 2000 { #address-cells = <1>;@@ -130,7 +135,7 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd. Required properties: - device_type : Should be "network". - - compatible : Should be "marvell,mv64360-eth". + - compatible : Should be "marvell,mv64360-eth", "marvell,mv643xx-eth". - reg : Should be <0>, <1>, or <2>, according to which registers within the silicon block the device uses. - interrupts : <a> where a is the interrupt number for the port.@@ -140,6 +145,22 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd. controller. - local-mac-address : 6 bytes, MAC address + Optional properties: + - clocks : Phandle to the clock control device and gate bit + - clock-names : String describing the clock gate bit + - speed : Speed to force the link (10, 100, 1000), used when no + phy property is defined + - duplex : Duplex to force the link (0: half, 1: full), used when no + phy property is defined + - rx-queue-count : number of RX queues to use + - tx-queue-count : number of TX queues to use + - rx-queue-size : size of the RX queue (in bytes) + - tx-queue-size : size of the TX queue (in bytes) + - rx-sram-addr : address of the SRAM for RX path (non 0 means used) + - rx-sram-size : size of the SRAM for RX path (non 0 means used) + - tx-sram-addr : address of the SRAM for TX path (non 0 means used) + - tx-sram-size : size of the SRAM for TX path (non 0 means used) + Example Discovery Ethernet port node: ethernet at 0 { device_type = "network";drivers/net/ethernet/marvell/mv643xx_eth.c +11
-0@@ -60,6 +60,10 @@#include <linux/inet_lro.h> #include <linux/slab.h> #include <linux/clk.h> +#include <linux/stringify.h> +#include <linux/of.h> +#include <linux/of_platform.h> +#include <linux/of_net.h> static char mv643xx_eth_driver_name[] ="mv643xx_eth" ;static char mv643xx_eth_driver_version[] ="1.4" ;@@ -2542,14 +2546,23 @@ static void infer_hw_params(struct mv643xx_eth_shared_private *msp) } } +static const struct of_device_id mv643xx_eth_match[] = { + { .compatible ="marvell,mv64360-eth" }, + { .compatible ="marvell,mv643xx-eth" }, + {/* sentinel */ }, +}; +MODULE_DEVICE_TABLE (of, mv643xx_eth_match); +static int mv643xx_eth_shared_probe (struct platform_device *pdev) {static int mv643xx_eth_version_printed;
drivers/net/ethernet/marvell/mv643xx_eth.c static void infer_hw_params(struct mv643xx_eth_shared_private *msp) · line 2568
Quoted 10 lines
drivers/net/ethernet/marvell/mv643xx_eth.c +2
-0+struct device_node *np = pdev->dev.of_node;struct mv643xx_eth_shared_platform_data *pd = pdev->dev.platform_data;struct mv643xx_eth_shared_private *msp;const struct mbus_dram_target_info *dram;struct resource *res;int ret; +int tx_csum_limit =0 ;if (!mv643xx_eth_version_printed++) pr_notice("MV-643xx 10/100/1000 ethernet driver version %s\n",
This is not related to your change, but there is a problem in this function that has already been discussed in the past if I remember
correctly: The respective clock needs to be enabled here (at least on Kirkwood), since accesses to the hardware are done below. Enabling the clock only in mv643xx_eth_probe() is too late.
As said, this is not a problem introduced by your changes (and which is currently circumvented by enabling the respective clocks in kirkwood_legacy_clk_init() and kirkwood_ge0x_init()), but we might want to fix this now to get rid of unconditionally enabling the GE clocks in the DT case.
Quoted 128 lines
drivers/net/ethernet/marvell/mv643xx_eth.c +91
-3@@ -2576,13 +2589,23 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)if (dram)mv643xx_eth_conf_mbus_windows (msp, dram); - msp->tx_csum_limit = (pd !=NULL && pd->tx_csum_limit) ? - pd->tx_csum_limit :9 *1024 ; +if (np) +of_property_read_u32 (np,"tx-csum-limit" , &tx_csum_limit); +else + tx_csum_limit = pd->tx_csum_limit; + + msp->tx_csum_limit = tx_csum_limit ? tx_csum_limit :9 *1024 ;infer_hw_params (msp);platform_set_drvdata (pdev, msp); + ret =0 ; -return 0 ; +#ifdef CONFIG_OF + ret =of_platform_bus_probe (np, mv643xx_eth_match, &pdev->dev); +if (ret) + goto out_free; +#endif +return ret; out_free:kfree (msp);@@ -2600,12 +2623,22 @@ static int mv643xx_eth_shared_remove(struct platform_device *pdev)return 0 ; } +static const struct of_device_id mv643xx_eth_shared_match[] = { + { .compatible ="marvell,mv64360-eth-group" }, + { .compatible ="marvell,mv64360-eth-block" }, + { .compatible ="marvell,mv643xx-eth-group" }, + { .compatible ="marvell,mv643xx-eth-block" }, + {/* sentinel */ }, +}; +MODULE_DEVICE_TABLE (of, mv643xx_eth_shared_match); +static struct platform_driver mv643xx_eth_shared_driver = { .probe = mv643xx_eth_shared_probe, .remove = mv643xx_eth_shared_remove, .driver = { .name =MV643XX_ETH_SHARED_NAME , .owner =THIS_MODULE , + .of_match_table =of_match_ptr (mv643xx_eth_shared_match), }, };@@ -2764,6 +2797,74 @@ static const struct net_device_ops mv643xx_eth_netdev_ops = {#endif }; +#ifdef CONFIG_OF +static int mv643xx_eth_of_probe (struct platform_device *pdev) +{ +struct mv643xx_eth_platform_data *pd; +struct device_node *np = pdev->dev.of_node; +struct device_node *shared =of_get_parent (np); +struct device_node *phy_node; +const int *prop; +const char *mac_addr; + +if (!pdev->dev.of_node) +return 0 ; + + pd =kzalloc (sizeof (*pd),GFP_KERNEL ); +if (!pd) +return -ENOMEM ; + + pdev->dev.platform_data = pd; + + pd->shared =of_find_device_by_node (shared); +if (!pd->shared) +return -ENODEV ; + + prop =of_get_property (np,"reg" ,NULL ); +if (!prop) +return -EINVAL ; + + pd->port_number =be32_to_cpup (prop); + + phy_node =of_parse_phandle (np,"phy" ,0 ); +if (!phy_node) { + pd->phy_addr =MV643XX_ETH_PHY_NONE ; + +of_property_read_u32 (np,"speed" , &pd->speed); +of_property_read_u32 (np,"duplex" , &pd->duplex); + }else { + prop =of_get_property (phy_node,"reg" ,NULL ); +if (prop) + pd->phy_addr =be32_to_cpup (prop); + } + + mac_addr =of_get_mac_address (np); +if (mac_addr) +memcpy (pd->mac_addr, mac_addr,ETH_ALEN ); + +#define rx_tx_queue_sram_property (_name) \ + prop = of_get_property(np, __stringify(_name), NULL); \ + if (prop) \ + pd->_name = be32_to_cpup(prop); + +rx_tx_queue_sram_property (rx_queue_count); +rx_tx_queue_sram_property (tx_queue_count); +rx_tx_queue_sram_property (rx_queue_size); +rx_tx_queue_sram_property (tx_queue_size); +rx_tx_queue_sram_property (rx_sram_addr); +rx_tx_queue_sram_property (rx_sram_size); +rx_tx_queue_sram_property (tx_sram_addr); +rx_tx_queue_sram_property (rx_sram_size); + +return 0 ; +} +#else +static inline int mv643xx_eth_of_probe (struct platform_device *dev) +{ +return 0 ; +} +#endif +static int mv643xx_eth_probe (struct platform_device *pdev) {struct mv643xx_eth_platform_data *pd;@@ -2772,7 +2873,12 @@ static int mv643xx_eth_probe(struct platform_device *pdev)struct resource *res;int err;
drivers/net/ethernet/marvell/mv643xx_eth.c static int mv643xx_eth_probe(struct platform_device *pdev) · line 2884
Quoted 10 lines
drivers/net/ethernet/marvell/mv643xx_eth.c +5
-0+ err =mv643xx_eth_of_probe (pdev); +if (err) +return err; + pd = pdev->dev.platform_data; +if (pd ==NULL ) {dev_err (&pdev->dev,"no mv643xx_eth_platform_data\n" );return -ENODEV ;
You don't change the clk initialization here:
#if defined(CONFIG_HAVE_CLK)
mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0"));
if (!IS_ERR(mp->clk)) {
clk_prepare_enable(mp->clk);
mp->t_clk = clk_get_rate(mp->clk);
}#endif
Which, if I understand correctly, works in the DT case because you assign "clock-names" to the clocks in the DTS. However, I wonder whether this works for any but the first Ethernet device.
In the old platform device setup, the pdev->id was set when initialiazing the platform_device structure in common.c. Where is this done in the DT case?
In phy_scan(), the phy is searched like this:
snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, "orion-mdio-mii", addr); phydev = phy_connect(mp->dev, phy_id, mv643xx_eth_adjust_link, PHY_INTERFACE_MODE_GMII);
But "orion-mdio-mii:xx" is the name of the PHY if MDIO is setup via a platform_device. I could not get this to work if the MDIO device is setup via DT. Am I doing something wrong?
Additionally, in phy_scan() there is this:
if (phy_addr == MV643XX_ETH_PHY_ADDR_DEFAULT) {
start = phy_addr_get(mp) & 0x1f;
num = 32;
} else {
...MV643XX_ETH_PHY_ADDR_DEFAULT is defined as 0. However, many Kirkwood devices use "MV643XX_ETH_PHY_ADDR(0)". If the module probe is deferred in mv643xx_eth because the MDIO driver is not yet loaded, all 32 PHY addresses are scanned without success. This is not needed and clutters the log.
- Simon
Re: [PATCH 1/5 v2] mv643xx_eth: add Device Tree bindings
Hello Simon,
First of all, thanks for getting these patches a try!
Le 04/04/13 23:29, Simon Baatz a ?crit :
Quoted 2 lines
Hi Florian
[snip]
Quoted 9 lines
Quoted 2 lines
if (!mv643xx_eth_version_printed++)
pr_notice("MV-643xx 10/100/1000 ethernet driver version %s\n",This is not related to your change, but there is a problem in this function that has already been discussed in the past if I remember
correctly: The respective clock needs to be enabled here (at least on Kirkwood), since accesses to the hardware are done below. Enabling the clock only inmv643xx_eth_probe()is too late.
Quoted 5 lines
As said, this is not a problem introduced by your changes (and which is currently circumvented by enabling the respective clocks in
kirkwood_legacy_clk_init()andkirkwood_ge0x_init()), but we might want to fix this now to get rid of unconditionally enabling the GE clocks in the DT case.
I think there may have been some confusion between the "ethernet-group" clock and the actual Ethernet port inside the "ethernet-group". The mv643xx_eth driver assumes we have a per-port clock gating scheme, while I think we have a per "ethernet-group" clock gating scheme instead. Like you said, I think this should be addressed separately.
[snip]
Quoted 11 lines
You don't change the clk initialization here:
#if defined(CONFIG_HAVE_CLK) mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0")); if (!IS_ERR(mp->clk)) { clk_prepare_enable(mp->clk); mp->t_clk = clk_get_rate(mp->clk); }#endif
Quoted 7 lines
Which, if I understand correctly, works in the DT case because you assign "clock-names" to the clocks in the DTS. However, I wonder whether this works for any but the first Ethernet device.
In the old platform device setup, the
pdev->idwas set when initialiazing theplatform_devicestructure incommon.c. Where is this done in the DT case?
Looks like you are right, in the DT case, I assume that we should lookup the clock using NULL instead of "1" or "0" so we match any clock instead of a specific one.
[snip]
Quoted 10 lines
In
phy_scan(), the phy is searched like this:snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, "orion-mdio-mii", addr); phydev = phy_connect(mp->dev, phy_id, mv643xx_eth_adjust_link, PHY_INTERFACE_MODE_GMII);
Quoted 3 lines
But "orion-mdio-mii:xx" is the name of the PHY if MDIO is setup via a
platform_device. I could not get this to work if the MDIO device is setup via DT. Am I doing something wrong?
I just missed updating this part of the code to probe for PHYs. The board I tested with uses a "PHY_NONE" configuration. I will add the missing bits for of_phy_connect() to be called here.
Quoted 10 lines
Additionally, in
phy_scan()there is this:if (phy_addr == MV643XX_ETH_PHY_ADDR_DEFAULT) { start = phy_addr_get(mp) & 0x1f; num = 32; } else { ...
Quoted 5 lines
MV643XX_ETH_PHY_ADDR_DEFAULTis defined as 0. However, many Kirkwood devices use "MV643XX_ETH_PHY_ADDR(0)". If the module probe is deferred inmv643xx_ethbecause the MDIO driver is not yet loaded, all 32 PHY addresses are scanned without success. This is not needed and clutters the log.
Ok, I am not sure how we can circumvent the log cluttering that happens, what would be your suggestion?
--
Florian
Sebastian Hesselbarth
maintainerRe: [PATCH 1/5 v2] mv643xx_eth: add Device Tree bindings
Quoted 1 line · Florian Fainelli
[snip]
Florian,
took me a while to try you patches out on Dove but now I fixed all issues. I will
comment on all related patches but first I want to comment here.
One general note for Dove related patches: You didn't remove the registration of ge platform_device from mach-dove/board-dt.c. That will lead to double registration
of mdio and mv643xx_eth/shared, so you'll never be sure if DT or non-DT code is executed. I haven't checked mach-kirkwood/board-dt.c or orion5x code.
Quoted 18 lines
Quoted 11 lines
Quoted 3 lines
if (!mv643xx_eth_version_printed++) pr_notice("MV-643xx 10/100/1000 ethernet driver version%s\n",
This is not related to your change, but there is a problem in this function that has already been discussed in the past if I remember
correctly: The respective clock needs to be enabled here (at least on Kirkwood), since accesses to the hardware are done below. Enabling the clock only inmv643xx_eth_probe()is too late.Quoted 5 lines
As said, this is not a problem introduced by your changes (and which is currently circumvented by enabling the respective clocks in
kirkwood_legacy_clk_init()andkirkwood_ge0x_init()), but we might want to fix this now to get rid of unconditionally enabling the GE clocks in the DT case.
Quoted 5 lines
I think there may have been some confusion between the "ethernet-group" clock and the actual Ethernet port inside the "ethernet-group". The
mv643xx_ethdriver assumes we have a per-port clock gating scheme, while I think we have a per "ethernet-group" clock gating scheme instead. Like you said, I think this should be addressed separately.
IMHO, there should be a clocks property where ever you try to access registers, i.e. in all three "parts" mv643xx_eth_shared (group), mv643xx_eth (port) and mdio.
Since port depends on shared it would be ok to have it per group but that may collide with other SoCs than Dove/Kirkwood that have per port clocks.
Is that separation (group/port) really required for any SoC?
Quoted 13 lines
[snip]
Quoted 11 lines
You don't change the clk initialization here:
#if defined(CONFIG_HAVE_CLK) mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0")); if (!IS_ERR(mp->clk)) { clk_prepare_enable(mp->clk); mp->t_clk = clk_get_rate(mp->clk); }#endif
Quoted 3 lines
Quoted 3 lines
Which, if I understand correctly, works in the DT case because you assign "clock-names" to the clocks in the DTS. However, I wonder whether this works for any but the first Ethernet device.
Yes, it does. Assigned clocks from clocks property get a clock alias for that device name (node name). Using anything else than NULL here is IMHO just wrong. We should rather provide proper clock aliases for non-DT case.
Quoted 7 lines
Quoted 3 lines
In the old platform device setup, the
pdev->idwas set when initialiazing theplatform_devicestructure incommon.c. Where is this done in the DT case?Looks like you are right, in the DT case, I assume that we should lookup the clock using NULL instead of "1" or "0" so we match any clock instead of a specific one.
Yes.
Quoted 12 lines
[snip]
Quoted 11 lines
In
phy_scan(), the phy is searched like this:snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, "orion-mdio-mii", addr); phydev = phy_connect(mp->dev, phy_id, mv643xx_eth_adjust_link, PHY_INTERFACE_MODE_GMII);
Quoted 7 lines
Quoted 3 lines
But "orion-mdio-mii:xx" is the name of the PHY if MDIO is setup via a
platform_device. I could not get this to work if the MDIO device is setup via DT. Am I doing something wrong?I just missed updating this part of the code to probe for PHYs. The board I tested with uses a "
PHY_NONE" configuration. I will add the missing bits forof_phy_connect()to be called here.
I don't think that the ethernet controller should probe the PHY's on mdio-bus at all. At least not for DT enabled platforms. I had a look at DT and non-DT mdio-bus sources, and realized that there is a bus scan for non-DT only. of_mdiobus_register requires you to set (and know) the PHY address.
I prepared a patch for of_mdio_register that will allow you to probe mdio and assign phy addresses to each node found. Currently, the heuristic for probing
is: assign each phy node the next probed phy_addr starting with 0. But that will not allow to e.g. set some PHY addresses and probe the rest.
We had a similar discussion whether to probe or not for DT nodes, and I guess there also will be some discussion about the above patch. OTOH we could just (again) ask users of every kirkwood/orion5x/dove board to tell their phy addresses
and fail to probe the phy for new boards...
I will prepare a proper patch soon and post it on the corresponding lists.
Quoted 15 lines
Quoted 8 lines
Additionally, in
phy_scan()there is this:if (phy_addr == MV643XX_ETH_PHY_ADDR_DEFAULT) { start = phy_addr_get(mp) & 0x1f; num = 32; } else { ...Quoted 5 lines
MV643XX_ETH_PHY_ADDR_DEFAULTis defined as 0. However, many Kirkwood devices use "MV643XX_ETH_PHY_ADDR(0)". If the module probe is deferred inmv643xx_ethbecause the MDIO driver is not yet loaded, all 32 PHY addresses are scanned without success. This is not needed and clutters the log.
Quoted 2 lines
Ok, I am not sure how we can circumvent the log cluttering that happens, what would be your suggestion?
My suggestion is to change MV643XX_ETH_PHY_ADDR_DEFAULT from a valid phy address (0)
to something invalid (32). I understand that using 0 helps if you don't want to set it in mv643xx's platform_data
but it is always difficult to rely on that if 0 is a valid number.
Changing the above to 32 should just work because most (all?) boards using phy_scan should also
already use MV643XX_ETH_PHY_ADDR_DEFAULT. I also suggest to rename current define to a
better name, e.g. MV643XX_ETH_PHY_ADDR_AUTOSCAN.
Sebastian
Re: [PATCH 1/5 v2] mv643xx_eth: add Device Tree bindings
Hello Sebastian,
Le 04/05/13 15:58, Sebastian Hesselbarth a ?crit :
Quoted 9 lines · Florian Fainelli
Quoted 1 line
[snip]
Florian,
took me a while to try you patches out on Dove but now I fixed all issues. I will
comment on all related patches but first I want to comment here.
Quoted 5 lines
One general note for Dove related patches: You didn't remove the registration of ge
platform_devicefrommach-dove/board-dt.c. That will lead to double registration
of mdio and mv643xx_eth/shared, so you'll never be sure if DT or non-DT code is executed. I haven't checkedmach-kirkwood/board-dt.cor orion5x code.
This was intentional, this patchset is just preparatory in the sense that it does no conversion of the existing users of the mv643xx_eth platform driver over DT (have some patches to that though). I wanted to resume the discussion on these bindings first, then proceed with the conversion.
Quoted 25 lines
Quoted 19 lines
Quoted 12 lines
Quoted 4 lines
if (!mv643xx_eth_version_printed++) pr_notice("MV-643xx 10/100/1000 ethernet driver version%s\n",
This is not related to your change, but there is a problem in this function that has already been discussed in the past if I remember
correctly: The respective clock needs to be enabled here (at least on Kirkwood), since accesses to the hardware are done below. Enabling the clock only inmv643xx_eth_probe()is too late.Quoted 5 lines
As said, this is not a problem introduced by your changes (and which is currently circumvented by enabling the respective clocks in
kirkwood_legacy_clk_init()andkirkwood_ge0x_init()), but we might want to fix this now to get rid of unconditionally enabling the GE clocks in the DT case.Quoted 5 lines
I think there may have been some confusion between the "ethernet-group" clock and the actual Ethernet port inside the "ethernet-group". The
mv643xx_ethdriver assumes we have a per-port clock gating scheme, while I think we have a per "ethernet-group" clock gating scheme instead. Like you said, I think this should be addressed separately.
Quoted 5 lines
IMHO, there should be a clocks property where ever you try to access registers, i.e. in all three "parts"
mv643xx_eth_shared(group),mv643xx_eth(port) and mdio.
Since port depends on shared it would be ok to have it per group but that may collide with other SoCs than Dove/Kirkwood that have per port clocks.
Ok, which means that we should also teach mv643xx_eth_shared_probe() about it, as well as the orion-mdio driver. I don't have any particular objections since it should just make things safer with respect to clocking.
Quoted 2 lines
Is that separation (group/port) really required for any SoC?
Probably not, it was not clear when I looked at mv78xx0 if it uses two ports per group or 4 groups and 1 port. Anyway, since we are re-using the existing Device Tree binding definition and that the hardware present itself as ethernet groups and ports, I don't see any problem with keeping that difference since it allows for fine-grained representation of the hardware.
Quoted 48 lines
Quoted 14 lines
[snip]
Quoted 11 lines
You don't change the clk initialization here:
#if defined(CONFIG_HAVE_CLK) mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0")); if (!IS_ERR(mp->clk)) { clk_prepare_enable(mp->clk); mp->t_clk = clk_get_rate(mp->clk); }#endif
Quoted 3 lines
Quoted 3 lines
Which, if I understand correctly, works in the DT case because you assign "clock-names" to the clocks in the DTS. However, I wonder whether this works for any but the first Ethernet device.
Yes, it does. Assigned clocks from clocks property get a clock alias for that device name (node name). Using anything else than NULL here is IMHO just wrong. We should rather provide proper clock aliases for non-DT case.
Quoted 7 lines
Quoted 3 lines
In the old platform device setup, the
pdev->idwas set when initialiazing theplatform_devicestructure incommon.c. Where is this done in the DT case?Looks like you are right, in the DT case, I assume that we should lookup the clock using NULL instead of "1" or "0" so we match any clock instead of a specific one.
Yes.
Quoted 16 lines
[snip]
Quoted 14 lines
In
phy_scan(), the phy is searched like this:snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, "orion-mdio-mii", addr); phydev = phy_connect(mp->dev, phy_id, mv643xx_eth_adjust_link, PHY_INTERFACE_MODE_GMII);But "orion-mdio-mii:xx" is the name of the PHY if MDIO is setup via a
platform_device. I could not get this to work if the MDIO device is setup via DT. Am I doing something wrong?
Quoted 8 lines
Quoted 3 lines
I just missed updating this part of the code to probe for PHYs. The board I tested with uses a "
PHY_NONE" configuration. I will add the missing bits forof_phy_connect()to be called here.I don't think that the ethernet controller should probe the PHY's on mdio-bus at all. At least not for DT enabled platforms. I had a look at DT and non-DT mdio-bus sources, and realized that there is a bus scan for non-DT only.
of_mdiobus_registerrequires you to set (and know) the PHY address.
One reason the Ethernet controller could do the probing is in the case we need to apply quirks (e.g: using phydev->flags) for instance. This can be done even after the MDIO bus driver did probe PHY devices though.
Quoted 5 lines
I prepared a patch for
of_mdio_registerthat will allow you to probe mdio and assign phy addresses to each node found. Currently, the heuristic for probing
is: assign each phy node the next probedphy_addrstarting with 0. But that will not allow to e.g. set some PHY addresses and probe the rest.
Ok, we just need to make sure that this does not break any specific use case, I don't think it does, since it seems to be more accurate or equivalent to Ethernet driver doing the probing.
Quoted 8 lines
We had a similar discussion whether to probe or not for DT nodes, and I guess there also will be some discussion about the above patch. OTOH we could just (again) ask users of every kirkwood/orion5x/dove board to tell their phy addresses
and fail to probe the phy for new boards...I will prepare a proper patch soon and post it on the corresponding lists.
Cool, thanks!
Quoted 25 lines
Quoted 16 lines
Quoted 9 lines
Additionally, in
phy_scan()there is this:if (phy_addr == MV643XX_ETH_PHY_ADDR_DEFAULT) { start = phy_addr_get(mp) & 0x1f; num = 32; } else { ...Quoted 5 lines
MV643XX_ETH_PHY_ADDR_DEFAULTis defined as 0. However, many Kirkwood devices use "MV643XX_ETH_PHY_ADDR(0)". If the module probe is deferred inmv643xx_ethbecause the MDIO driver is not yet loaded, all 32 PHY addresses are scanned without success. This is not needed and clutters the log.Quoted 2 lines
Ok, I am not sure how we can circumvent the log cluttering that happens, what would be your suggestion?
My suggestion is to change
MV643XX_ETH_PHY_ADDR_DEFAULTfrom a valid phy address (0)
to something invalid (32). I understand that using 0 helps if you don't want to set it in mv643xx'splatform_data
but it is always difficult to rely on that if 0 is a valid number.
Quoted 5 lines
Changing the above to 32 should just work because most (all?) boards using
phy_scanshould also
already useMV643XX_ETH_PHY_ADDR_DEFAULT. I also suggest to rename current define to a
better name, e.g.MV643XX_ETH_PHY_ADDR_AUTOSCAN.
Sounds good to me.
--
Florian
Re: [PATCH 1/5 v2] mv643xx_eth: add Device Tree bindings
In reply to Sebastian HesselbarthQuoted 4 lines · Sebastian Hesselbarth
I don't think that the ethernet controller should probe the PHY's on mdio-bus at all. At least not for DT enabled platforms. I had a look at DT and non-DT mdio-bus sources, and realized that there is a bus scan for non-DT only.
of_mdiobus_registerrequires you to set (and know) the PHY address.
DT platforms should have the option to use the standard phy-phandle connection:
mdio at 72004 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "marvell,orion-mdio";
reg = <0x72004 0x84>;
status = "disabled";+ PHY1: ethernet-phy at 1 {
+ reg = <1>;
+ device_type = "ethernet-phy";
+ };
};
ethernet-group at 72000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "marvell,mv643xx-eth-block";
reg = <0x72000 0x4000>;
tx-csum-limit = <1600>;
status = "disabled";
egiga0: ethernet at 0 {
device_type = "network";
compatible = "marvell,mv643xx-eth";
reg = <0>;
interrupts = <29>;
clocks = <&gate_clk 2>;
+ phy-handle = <&PHY1>;
};
};When phy-handle is present the ethernet driver should not probe/scan for phys.
There is standard code to handle all of this - an important gain is that the phy driver now has access to a DT node and can apply phy-specific properties.
Quoted 5 lines
We had a similar discussion whether to probe or not for DT nodes, and I guess there also will be some discussion about the above patch. OTOH we could just (again) ask users of every kirkwood/orion5x/dove board to tell their phy addresses and fail to probe the phy for new boards...
Maybe print a warning and call the no-DT phy probe code if phy-handle is nor present?
Not sure this should be in the common code, phy probing is sketchy, it shouldn't be encouraged, IMHO..
Jason
Sebastian Hesselbarth
maintainerRe: [PATCH 1/5 v2] mv643xx_eth: add Device Tree bindings
Quoted 41 lines · Jason Gunthorpe
Quoted 4 lines · Sebastian Hesselbarth
I don't think that the ethernet controller should probe the PHY's on mdio-bus at all. At least not for DT enabled platforms. I had a look at DT and non-DT mdio-bus sources, and realized that there is a bus scan for non-DT only.
of_mdiobus_registerrequires you to set (and know) the PHY address.DT platforms should have the option to use the standard phy-phandle connection:
mdio at 72004 { #address-cells =<1>; #size-cells =<0>; compatible = "marvell,orion-mdio"; reg =<0x72004 0x84>; status = "disabled";(quoted diff) +4
-0+ PHY1: ethernet-phy at 1 { + reg =<1>; + device_type = "ethernet-phy"; + };}; ethernet-group at 72000 { #address-cells =<1>; #size-cells =<0>; compatible = "marvell,mv643xx-eth-block"; reg =<0x72000 0x4000>; tx-csum-limit =<1600>; status = "disabled"; egiga0: ethernet at 0 { device_type = "network"; compatible = "marvell,mv643xx-eth"; reg =<0>; interrupts =<29>; clocks =<&gate_clk 2>;(quoted diff) +1
-0+ phy-handle =<&PHY1>;}; };
Quoted 6 lines
When phy-handle is present the ethernet driver should not probe/scan for phys.
There is standard code to handle all of this - an important gain is that the phy driver now has access to a DT node and can apply phy-specific properties.
The above is what I use as a modification of Florian's patches. I compared of_mdiobus_register against mdiobus_register. The difference is that DT version does not scan the bus for attached PHYs. That is ok, if you know the phy_address of the PHY that you pass the handle of. But in most cases there will be only one PHY on the mdiobus and especially for new boards probing will help here.
Quoted 8 lines
Quoted 5 lines
We had a similar discussion whether to probe or not for DT nodes, and I guess there also will be some discussion about the above patch. OTOH we could just (again) ask users of every kirkwood/orion5x/dove board to tell their phy addresses and fail to probe the phy for new boards...
Maybe print a warning and call the no-DT phy probe code if phy-handle is nor present?
I think it would be best to spam each probing result during mdiobus scan to encourage people to edit the DT and put in the phy_addr directly. IMHO it will be best to have bus scan on mdiobus rather than ethernet driver.
Quoted 2 lines
Not sure this should be in the common code, phy probing is sketchy, it shouldn't be encouraged, IMHO..
Actually, it is in common code (non-DT case) and I think passing the phy_addr by DT node like above is best. But for boards you don't know the address (yet) probing helps a lot. If all phy nodes have their reg property set, no probing will be performed.
For testing mdio bus probe, I used
mdio {
...
ethphy: ethernet-phy {
reg = <32>;
};
};And 32 should be defined as OF_PHY_ADDR_AUTOSCAN. It is an invalid address as max phy_addr is 31. I also thought about a bool property but passing an invalid reg property in SoC file allows to overwrite it in board file with the actual address easily.
And AFAIK bool properties cannot be removed later on by board specific nodes.
Sebastian
PATCH v2 2/5 mv643xx_eth: update Device Tree bindings documentation
In reply to Florian FainelliThis patch updates the Device Tree bindings documentation for the Marvell MV643xx ethernet controller node and makes the "local-mac-address" and "phy" properties optional instead of required. The absence of a "phy" node is legal and describes a MAC to switch configuration, while not specifying the "local-mac-address" allows for reuse of the MAC address already programmed into the Ethernet controller.
--- Documentation/devicetree/bindings/marvell.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/marvell.txt +2 -2
@@ -141,11 +141,11 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd. - interrupts : <a> where a is the interrupt number for the port. - interrupt-parent : the phandle for the interrupt controller that services interrupts for this device. + + Optional properties: - phy : the phandle for the PHY connected to this ethernet controller. - local-mac-address : 6 bytes, MAC address - - Optional properties: - clocks : Phandle to the clock control device and gate bit - clock-names : String describing the clock gate bit - speed : Speed to force the link (10, 100, 1000), used when no
Signature · 1 line
1.7.10.4
PATCH v2 3/5 ARM: kirkwood: add device node entries for the gigabit interfaces
In reply to Florian FainelliThis patch modifies kirkwood.dtsi to specify the various gigabit interfaces nodes available on kirkwood devices. They are disabled by default and should be enabled on a per-board basis. egiga0 and egiga1 aliases are defined for convenience. The mdio node is also present and should be enabled on a per-board basis as well.
---
Changes since v1:
- dropped change to arch/arm/mach-kirkwood/common.c to avoid merge conflicts
- fixed off-by 0x2000 ethernet-group nodes address
arch/arm/boot/dts/kirkwood.dtsi | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+)
arch/arm/boot/dts/kirkwood.dtsi +46 -0
@@ -7,6 +7,8 @@ aliases { gpio0 = &gpio0; gpio1 = &gpio1; + egiga0 = &egiga0; + egiga1 = &egiga1; }; intc: interrupt-controller { compatible = "marvell,orion-intc", "marvell,intc";
@@ -202,5 +204,49 @@ clocks = <&gate_clk 4>; status = "disabled"; }; + + mdio at 72004 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "marvell,orion-mdio"; + reg = <0x72004 0x84>; + status = "disabled"; + }; + + ethernet-group at 72000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "marvell,mv643xx-eth-block"; + reg = <0x72000 0x4000>; + tx-csum-limit = <1600>; + status = "disabled"; + + egiga0: egiga0 at 0 { + device_type = "network"; + compatible = "marvell,mv643xx-eth"; + reg = <0>; + interrupts = <11>; + clocks = <&gate_clk 0>; + clock-names = "0"; + }; + }; + + ethernet-group at 76000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "marvell,mv643xx-eth-block"; + reg = <0x76000 0x4000>; + tx-csum-limit = <1600>; + status = "disabled"; + + egiga1: egiga1 at 0 { + device_type = "network"; + compatible = "marvell,mv643xx-eth"; + reg = <0>; + interrupts = <15>; + clocks = <&gate_clk 19>; + clock-names = "1"; + }; + }; }; };
Signature · 1 line
1.7.10.4
Re: [PATCH 3/5 v2] ARM: kirkwood: add device node entries for the gigabit interfaces
Hi Florian,
Quoted 10 lines · Florian Fainelli
This patch modifies
kirkwood.dtsito specify the various gigabit interfaces nodes available on kirkwood devices. They are disabled by default and should be enabled on a per-board basis. egiga0 and egiga1 aliases are defined for convenience. The mdio node is also present and should be enabled on a per-board basis as well.Signed-off-by Florian Fainelli <[email protected]>---
Changes since v1:
- dropped change toarch/arm/mach-kirkwood/common.cto avoid merge conflicts
I think we should remove the clock aliases in kirkwood_legacy_clk_init() in mach-kirkwood/dt-board.c (once we have proper clock support, see my other mail).
Quoted 19 lines
- fixed off-by
0x2000ethernet-group nodes addressarch/arm/boot/dts/kirkwood.dtsi | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+)arch/arm/boot/dts/kirkwood.dtsi +2
-0@@ -7,6 +7,8 @@ aliases { gpio0 = &gpio0; gpio1 = &gpio1; + egiga0 = &egiga0; + egiga1 = &egiga1; }; intc: interrupt-controller { compatible = "marvell,orion-intc", "marvell,intc";
arch/arm/boot/dts/kirkwood.dtsi line 212
Quoted 9 lines
arch/arm/boot/dts/kirkwood.dtsi +6
-0@@ -202,5 +204,49 @@ clocks = <&gate_clk 4>; status = "disabled"; }; + + mdio at 72004 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "marvell,orion-mdio"; + reg = <0x72004 0x84>;
Don't we need to add:
interrupts = <46>;
here?
- Simon
Re: [PATCH 3/5 v2] ARM: kirkwood: add device node entries for the gigabit interfaces
Le 04/04/13 23:35, Simon Baatz a ?crit :
Quoted 18 lines
Hi Florian,
Quoted 10 lines · Florian Fainelli
This patch modifies
kirkwood.dtsito specify the various gigabit interfaces nodes available on kirkwood devices. They are disabled by default and should be enabled on a per-board basis. egiga0 and egiga1 aliases are defined for convenience. The mdio node is also present and should be enabled on a per-board basis as well.Signed-off-by Florian Fainelli <[email protected]>---
Changes since v1:
- dropped change toarch/arm/mach-kirkwood/common.cto avoid merge conflictsI think we should remove the clock aliases in
kirkwood_legacy_clk_init()inmach-kirkwood/dt-board.c(once we have proper clock support, see my other mail).
[snip]
Quoted 6 lines
Don't we need to add:
interrupts = <46>;here?
Right this is missing, in fact it still works ok because the orion-mdio driver can do busy waiting instead of interrupt signaling. Will fix that in the next round, thanks!
--
Florian
PATCH v2 4/5 ARM: orion5x: add gigabit ethernet device tree node
In reply to Florian FainelliThis patch adds the gigabit ethernet device tree node to orion5x.dtsi. This node is disabled by default and must be enabled on a per-board basis. For completeness and easier testing the MDIO node is also added and disabled by default.
---
Changes since v1:
- fixed off-by 0x2000 address of the ethernet-group node
arch/arm/boot/dts/orion5x.dtsi | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
arch/arm/boot/dts/orion5x.dtsi +23 -0
@@ -99,5 +99,28 @@ interrupts = <28>; status = "okay"; }; + + mdio at 72004 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "marvell,orion-mdio"; + reg = <0x72004 0x84>; + status = "disabled"; + }; + + ethernet-group at 72000 { + #address-cells = <1>. + #size-cells = <0>; + compatible = "marvell,mv643xx-eth-block"; + reg = <0x72000 0x4000>; + status = "disabled"; + + egiga0: ethernet at 0 { + device_type = "network"; + compatible = "marvell,mv643xx-eth"; + reg = <0>; + interrupts = <21>; + }; + }; }; };
Signature · 1 line
1.7.10.4
PATCH v2 5/5 ARM: dove: add gigabit device tree nodes to dove.dtsi
In reply to Florian FainelliThis patch adds the gigabit ethernet device tree nodes to dove.dtsi in a disabled state. The gigabit ethernet device tree node must be enabled on a per-board basis. For completeness and easier testing the MDIO node is also added in a disabled state.
---
Changes since v1:
- fixed off-by 0x2000 address of the ethernet-group node
arch/arm/boot/dts/dove.dtsi | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
arch/arm/boot/dts/dove.dtsi +25 -0
@@ -253,5 +253,30 @@ dmacap,xor; }; }; + + mdio at 72004 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "marvell,orion-mdio"; + reg = <0x72004 0x84>; + status = "disabled"; + }; + + ethernet-group at 72000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "marvell,mv643xx-eth-block"; + reg = <0x72000 0x4000>; + tx-csum-limit = <1600>; + status = "disabled"; + + egiga0: ethernet at 0 { + device_type = "network"; + compatible = "marvell,mv643xx-eth"; + reg = <0>; + interrupts = <29>; + clocks = <&gate_clk 2>; + }; + }; }; };
Signature · 1 line
1.7.10.4
Florian,
Quoted 20 lines · Florian Fainelli
Hi all,
This patch serie implements
mv643xx_ethdevice tree bindings. I opted for the reuse of the bindings already defined inDocumentation/devicetree/bindings/marvell.txtso that we do not create any confusion.For reference, I have included the mv643xx-eth related nodes in the corresponding Kirkwood, Dove and Orion5x .dtsi files so you can more easily test on your own platforms.
I tested these on a custom 88F6181-based boards.
Florian Fainelli (5):
mv643xx_eth: add Device Tree bindings
mv643xx_eth: update Device Tree bindings documentation
ARM: kirkwood: add device node entries for the gigabit interfaces
ARM: orion5x: add gigabit ethernet device tree node
ARM: dove: add gigabit device tree nodes todove.dtsi
Quoted 6 lines
Documentation/devicetree/bindings/marvell.txt | 25 +++++- arch/arm/boot/dts/dove.dtsi | 25 ++++++ arch/arm/boot/dts/kirkwood.dtsi | 46 ++++++++++ arch/arm/boot/dts/orion5x.dtsi | 23 +++++ drivers/net/ethernet/marvell/mv643xx_eth.c | 120 ++++++++++++++++++++++++- 5 files changed, 234 insertions(+), 5 deletions(-)
How is the new version of this looking? Do you think you'll be able to get it up in time for DaveM to take it into v3.10?
With this and Thomas' pci series, we will have Kirkwood fully converted to devicetree, can begin removing board files, and finally begin migrating everything over to mach-mvebu/. This will lead to the removal of five directories under arch/arm/ (plat-orion, mach-kirkwood, mach-orion5x, mach-dove, and mach-mv78xx0).
thx,
Jason.
Sebastian Hesselbarth
maintainerQuoted 7 lines · Jason Cooper
Quoted 5 lines · Florian Fainelli
This patch serie implements
mv643xx_ethdevice tree bindings. I opted for the reuse of the bindings already defined inDocumentation/devicetree/bindings/marvell.txtso that we do not create any confusion.
Quoted 8 lines
How is the new version of this looking? Do you think you'll be able to get it up in time for DaveM to take it into v3.10?
With this and Thomas' pci series, we will have Kirkwood fully converted to devicetree, can begin removing board files, and finally begin migrating everything over to mach-mvebu/. This will lead to the removal of five directories under
arch/arm/(plat-orion, mach-kirkwood, mach-orion5x, mach-dove, and mach-mv78xx0).
Jason,
I sent Florian an update of some of his patches earlier, based on cleanup patches I submitted for mv643xx_eth while testing his patch set. I think, the patch set will play nicely on ARM but without PPC guys involved in testing it, I guess it will break something there.
Florian is reusing the DT bindings from PPC and they are compatible, but there parsing is also done within arch/ppc/sysdev/mv64360-dev.c and maybe somewhere else. The current DT patches for mv643xx_eth will reparse some properties again (and may break eth on ppc platforms using mv643xx_eth).
Sebastian
Dear Jason Cooper,
Quoted 5 lines · Jason Cooper
With this and Thomas' pci series, we will have Kirkwood fully converted to devicetree, can begin removing board files, and finally begin migrating everything over to mach-mvebu/. This will lead to the removal of five directories under
arch/arm/(plat-orion, mach-kirkwood, mach-orion5x, mach-dove, and mach-mv78xx0).
No, we can't remove mach-orion5x and mach-mv78xx0 for now, they have not been converted at all in terms of gpio/pinmux support. I've started writing some pinmux code for orion5x but it's not ready.
I don't think we should rush in doing this merge into mach-mvebu. I'd prefer to have the following conditions be met before a platform gets merged into mach-mvebu:
* The mach-<foo> directory no longer depends on anything in plat-orion. For mach-kirkwood, things are OK (for the DT platforms) for GPIO, MPP and PCIe, but some work remains for the IRQ controller driver and the timer driver.
* All boards have been converted to the Device Tree. For mach-kirkwood, we're getting closer.
Once a given mach-<foo> platform meets these conditions, it will be a clean platform, and we can merge it into mach-mvebu without any problem.
So let's continue the cleanup work, conversion to DT, usage of drivers in drivers/, improvement of pinmux to support orion5x/mv78xx0, and do the move per-platform, once they are ready.
What do you think?
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
Quoted 30 lines · Thomas Petazzoni
Dear Jason Cooper,
Quoted 5 lines · Jason Cooper
With this and Thomas' pci series, we will have Kirkwood fully converted to devicetree, can begin removing board files, and finally begin migrating everything over to mach-mvebu/. This will lead to the removal of five directories under
arch/arm/(plat-orion, mach-kirkwood, mach-orion5x, mach-dove, and mach-mv78xx0).No, we can't remove mach-orion5x and mach-mv78xx0 for now, they have not been converted at all in terms of gpio/pinmux support. I've started writing some pinmux code for orion5x but it's not ready.
I don't think we should rush in doing this merge into mach-mvebu. I'd prefer to have the following conditions be met before a platform gets merged into mach-mvebu:
* The mach-<foo> directory no longer depends on anything in plat-orion. For mach-kirkwood, things are OK (for the DT platforms) for GPIO, MPP and PCIe, but some work remains for the IRQ controller driver and the timer driver.
* All boards have been converted to the Device Tree. For mach-kirkwood, we're getting closer.
Once a given mach-<foo> platform meets these conditions, it will be a clean platform, and we can merge it into mach-mvebu without any problem.
Quoted 5 lines
So let's continue the cleanup work, conversion to DT, usage of drivers in
drivers/, improvement of pinmux to support orion5x/mv78xx0, and do the move per-platform, once they are ready.What do you think?
I agree completely. I was simply restating the longview goal of the work we are doing (above and beyond adding armadaXP/370). I probably should have given a time reference for "This will lead to..." :)
Also, I have a feeling that not all legacy boards will get converted over. If there is no interest or no way to test, certains boards may get deprecated.
thx,
Jason.
Quoted 14 lines · Jason Cooper
Quoted 13 lines · Thomas Petazzoni
Dear Jason Cooper,
Quoted 5 lines · Jason Cooper
With this and Thomas' pci series, we will have Kirkwood fully converted to devicetree, can begin removing board files, and finally begin migrating everything over to mach-mvebu/. This will lead to the removal of five directories under
arch/arm/(plat-orion, mach-kirkwood, mach-orion5x, mach-dove, and mach-mv78xx0).No, we can't remove mach-orion5x and mach-mv78xx0 for now, they have not been converted at all in terms of gpio/pinmux support. I've started writing some pinmux code for orion5x but it's not ready.
[...]
Quoted 3 lines
Also, I have a feeling that not all legacy boards will get converted over. If there is no interest or no way to test, certains boards may get deprecated.
Debian supports many Kirkwood and Orion 5x systems. A call for testing on the debian-arm at lists.debian.org list might be worthwhile.
I would be very glad to see kirkwood, orion5x and mv78xx0 merged - we build natively and this takes about 8 hours for each configuration.
Ben.
Signature · 9 lines
Ben Hutchings The first rule of tautology club is the first rule of tautology club. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 828 bytes Desc: This is a digitally signed message part URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130415/2648cd5c/attachment.sig>
Quoted 15 lines · Ben Hutchings
Quoted 11 lines · Jason Cooper
Quoted 10 lines · Thomas Petazzoni
Dear Jason Cooper,
Quoted 5 lines · Jason Cooper
With this and Thomas' pci series, we will have Kirkwood fully converted to devicetree, can begin removing board files, and finally begin migrating everything over to mach-mvebu/. This will lead to the removal of five directories under
arch/arm/(plat-orion, mach-kirkwood, mach-orion5x, mach-dove, and mach-mv78xx0).Quoted 3 lines
Quoted 3 lines
No, we can't remove mach-orion5x and mach-mv78xx0 for now, they have not been converted at all in terms of gpio/pinmux support. I've started writing some pinmux code for orion5x but it's not ready.
Quoted 7 lines
[...]
Quoted 3 lines
Also, I have a feeling that not all legacy boards will get converted over. If there is no interest or no way to test, certains boards may get deprecated.
Debian supports many Kirkwood and Orion 5x systems. A call for testing on the debian-arm at lists.debian.org list might be worthwhile.
definitely.
Quoted 2 lines
I would be very glad to see kirkwood, orion5x and mv78xx0 merged - we build natively and this takes about 8 hours for each configuration.
That's the plan, build an armv5 kernel, and dtb's for all the boards. Then, an armv7 kernel for the armadaXP/370 boards, etc.
thx,
Jason.
Dear Jason Cooper,
Quoted 9 lines · Jason Cooper
Quoted 5 lines
So let's continue the cleanup work, conversion to DT, usage of drivers in
drivers/, improvement of pinmux to support orion5x/mv78xx0, and do the move per-platform, once they are ready.What do you think?
I agree completely. I was simply restating the longview goal of the work we are doing (above and beyond adding armadaXP/370). I probably should have given a time reference for "This will lead to..." :)
Ok. I definitely agree with the long-term goal.
Quoted 3 lines
Also, I have a feeling that not all legacy boards will get converted over. If there is no interest or no way to test, certains boards may get deprecated.
I think for many of them, we can do a 'blind' conversion to DT, and ask the users who have posted patches or even submitted support for those boards to test the DT. But I don't think we should move things into mach-mvebu if there are still legacy non-DT Kirkwood platforms supported in mach-kirkwood. So either we convert them to the DT, or we remove the support for them if no-one is really interested. But I believe in most cases, converting them to DT should be quite easy.
Best regards,
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
A message that is not in the archive (sent off-list or not yet received): 1365071235-11611-1-git-send-email-florian-p3rKhJxN3npAfugRpC6u6w@public.gmane.org
cover mv643xx_eth: device tree bindings
This patch set picks up work by Florian Fainelli bringing full DT support to mv643xx_eth and Marvell SoCs using it.
The current patch set drops Florian's device tree conversions for Kirkwood, Dove, and Orion5x in favour of split patches for board files and board descriptor files.
Device tree conversion for Dove and Kirkwood is added. Dove has been fully tested, while Kirkwood is compile-tested only.
Florian Fainelli (2):
net: mv643xx_eth: add Device Tree bindings
net: mv643xx_eth: update Device Tree bindings documentation
Sebastian Hesselbarth (5):
ARM: dove: remove legacy mv643xx_eth setup
ARM: dove: add gigabit ethernet and mvmdio device tree nodes
ARM: kirkwood: remove legacy mv643xx_eth board setup
ARM: kirkwood: add gigabit ethernet and mvmdio device tree nodes
ARM: kirkwood: remove legacy clk alias for mv643xx_eth
Documentation/devicetree/bindings/marvell.txt | 22 ++++- arch/arm/boot/dts/dove-cubox.dts | 8 ++ arch/arm/boot/dts/dove.dtsi | 35 +++++++ arch/arm/boot/dts/kirkwood-cloudbox.dts | 15 +++ arch/arm/boot/dts/kirkwood-dnskw.dtsi | 15 +++ arch/arm/boot/dts/kirkwood-dockstar.dts | 15 +++ arch/arm/boot/dts/kirkwood-dreamplug.dts | 26 +++++ arch/arm/boot/dts/kirkwood-goflexnet.dts | 15 +++ .../arm/boot/dts/kirkwood-guruplug-server-plus.dts | 26 +++++ arch/arm/boot/dts/kirkwood-ib62x0.dts | 15 +++ arch/arm/boot/dts/kirkwood-iconnect.dts | 15 +++ arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts | 22 ++++ arch/arm/boot/dts/kirkwood-is2.dts | 2 + arch/arm/boot/dts/kirkwood-km_kirkwood.dts | 15 +++ arch/arm/boot/dts/kirkwood-lsxl.dtsi | 26 +++++ arch/arm/boot/dts/kirkwood-mplcec4.dts | 25 +++++ .../boot/dts/kirkwood-netgear_readynas_duo_v2.dts | 15 +++ arch/arm/boot/dts/kirkwood-ns2-common.dtsi | 15 +++ arch/arm/boot/dts/kirkwood-ns2.dts | 2 + arch/arm/boot/dts/kirkwood-ns2lite.dts | 2 + arch/arm/boot/dts/kirkwood-ns2max.dts | 2 + arch/arm/boot/dts/kirkwood-ns2mini.dts | 2 + arch/arm/boot/dts/kirkwood-openblocks_a6.dts | 15 +++ arch/arm/boot/dts/kirkwood-topkick.dts | 15 +++ arch/arm/boot/dts/kirkwood-ts219-6281.dts | 4 +- arch/arm/boot/dts/kirkwood-ts219-6282.dts | 4 +- arch/arm/boot/dts/kirkwood-ts219.dtsi | 15 +++ arch/arm/boot/dts/kirkwood.dtsi | 52 ++++++++++ arch/arm/mach-dove/board-dt.c | 5 - arch/arm/mach-kirkwood/board-dnskw.c | 7 -- arch/arm/mach-kirkwood/board-dockstar.c | 9 -- arch/arm/mach-kirkwood/board-dreamplug.c | 14 --- arch/arm/mach-kirkwood/board-dt.c | 16 --- arch/arm/mach-kirkwood/board-goflexnet.c | 9 -- arch/arm/mach-kirkwood/board-guruplug.c | 14 --- arch/arm/mach-kirkwood/board-ib62x0.c | 9 -- arch/arm/mach-kirkwood/board-iconnect.c | 6 - arch/arm/mach-kirkwood/board-iomega_ix2_200.c | 16 --- arch/arm/mach-kirkwood/board-km_kirkwood.c | 7 -- arch/arm/mach-kirkwood/board-lsxl.c | 12 -- arch/arm/mach-kirkwood/board-mplcec4.c | 11 -- arch/arm/mach-kirkwood/board-ns2.c | 13 --- arch/arm/mach-kirkwood/board-openblocks_a6.c | 9 -- arch/arm/mach-kirkwood/board-readynas.c | 6 - arch/arm/mach-kirkwood/board-ts219.c | 13 --- arch/arm/mach-kirkwood/board-usi_topkick.c | 9 -- drivers/net/ethernet/marvell/mv643xx_eth.c | 108 +++++++++++++++++++- include/linux/mv643xx_eth.h | 3 + 48 files changed, 544 insertions(+), 192 deletions(-)
---
Cc: Grant Likely <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Rob Landley <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: David Miller <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Arnaud Patard <[email protected]>
Cc: Russell King <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Jean-Francois Moine <[email protected]>
Cc: Thomas Petazzoni <[email protected]>
Cc: Simon Guinot <[email protected]>
Cc: Jamie Lentin <[email protected]>
Cc: Michael Walle <[email protected]>
Cc: Eric Hutter <[email protected]>
Cc: Joshua Coombs <[email protected]>
Cc: Willy Tarreau <[email protected]>
Cc: Simon Baatz <[email protected]>
Cc: Alan M Butler <[email protected]>
Cc: Nigel Roberts <[email protected]>
Cc: Valentin Longchamp <[email protected]>
Cc: Stefan Peter <[email protected]>
Cc: Arnaud Ebalard <[email protected]>
Cc: Nobuhiro Iwamatsu <[email protected]>
Cc: netdev at vger.kernel.org
Cc: devicetree-discuss at lists.ozlabs.org
Cc: linux-doc at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
Signature · 1 line
1.7.2.5
A message that is not in the archive (sent off-list or not yet received): 1367854420-8006-1-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
PATCH v3 1/7 net: mv643xx_eth: add Device Tree bindings
From: Florian Fainelli <[email protected]>
This patch adds Device Tree bindings following the already defined bindings at Documentation/devicetree/bindings/marvell.txt. The binding documentation is also enhanced with new optionnal properties required for supporting certain devices (RX/TX queue and SRAM). Since we now have proper support for the orion MDIO bus driver, there is no need to fiddle around with device tree phandles. PHY-less (MAC connected to switch) configurations are supported by not specifying any phy phandle for an ethernet node.
---
Changelog:v2->v3:
- rebase on top of mv643xx_eth clean-ups
- do not reparse existing platform_data
- use managed devm_kzalloc for parsed platform_data
- use of_property_read_u32 where applicable
- add phy_node to platform_data
- use of_connect_phy if DT phy node was found
v1->v2:
- properly ifdef of_platform_bus_probe with CONFIG_OF
- handle of_platform_bus_probe errors and cleanup accordingly
- use of_property_read_u32 where applicable
- parse "duplex" and "speed" property in PHY-less configuration
--- Documentation/devicetree/bindings/marvell.txt | 22 +++++- drivers/net/ethernet/marvell/mv643xx_eth.c | 108 ++++++++++++++++++++++++- include/linux/mv643xx_eth.h | 3 + 3 files changed, 128 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/marvell.txt +20 -2
@@ -112,11 +112,13 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd. Required properties: - #address-cells : <1> - #size-cells : <0> - - compatible : "marvell,mv64360-eth-block" + - compatible : "marvell,mv64360-eth-block", "marvell,mv643xx-eth-block" - reg : Offset and length of the register set for this block Optional properties: - clocks : Phandle to the clock control device and gate bit + - tx-csum-limit : Hardware limit above which transmit checksumming + is disabled. Example Discovery Ethernet block node: ethernet-block at 2000 {
@@ -133,7 +135,7 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd. Required properties: - device_type : Should be "network". - - compatible : Should be "marvell,mv64360-eth". + - compatible : Should be "marvell,mv64360-eth", "marvell,mv643xx-eth" - reg : Should be <0>, <1>, or <2>, according to which registers within the silicon block the device uses. - interrupts : <a> where a is the interrupt number for the port.
@@ -143,6 +145,22 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd. controller. - local-mac-address : 6 bytes, MAC address + Optional properties: + - clocks : Phandle to the clock control device and gate bit + - clock-names : String describing the clock gate bit + - speed : Speed to force the link (10, 100, 1000), used when no + phy property is defined + - duplex : Duplex to force the link (0: half, 1: full), used when no + phy property is defined + - rx-queue-count : number of RX queues to use + - tx-queue-count : number of TX queues to use + - rx-queue-size : size of the RX queue (in bytes) + - tx-queue-size : size of the TX queue (in bytes) + - rx-sram-addr : address of the SRAM for RX path (non 0 means used) + - rx-sram-size : size of the SRAM for RX path (non 0 means used) + - tx-sram-addr : address of the SRAM for TX path (non 0 means used) + - tx-sram-size : size of the SRAM for TX path (non 0 means used) + Example Discovery Ethernet port node: ethernet at 0 { device_type = "network";
drivers/net/ethernet/marvell/mv643xx_eth.c +105 -3
174 lines not on this page · raw message
include/linux/mv643xx_eth.h +3 -0
@@ -30,6 +30,8 @@ struct mv643xx_eth_shared_platform_data {#define MV643XX_ETH_PHY_ADDR (x) (0x80 | (x))#define MV643XX_ETH_PHY_NONE 0xff +struct device_node ; +struct mv643xx_eth_platform_data {/* * Pointer back to our parent instance, and our port number.
@@ -41,6 +43,7 @@ struct mv643xx_eth_platform_data {* Whether a PHY is present, and if yes, at which address. */ int phy_addr; +struct device_node *phy_node;/* * Use this MAC address if it is valid, overriding the
Signature · 1 line
1.7.2.5
Re: [PATCH v3 1/7] net: mv643xx_eth: add Device Tree bindings
Hi Sebastian,
Quoted 163 lines · Sebastian Hesselbarth
From: Florian Fainelli <[email protected]>
This patch adds Device Tree bindings following the already defined bindings at
Documentation/devicetree/bindings/marvell.txt. The binding documentation is also enhanced with new optionnal properties required for supporting certain devices (RX/TX queue and SRAM). Since we now have proper support for the orion MDIO bus driver, there is no need to fiddle around with device tree phandles. PHY-less (MAC connected to switch) configurations are supported by not specifying any phy phandle for an ethernet node.Signed-off-by Florian Fainelli <[email protected]>Signed-off-by Sebastian Hesselbarth <[email protected]>---
Changelog:v2->v3:
- rebase on top ofmv643xx_ethclean-ups
- do not reparse existingplatform_data
- use manageddevm_kzallocfor parsedplatform_data
- useof_property_read_u32where applicable
- addphy_nodetoplatform_data
- useof_connect_phyif DT phy node was found
v1->v2:
- properly ifdefof_platform_bus_probewithCONFIG_OF
- handleof_platform_bus_probeerrors and cleanup accordingly
- useof_property_read_u32where applicable
- parse "duplex" and "speed" property in PHY-less configurationCc Grant Likely <[email protected]>Cc Rob Herring <[email protected]>Cc Rob Landley <[email protected]>Cc Lennert Buytenhek <[email protected]>Cc David Miller <[email protected]>Cc Florian Fainelli <[email protected]>Cc Arnaud Patard <[email protected]>Cc Russell King <[email protected]>Cc Jason Cooper <[email protected]>Cc Andrew Lunn <[email protected]>Cc Jean-Francois Moine <[email protected]>Cc Thomas Petazzoni <[email protected]>Cc Simon Guinot <[email protected]>Cc Jamie Lentin <[email protected]>Cc Michael Walle <[email protected]>Cc Eric Hutter <[email protected]>Cc Joshua Coombs <[email protected]>Cc Willy Tarreau <[email protected]>Cc Simon Baatz <[email protected]>Cc Alan M Butler <[email protected]>Cc Nigel Roberts <[email protected]>Cc Valentin Longchamp <[email protected]>Cc Stefan Peter <[email protected]>Cc Arnaud Ebalard <[email protected]>Cc Nobuhiro Iwamatsu <[email protected]>Cc netdev at vger.kernel.orgCc devicetree-discuss at lists.ozlabs.orgCc linux-doc at vger.kernel.orgCc linux-arm-kernel at lists.infradead.orgCc linux-kernel at vger.kernel.org--- Documentation/devicetree/bindings/marvell.txt | 22 +++++- drivers/net/ethernet/marvell/mv643xx_eth.c | 108 ++++++++++++++++++++++++- include/linux/mv643xx_eth.h | 3 + 3 files changed, 128 insertions(+), 5 deletions(-)Documentation/devicetree/bindings/marvell.txt +20
-2@@ -112,11 +112,13 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd. Required properties: - #address-cells : <1> - #size-cells : <0> - - compatible : "marvell,mv64360-eth-block" + - compatible : "marvell,mv64360-eth-block", "marvell,mv643xx-eth-block" - reg : Offset and length of the register set for this block Optional properties: - clocks : Phandle to the clock control device and gate bit + - tx-csum-limit : Hardware limit above which transmit checksumming + is disabled. Example Discovery Ethernet block node: ethernet-block at 2000 {@@ -133,7 +135,7 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd. Required properties: - device_type : Should be "network". - - compatible : Should be "marvell,mv64360-eth". + - compatible : Should be "marvell,mv64360-eth", "marvell,mv643xx-eth" - reg : Should be <0>, <1>, or <2>, according to which registers within the silicon block the device uses. - interrupts : <a> where a is the interrupt number for the port.@@ -143,6 +145,22 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd. controller. - local-mac-address : 6 bytes, MAC address + Optional properties: + - clocks : Phandle to the clock control device and gate bit + - clock-names : String describing the clock gate bit + - speed : Speed to force the link (10, 100, 1000), used when no + phy property is defined + - duplex : Duplex to force the link (0: half, 1: full), used when no + phy property is defined + - rx-queue-count : number of RX queues to use + - tx-queue-count : number of TX queues to use + - rx-queue-size : size of the RX queue (in bytes) + - tx-queue-size : size of the TX queue (in bytes) + - rx-sram-addr : address of the SRAM for RX path (non 0 means used) + - rx-sram-size : size of the SRAM for RX path (non 0 means used) + - tx-sram-addr : address of the SRAM for TX path (non 0 means used) + - tx-sram-size : size of the SRAM for TX path (non 0 means used) + Example Discovery Ethernet port node: ethernet at 0 { device_type = "network";drivers/net/ethernet/marvell/mv643xx_eth.c +16
-2@@ -60,6 +60,11 @@#include <linux/types.h> #include <linux/slab.h> #include <linux/clk.h> +#include <linux/stringify.h> +#include <linux/of.h> +#include <linux/of_platform.h> +#include <linux/of_mdio.h> +#include <linux/of_net.h> static char mv643xx_eth_driver_name[] ="mv643xx_eth" ;static char mv643xx_eth_driver_version[] ="1.4" ;@@ -2450,13 +2455,22 @@ static void infer_hw_params(struct mv643xx_eth_shared_private *msp) } } +static const struct of_device_id mv643xx_eth_match[] = { + { .compatible ="marvell,mv64360-eth" }, + { .compatible ="marvell,mv643xx-eth" }, + { }, +}; +MODULE_DEVICE_TABLE (of, mv643xx_eth_match); +static int mv643xx_eth_shared_probe (struct platform_device *pdev) {static int mv643xx_eth_version_printed; +struct device_node *np = pdev->dev.of_node;struct mv643xx_eth_shared_platform_data *pd = pdev->dev.platform_data;struct mv643xx_eth_shared_private *msp;const struct mbus_dram_target_info *dram;struct resource *res; +int tx_csum_limit =0 ;if (!mv643xx_eth_version_printed++) pr_notice("MV-643xx 10/100/1000 ethernet driver version %s\n",@@ -2485,13 +2499,21 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)if (dram)mv643xx_eth_conf_mbus_windows (msp, dram); - msp->tx_csum_limit = (pd !=NULL && pd->tx_csum_limit) ? - pd->tx_csum_limit :9 *1024 ; +if (np) +of_property_read_u32 (np,"tx-csum-limit" , &tx_csum_limit);
drivers/net/ethernet/marvell/mv643xx_eth.c static int mv643xx_eth_shared_probe(struct platform_device *pdev) · line 2513
Quoted 10 lines
drivers/net/ethernet/marvell/mv643xx_eth.c +6
-0+else + tx_csum_limit = pd->tx_csum_limit; + + msp->tx_csum_limit = tx_csum_limit ? tx_csum_limit :9 *1024 ;infer_hw_params (msp);platform_set_drvdata (pdev, msp); +#ifdef CONFIG_OF +return of_platform_bus_probe (np, mv643xx_eth_match, &pdev->dev);
I have tested this on Kirkwood (Sheevaplug eSATA). When using mv643xx_eth as a module with a built-in mvmdio the GbE port works. However, when unloading the mv643xx_eth module and loading it again, the second call to of_platform_bus_probe() results in a warning:
[ 190.542992] WARNING: at fs/sysfs/dir.c:530 sysfs_add_one+0x7c/0xa4() [ 190.549372] sysfs: cannot create duplicate filename '/devices/ocp.0/f1072000.
ethernet-controller/0.ethernet-port'
(Looks more like a problem of of_platform_bus_probe() than a problem in the driver?)
Quoted 97 lines
drivers/net/ethernet/marvell/mv643xx_eth.c +72
-0+#else return 0 ; +#endif }static int mv643xx_eth_shared_remove (struct platform_device *pdev)@@ -2505,12 +2527,20 @@ static int mv643xx_eth_shared_remove(struct platform_device *pdev)return 0 ; } +static const struct of_device_id mv643xx_eth_shared_match[] = { + { .compatible ="marvell,mv64360-eth-block" }, + { .compatible ="marvell,mv643xx-eth-block" }, + { }, +}; +MODULE_DEVICE_TABLE (of, mv643xx_eth_shared_match); +static struct platform_driver mv643xx_eth_shared_driver = { .probe = mv643xx_eth_shared_probe, .remove = mv643xx_eth_shared_remove, .driver = { .name =MV643XX_ETH_SHARED_NAME , .owner =THIS_MODULE , + .of_match_table =of_match_ptr (mv643xx_eth_shared_match), }, };@@ -2669,6 +2699,68 @@ static const struct net_device_ops mv643xx_eth_netdev_ops = {#endif }; +#ifdef CONFIG_OF +static int mv643xx_eth_of_probe (struct platform_device *pdev) +{ +struct mv643xx_eth_platform_data *pd; +struct device_node *np = pdev->dev.of_node; +struct device_node *shared =of_get_parent (np); +const int *prop; +const char *mac_addr; + +if (pdev->dev.platform_data || !pdev->dev.of_node) +return 0 ; + + pd =devm_kzalloc (&pdev->dev,sizeof (*pd),GFP_KERNEL ); +if (!pd) +return -ENOMEM ; + + pdev->dev.platform_data = pd; + + pd->shared =of_find_device_by_node (shared); +if (!pd->shared) +return -ENODEV ; + +if (of_property_read_u32 (np,"reg" , &pd->port_number)) +return -EINVAL ; + + pd->phy_node =of_parse_phandle (np,"phy" ,0 ); +if (!pd->phy_node) { + pd->phy_addr =MV643XX_ETH_PHY_NONE ; + +of_property_read_u32 (np,"speed" , &pd->speed); +of_property_read_u32 (np,"duplex" , &pd->duplex); + } + + mac_addr =of_get_mac_address (np); +if (mac_addr) +memcpy (pd->mac_addr, mac_addr,ETH_ALEN ); + +#define rx_tx_queue_sram_property (_name) \ + do { \ + prop = of_get_property(np, __stringify(_name), NULL); \ + if (prop) \ + pd->_name = be32_to_cpup(prop); \ + } while (0) + +rx_tx_queue_sram_property (rx_queue_count); +rx_tx_queue_sram_property (tx_queue_count); +rx_tx_queue_sram_property (rx_queue_size); +rx_tx_queue_sram_property (tx_queue_size); +rx_tx_queue_sram_property (rx_sram_addr); +rx_tx_queue_sram_property (rx_sram_size); +rx_tx_queue_sram_property (tx_sram_addr); +rx_tx_queue_sram_property (rx_sram_size); + +return 0 ; +} +#else +static inline int mv643xx_eth_of_probe (struct platform_device *dev) +{ +return 0 ; +} +#endif +static int mv643xx_eth_probe (struct platform_device *pdev) {struct mv643xx_eth_platform_data *pd;
drivers/net/ethernet/marvell/mv643xx_eth.c static int mv643xx_eth_probe(struct platform_device *pdev) · line 2778
Quoted 10 lines
drivers/net/ethernet/marvell/mv643xx_eth.c +4
-0@@ -2677,6 +2769,10 @@ static int mv643xx_eth_probe(struct platform_device *pdev)struct resource *res;int err; + err =mv643xx_eth_of_probe (pdev); +if (err) +return err; + pd = pdev->dev.platform_data;if (pd ==NULL ) {dev_err (&pdev->dev,"no mv643xx_eth_platform_data\n" );
If the clock isn't already enabled (mvmdio and mv643xx_eth both built as modules), a delay seems to be necessary in mv643xx_eth_probe() after enabling the clock on my hardware. Otherwise the device hangs. Andrew found the same in the past (see [1]). udelay(50) seems to be sufficient in my case.
drivers/net/ethernet/marvell/mv643xx_eth.c static int mv643xx_eth_probe(struct platform_device *pdev) · line 2819
Quoted 9 lines
drivers/net/ethernet/marvell/mv643xx_eth.c +4
-1@@ -2717,7 +2813,12 @@ static int mv643xx_eth_probe(struct platform_device *pdev)netif_set_real_num_rx_queues (dev, mp->rxq_count);if (pd->phy_addr !=MV643XX_ETH_PHY_NONE ) { - mp->phy =phy_scan (mp, pd->phy_addr); +if (pd->phy_node) + mp->phy =of_phy_connect (mp->dev, pd->phy_node, + mv643xx_eth_adjust_link,0 , +PHY_INTERFACE_MODE_GMII );
of_phy_connect() returns NULL in case of an error and no ERR_PTR.
- Simon
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2012-June/103521.html
Sebastian Hesselbarth
maintainerRe: [PATCH v3 1/7] net: mv643xx_eth: add Device Tree bindings
Quoted 3 lines · Simon Baatz
Quoted 2 lines · Sebastian Hesselbarth
From: Florian Fainelli<[email protected]>
...
Quoted 24 lines
Quoted 8 lines
drivers/net/ethernet/marvell/mv643xx_eth.c +2
-2@@ -2485,13 +2499,21 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)if (dram)mv643xx_eth_conf_mbus_windows (msp, dram); - msp->tx_csum_limit = (pd !=NULL && pd->tx_csum_limit) ? - pd->tx_csum_limit :9 *1024 ; +if (np) +of_property_read_u32 (np,"tx-csum-limit" ,&tx_csum_limit);drivers/net/ethernet/marvell/mv643xx_eth.c static int mv643xx_eth_shared_probe(struct platform_device *pdev) · line 2513
Quoted 10 lines
drivers/net/ethernet/marvell/mv643xx_eth.c +6
-0+else + tx_csum_limit = pd->tx_csum_limit; + + msp->tx_csum_limit = tx_csum_limit ? tx_csum_limit :9 *1024 ;infer_hw_params (msp);platform_set_drvdata (pdev, msp); +#ifdef CONFIG_OF +return of_platform_bus_probe (np, mv643xx_eth_match,&pdev->dev);I have tested this on Kirkwood (Sheevaplug eSATA). When using
mv643xx_ethas a module with a built-in mvmdio the GbE port works. However, when unloading themv643xx_ethmodule and loading it again, the second call toof_platform_bus_probe()results in a warning:
Quoted 6 lines
[ 190.542992] WARNING: at fs/sysfs/dir.c:530 sysfs_add_one+0x7c/0xa4() [ 190.549372] sysfs: cannot create duplicate filename '/devices/ocp.0/f1072000.ethernet-controller/0.ethernet-port'
(Looks more like a problem of
of_platform_bus_probe()than a problem in the driver?)
Hi Simon,
thanks for the review. I am right now working on a v4 of the DT support patches for mv643xx_eth and the above will not be there anymore. I will test v4 for rmmod/modprobe issues before posting.
Quoted 4 lines
Quoted 4 lines
drivers/net/ethernet/marvell/mv643xx_eth.c +0
-0@@ -2677,6 +2769,10 @@ static int mv643xx_eth_probe(struct platform_device *pdev)struct resource *res;int err;
Quoted 13 lines
drivers/net/ethernet/marvell/mv643xx_eth.c static int mv643xx_eth_probe(struct platform_device *pdev) · line 2778
Quoted 7 lines
drivers/net/ethernet/marvell/mv643xx_eth.c +4
-0+ err =mv643xx_eth_of_probe (pdev); +if (err) +return err; + pd = pdev->dev.platform_data;if (pd ==NULL ) {dev_err (&pdev->dev,"no mv643xx_eth_platform_data\n" );If the clock isn't already enabled (mvmdio and
mv643xx_ethboth built as modules), a delay seems to be necessary inmv643xx_eth_probe()after enabling the clock on my hardware. Otherwise the device hangs. Andrew found the same in the past (see [1]). udelay(50) seems to be sufficient in my case.
Hmm, I am wondering if that delay shouldn't be in the clock provider then. I test it on Dove also and look for a way to insert the delay if neccessary. Maybe Andrew can also comment on this.
Quoted 11 lines
drivers/net/ethernet/marvell/mv643xx_eth.c static int mv643xx_eth_probe(struct platform_device *pdev) · line 2819
Quoted 9 lines
drivers/net/ethernet/marvell/mv643xx_eth.c +4
-1@@ -2717,7 +2813,12 @@ static int mv643xx_eth_probe(struct platform_device *pdev)netif_set_real_num_rx_queues (dev, mp->rxq_count);if (pd->phy_addr !=MV643XX_ETH_PHY_NONE ) { - mp->phy =phy_scan (mp, pd->phy_addr); +if (pd->phy_node) + mp->phy =of_phy_connect (mp->dev, pd->phy_node, + mv643xx_eth_adjust_link,0 , +PHY_INTERFACE_MODE_GMII );
of_phy_connect()returns NULL in case of an error and noERR_PTR.
True, will take care of that.
Sebastian
PATCH v3 2/7 net: mv643xx_eth: update Device Tree bindings documentation
In reply to a message not in the archiveFrom: Florian Fainelli <[email protected]>
This patch updates the Device Tree bindings documentation for the Marvell MV643xx ethernet controller node and makes the "local-mac-address" and "phy" properties optional instead of required. The absence of a "phy" node is legal and describes a MAC to switch configuration, while not specifying the "local-mac-address" allows for reuse of the MAC address already programmed into the Ethernet controller.
---
Cc: Grant Likely <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Rob Landley <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: David Miller <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Arnaud Patard <[email protected]>
Cc: Russell King <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Jean-Francois Moine <[email protected]>
Cc: Thomas Petazzoni <[email protected]>
Cc: Simon Guinot <[email protected]>
Cc: Jamie Lentin <[email protected]>
Cc: Michael Walle <[email protected]>
Cc: Eric Hutter <[email protected]>
Cc: Joshua Coombs <[email protected]>
Cc: Willy Tarreau <[email protected]>
Cc: Simon Baatz <[email protected]>
Cc: Alan M Butler <[email protected]>
Cc: Nigel Roberts <[email protected]>
Cc: Valentin Longchamp <[email protected]>
Cc: Stefan Peter <[email protected]>
Cc: Arnaud Ebalard <[email protected]>
Cc: Nobuhiro Iwamatsu <[email protected]>
Cc: netdev at vger.kernel.org
Cc: devicetree-discuss at lists.ozlabs.org
Cc: linux-doc at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
--- Documentation/devicetree/bindings/marvell.txt | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/marvell.txt +2 -2
@@ -141,11 +141,11 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd. - interrupts : <a> where a is the interrupt number for the port. - interrupt-parent : the phandle for the interrupt controller that services interrupts for this device. + + Optional properties: - phy : the phandle for the PHY connected to this ethernet controller. - local-mac-address : 6 bytes, MAC address - - Optional properties: - clocks : Phandle to the clock control device and gate bit - clock-names : String describing the clock gate bit - speed : Speed to force the link (10, 100, 1000), used when no
Signature · 1 line
1.7.2.5
PATCH v3 3/7 ARM: dove: remove legacy mv643xx_eth setup
In reply to a message not in the archiveWith DT support for mv643xx_eth we do not need legacy platform_data based setup for DT enabled boards.
---
Cc: Grant Likely <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Rob Landley <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: David Miller <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Arnaud Patard <[email protected]>
Cc: Russell King <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Jean-Francois Moine <[email protected]>
Cc: Thomas Petazzoni <[email protected]>
Cc: Simon Guinot <[email protected]>
Cc: Jamie Lentin <[email protected]>
Cc: Michael Walle <[email protected]>
Cc: Eric Hutter <[email protected]>
Cc: Joshua Coombs <[email protected]>
Cc: Willy Tarreau <[email protected]>
Cc: Simon Baatz <[email protected]>
Cc: Alan M Butler <[email protected]>
Cc: Nigel Roberts <[email protected]>
Cc: Valentin Longchamp <[email protected]>
Cc: Stefan Peter <[email protected]>
Cc: Arnaud Ebalard <[email protected]>
Cc: Nobuhiro Iwamatsu <[email protected]>
Cc: netdev at vger.kernel.org
Cc: devicetree-discuss at lists.ozlabs.org
Cc: linux-doc at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
--- arch/arm/mach-dove/board-dt.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
arch/arm/mach-dove/board-dt.c +0 -5
@@ -34,10 +34,6 @@ static void __init dove_legacy_clk_init(void) clkspec.np = np; clkspec.args_count =1 ; - clkspec.args[0 ] =CLOCK_GATING_BIT_GBE ; -orion_clkdev_add (NULL ,"mv643xx_eth_port.0" , -of_clk_get_from_provider (&clkspec)); - clkspec.args[0 ] =CLOCK_GATING_BIT_PCIE0 ;orion_clkdev_add ("0" ,"pcie" ,of_clk_get_from_provider (&clkspec));
@@ -70,7 +66,6 @@ static void __init dove_dt_init(void)dove_of_clk_init ();/* Internal devices not ported to DT yet */ -dove_ge00_init (&dove_dt_ge00_data);dove_pcie_init (1 ,1 );of_platform_populate (NULL , of_default_bus_match_table,NULL ,NULL );
Signature · 1 line
1.7.2.5
PATCH v3 4/7 ARM: dove: add gigabit ethernet and mvmdio device tree nodes
In reply to a message not in the archiveThis patch adds mv643xx_eth and mvmdio device tree nodes for DT enabled Dove boards. As there is only one ethernet controller on Dove, a default phy node is also added with a note to overwrite its reg property on a per-board basis.
---
Cc: Grant Likely <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Rob Landley <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: David Miller <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Arnaud Patard <[email protected]>
Cc: Russell King <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Jean-Francois Moine <[email protected]>
Cc: Thomas Petazzoni <[email protected]>
Cc: Simon Guinot <[email protected]>
Cc: Jamie Lentin <[email protected]>
Cc: Michael Walle <[email protected]>
Cc: Eric Hutter <[email protected]>
Cc: Joshua Coombs <[email protected]>
Cc: Willy Tarreau <[email protected]>
Cc: Simon Baatz <[email protected]>
Cc: Alan M Butler <[email protected]>
Cc: Nigel Roberts <[email protected]>
Cc: Valentin Longchamp <[email protected]>
Cc: Stefan Peter <[email protected]>
Cc: Arnaud Ebalard <[email protected]>
Cc: Nobuhiro Iwamatsu <[email protected]>
Cc: netdev at vger.kernel.org
Cc: devicetree-discuss at lists.ozlabs.org
Cc: linux-doc at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
--- arch/arm/boot/dts/dove-cubox.dts | 8 ++++++++ arch/arm/boot/dts/dove.dtsi | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 0 deletions(-)
arch/arm/boot/dts/dove-cubox.dts +8 -0
@@ -49,6 +49,14 @@ &uart0 { status = "okay"; }; &sata0 { status = "okay"; }; &i2c0 { status = "okay"; }; +&mdio { status = "okay"; }; +ð { status = "okay"; }; +ð0 { status = "okay"; }; + +ðphy { + compatible = "marvell,88e1310"; + reg = <1>; +}; &sdio0 { status = "okay";
arch/arm/boot/dts/dove.dtsi +35 -0
@@ -258,5 +258,40 @@ dmacap,xor; }; }; + + mdio: mdio-bus at 72004 { + compatible = "marvell,orion-mdio"; + reg = <0x72004 0x84>; + interrupts = <30>; + clocks = <&gate_clk 2>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + ethphy: ethernet-phy { + device_type = "ethernet-phy"; + /* overwrite reg property in board file */ + }; + }; + + eth: ethernet-controller at 72000 { + compatible = "marvell,mv643xx-eth-block"; + reg = <0x72000 0x4000>; + clocks = <&gate_clk 2>; + #address-cells = <1>; + #size-cells = <0>; + tx-csum-limit = <1600>; + status = "disabled"; + + eth0: ethernet-port at 0 { + compatible = "marvell,mv643xx-eth"; + device_type = "network"; + reg = <0>; + interrupts = <29>; + clocks = <&gate_clk 2>; + phy = <ðphy>; + status = "disabled"; + }; + }; }; };
Signature · 1 line
1.7.2.5
PATCH v3 5/7 ARM: kirkwood: remove legacy mv643xx_eth board setup
In reply to a message not in the archiveWith DT support for mv643xx_eth we do not need legacy platform_data based setup for DT enabled boards. This patch removes eth setup for all kirkwood DT board files.
---
Cc: Grant Likely <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Rob Landley <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: David Miller <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Arnaud Patard <[email protected]>
Cc: Russell King <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Jean-Francois Moine <[email protected]>
Cc: Thomas Petazzoni <[email protected]>
Cc: Simon Guinot <[email protected]>
Cc: Jamie Lentin <[email protected]>
Cc: Michael Walle <[email protected]>
Cc: Eric Hutter <[email protected]>
Cc: Joshua Coombs <[email protected]>
Cc: Willy Tarreau <[email protected]>
Cc: Simon Baatz <[email protected]>
Cc: Alan M Butler <[email protected]>
Cc: Nigel Roberts <[email protected]>
Cc: Valentin Longchamp <[email protected]>
Cc: Stefan Peter <[email protected]>
Cc: Arnaud Ebalard <[email protected]>
Cc: Nobuhiro Iwamatsu <[email protected]>
Cc: netdev at vger.kernel.org
Cc: devicetree-discuss at lists.ozlabs.org
Cc: linux-doc at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
--- arch/arm/mach-kirkwood/board-dnskw.c | 7 ------- arch/arm/mach-kirkwood/board-dockstar.c | 9 --------- arch/arm/mach-kirkwood/board-dreamplug.c | 14 -------------- arch/arm/mach-kirkwood/board-goflexnet.c | 9 --------- arch/arm/mach-kirkwood/board-guruplug.c | 14 -------------- arch/arm/mach-kirkwood/board-ib62x0.c | 9 --------- arch/arm/mach-kirkwood/board-iconnect.c | 6 ------ arch/arm/mach-kirkwood/board-iomega_ix2_200.c | 16 ---------------- arch/arm/mach-kirkwood/board-km_kirkwood.c | 7 ------- arch/arm/mach-kirkwood/board-lsxl.c | 12 ------------ arch/arm/mach-kirkwood/board-mplcec4.c | 11 ----------- arch/arm/mach-kirkwood/board-ns2.c | 13 ------------- arch/arm/mach-kirkwood/board-openblocks_a6.c | 9 --------- arch/arm/mach-kirkwood/board-readynas.c | 6 ------ arch/arm/mach-kirkwood/board-ts219.c | 13 ------------- arch/arm/mach-kirkwood/board-usi_topkick.c | 9 --------- 16 files changed, 0 insertions(+), 164 deletions(-)
arch/arm/mach-kirkwood/board-dnskw.c +0 -7
@@ -14,14 +14,9 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> -#include <linux/mv643xx_eth.h> #include <linux/gpio.h> #include "common.h" -static struct mv643xx_eth_platform_data dnskw_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (8 ), -}; -/* Register any GPIO for output and set the value */ static void __init dnskw_gpio_register (unsigned gpio,char *name,int def) {
@@ -36,8 +31,6 @@ static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)void __init dnskw_init (void ) { -kirkwood_ge00_init (&dnskw_ge00_data); -/* Set NAS to turn back on after a power failure */ dnskw_gpio_register (37 ,"dnskw:power:recover" ,1 ); }
arch/arm/mach-kirkwood/board-dockstar.c +0 -9
@@ -16,17 +16,8 @@#include <linux/kernel.h> #include <linux/init.h> -#include <linux/mv643xx_eth.h> #include "common.h" -static struct mv643xx_eth_platform_data dockstar_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; -void __init dockstar_dt_init (void ) { -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&dockstar_ge00_data); }
arch/arm/mach-kirkwood/board-dreamplug.c +0 -14
@@ -13,23 +13,9 @@#include <linux/kernel.h> #include <linux/init.h> -#include <linux/mv643xx_eth.h> #include <linux/gpio.h> #include "common.h" -static struct mv643xx_eth_platform_data dreamplug_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; - -static struct mv643xx_eth_platform_data dreamplug_ge01_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (1 ), -}; -void __init dreamplug_init (void ) { -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&dreamplug_ge00_data); -kirkwood_ge01_init (&dreamplug_ge01_data); }
arch/arm/mach-kirkwood/board-goflexnet.c +0 -9
@@ -18,17 +18,8 @@#include <linux/kernel.h> #include <linux/init.h> -#include <linux/mv643xx_eth.h> #include "common.h" -static struct mv643xx_eth_platform_data goflexnet_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; -void __init goflexnet_init (void ) { -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&goflexnet_ge00_data); }
arch/arm/mach-kirkwood/board-guruplug.c +0 -14
@@ -11,23 +11,9 @@#include <linux/kernel.h> #include <linux/init.h> -#include <linux/mv643xx_eth.h> #include <linux/gpio.h> #include "common.h" -static struct mv643xx_eth_platform_data guruplug_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; - -static struct mv643xx_eth_platform_data guruplug_ge01_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (1 ), -}; -void __init guruplug_dt_init (void ) { -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&guruplug_ge00_data); -kirkwood_ge01_init (&guruplug_ge01_data); }
arch/arm/mach-kirkwood/board-ib62x0.c +0 -9
@@ -13,17 +13,8 @@#include <linux/kernel.h> #include <linux/init.h> -#include <linux/mv643xx_eth.h> #include "common.h" -static struct mv643xx_eth_platform_data ib62x0_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (8 ), -}; -void __init ib62x0_init (void ) { -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&ib62x0_ge00_data); }
arch/arm/mach-kirkwood/board-iconnect.c +0 -6
@@ -11,16 +11,10 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/of.h> -#include <linux/mv643xx_eth.h> #include "common.h" -static struct mv643xx_eth_platform_data iconnect_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (11 ), -}; -void __init iconnect_init (void ) { -kirkwood_ge00_init (&iconnect_ge00_data); }static int __init iconnect_pci_init (void )
arch/arm/mach-kirkwood/board-iomega_ix2_200.c +0 -16
@@ -10,25 +10,9 @@#include <linux/kernel.h> #include <linux/init.h> -#include <linux/mv643xx_eth.h> #include <linux/ethtool.h> #include "common.h" -static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_NONE , - .speed =SPEED_1000 , - .duplex =DUPLEX_FULL , -}; - -static struct mv643xx_eth_platform_data iomega_ix2_200_ge01_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (11 ), -}; -void __init iomega_ix2_200_init (void ) { -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&iomega_ix2_200_ge00_data); -kirkwood_ge01_init (&iomega_ix2_200_ge01_data); }
arch/arm/mach-kirkwood/board-km_kirkwood.c +0 -7
@@ -14,15 +14,10 @@#include <linux/kernel.h> #include <linux/init.h> -#include <linux/mv643xx_eth.h> #include <linux/clk.h> #include <linux/clk-private.h> #include "common.h" -static struct mv643xx_eth_platform_data km_kirkwood_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; -void __init km_kirkwood_init (void ) {struct clk *sata_clk;
@@ -39,6 +34,4 @@ void __init km_kirkwood_init(void) sata_clk =clk_get_sys ("sata_mv.0" ,"1" );if (!IS_ERR (sata_clk)) sata_clk->flags |=CLK_IGNORE_UNUSED ; - -kirkwood_ge00_init (&km_kirkwood_ge00_data); }
arch/arm/mach-kirkwood/board-lsxl.c +0 -12
@@ -14,17 +14,8 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> -#include <linux/mv643xx_eth.h> #include "common.h" -static struct mv643xx_eth_platform_data lsxl_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; - -static struct mv643xx_eth_platform_data lsxl_ge01_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (8 ), -}; -/* * On the LS-XHL/LS-CHLv2, the shutdown process is following: * - Userland monitors key events until the power switch goes to off position
@@ -44,9 +35,6 @@ void __init lsxl_init(void)* Basic setup. Needs to be called early. */ -kirkwood_ge00_init (&lsxl_ge00_data); -kirkwood_ge01_init (&lsxl_ge01_data); -/* register power-off method */ pm_power_off = lsxl_power_off; }
arch/arm/mach-kirkwood/board-mplcec4.c +0 -11
@@ -11,24 +11,13 @@#include <linux/kernel.h> #include <linux/init.h> -#include <linux/mv643xx_eth.h> #include "common.h" -static struct mv643xx_eth_platform_data mplcec4_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (1 ), -}; - -static struct mv643xx_eth_platform_data mplcec4_ge01_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (2 ), -}; -void __init mplcec4_init (void ) {/* * Basic setup. Needs to be called early. */ -kirkwood_ge00_init (&mplcec4_ge00_data); -kirkwood_ge01_init (&mplcec4_ge01_data);kirkwood_pcie_init (KW_PCIE0 ); }
arch/arm/mach-kirkwood/board-ns2.c +0 -13
@@ -14,22 +14,9 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> -#include <linux/mv643xx_eth.h> #include <linux/of.h> #include "common.h" -static struct mv643xx_eth_platform_data ns2_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (8 ), -}; -void __init ns2_init (void ) { -/* -* Basic setup. Needs to be called early. -*/ -if (of_machine_is_compatible ("lacie,cloudbox" ) || -of_machine_is_compatible ("lacie,netspace_lite_v2" ) || -of_machine_is_compatible ("lacie,netspace_mini_v2" )) - ns2_ge00_data.phy_addr =MV643XX_ETH_PHY_ADDR (0 ); -kirkwood_ge00_init (&ns2_ge00_data); }
arch/arm/mach-kirkwood/board-openblocks_a6.c +0 -9
@@ -10,17 +10,8 @@#include <linux/kernel.h> #include <linux/init.h> -#include <linux/mv643xx_eth.h> #include "common.h" -static struct mv643xx_eth_platform_data openblocks_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; -void __init openblocks_a6_init (void ) { -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&openblocks_ge00_data); }
arch/arm/mach-kirkwood/board-readynas.c +0 -6
@@ -13,16 +13,10 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> -#include <linux/mv643xx_eth.h> #include <mach/kirkwood.h> #include "common.h" -static struct mv643xx_eth_platform_data netgear_readynas_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; -void __init netgear_readynas_init (void ) { -kirkwood_ge00_init (&netgear_readynas_ge00_data);kirkwood_pcie_init (KW_PCIE0 ); }
arch/arm/mach-kirkwood/board-ts219.c +0 -13
@@ -18,27 +18,14 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> -#include <linux/mv643xx_eth.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <mach/kirkwood.h> #include "common.h" #include "tsx1x-common.h" -static struct mv643xx_eth_platform_data qnap_ts219_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (8 ), -}; -void __init qnap_dt_ts219_init (void ) { -u32 dev, rev; - -kirkwood_pcie_id (&dev, &rev); -if (dev ==MV88F6282_DEV_ID ) - qnap_ts219_ge00_data.phy_addr =MV643XX_ETH_PHY_ADDR (0 ); - -kirkwood_ge00_init (&qnap_ts219_ge00_data); - pm_power_off = qnap_tsx1x_power_off; }
arch/arm/mach-kirkwood/board-usi_topkick.c +0 -9
@@ -12,18 +12,9 @@#include <linux/kernel.h> #include <linux/init.h> -#include <linux/mv643xx_eth.h> #include <linux/gpio.h> #include "common.h" -static struct mv643xx_eth_platform_data topkick_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; -void __init usi_topkick_init (void ) { -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&topkick_ge00_data); }
Signature · 1 line
1.7.2.5
A message that is not in the archive (sent off-list or not yet received): 1367854420-8006-6-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Re: [PATCH v3 5/7] ARM: kirkwood: remove legacy mv643xx_eth board setup
Dear Sebastian Hesselbarth,
Quoted 5 lines · Sebastian Hesselbarth
With DT support for
mv643xx_ethwe do not need legacyplatform_databased setup for DT enabled boards. This patch removes eth setup for all kirkwood DT board files.
Quoted 16 lines
arch/arm/mach-kirkwood/board-dnskw.c | 7 ------- arch/arm/mach-kirkwood/board-dockstar.c | 9 --------- arch/arm/mach-kirkwood/board-dreamplug.c | 14 -------------- arch/arm/mach-kirkwood/board-goflexnet.c | 9 --------- arch/arm/mach-kirkwood/board-guruplug.c | 14 -------------- arch/arm/mach-kirkwood/board-ib62x0.c | 9 --------- arch/arm/mach-kirkwood/board-iconnect.c | 6 ------ arch/arm/mach-kirkwood/board-iomega_ix2_200.c | 16 ---------------- arch/arm/mach-kirkwood/board-km_kirkwood.c | 7 ------- arch/arm/mach-kirkwood/board-lsxl.c | 12 ------------ arch/arm/mach-kirkwood/board-mplcec4.c | 11 ----------- arch/arm/mach-kirkwood/board-ns2.c | 13 ------------- arch/arm/mach-kirkwood/board-openblocks_a6.c | 9 --------- arch/arm/mach-kirkwood/board-readynas.c | 6 ------ arch/arm/mach-kirkwood/board-ts219.c | 13 ------------- arch/arm/mach-kirkwood/board-usi_topkick.c | 9 ---------
I believe a good number of those files become empty once you've removed the registration of the Ethernet devices. Shouldn't such files be removed in this patch?
Thanks!
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v3 6/7 ARM: kirkwood: add gigabit ethernet and mvmdio device tree nodes
In reply to a message not in the archiveThis patch adds mv643xx_eth and mvmdio device tree nodes for DT enabled Kirkwood boards. Phy nodes are also added with reg property set on a per-board basis.
---
Cc: Grant Likely <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Rob Landley <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: David Miller <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Arnaud Patard <[email protected]>
Cc: Russell King <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Jean-Francois Moine <[email protected]>
Cc: Thomas Petazzoni <[email protected]>
Cc: Simon Guinot <[email protected]>
Cc: Jamie Lentin <[email protected]>
Cc: Michael Walle <[email protected]>
Cc: Eric Hutter <[email protected]>
Cc: Joshua Coombs <[email protected]>
Cc: Willy Tarreau <[email protected]>
Cc: Simon Baatz <[email protected]>
Cc: Alan M Butler <[email protected]>
Cc: Nigel Roberts <[email protected]>
Cc: Valentin Longchamp <[email protected]>
Cc: Stefan Peter <[email protected]>
Cc: Arnaud Ebalard <[email protected]>
Cc: Nobuhiro Iwamatsu <[email protected]>
Cc: netdev at vger.kernel.org
Cc: devicetree-discuss at lists.ozlabs.org
Cc: linux-doc at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
--- arch/arm/boot/dts/kirkwood-cloudbox.dts | 15 ++++++ arch/arm/boot/dts/kirkwood-dnskw.dtsi | 15 ++++++ arch/arm/boot/dts/kirkwood-dockstar.dts | 15 ++++++ arch/arm/boot/dts/kirkwood-dreamplug.dts | 26 ++++++++++ arch/arm/boot/dts/kirkwood-goflexnet.dts | 15 ++++++ .../arm/boot/dts/kirkwood-guruplug-server-plus.dts | 26 ++++++++++ arch/arm/boot/dts/kirkwood-ib62x0.dts | 15 ++++++ arch/arm/boot/dts/kirkwood-iconnect.dts | 15 ++++++ arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts | 22 ++++++++ arch/arm/boot/dts/kirkwood-is2.dts | 2 + arch/arm/boot/dts/kirkwood-km_kirkwood.dts | 15 ++++++ arch/arm/boot/dts/kirkwood-lsxl.dtsi | 26 ++++++++++ arch/arm/boot/dts/kirkwood-mplcec4.dts | 25 +++++++++ .../boot/dts/kirkwood-netgear_readynas_duo_v2.dts | 15 ++++++ arch/arm/boot/dts/kirkwood-ns2-common.dtsi | 15 ++++++ arch/arm/boot/dts/kirkwood-ns2.dts | 2 + arch/arm/boot/dts/kirkwood-ns2lite.dts | 2 + arch/arm/boot/dts/kirkwood-ns2max.dts | 2 + arch/arm/boot/dts/kirkwood-ns2mini.dts | 2 + arch/arm/boot/dts/kirkwood-openblocks_a6.dts | 15 ++++++ arch/arm/boot/dts/kirkwood-topkick.dts | 15 ++++++ arch/arm/boot/dts/kirkwood-ts219-6281.dts | 4 +- arch/arm/boot/dts/kirkwood-ts219-6282.dts | 4 +- arch/arm/boot/dts/kirkwood-ts219.dtsi | 15 ++++++ arch/arm/boot/dts/kirkwood.dtsi | 52 ++++++++++++++++++++ 25 files changed, 373 insertions(+), 2 deletions(-)
arch/arm/boot/dts/kirkwood-cloudbox.dts +15 -0
@@ -87,3 +87,18 @@ gpios = <&gpio0 17 0>; }; }; + +ð0 { status = "okay"; }; +&egiga0 { + status = "okay"; + phy = <ðphy0>; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; +};
arch/arm/boot/dts/kirkwood-dnskw.dtsi +15 -0
@@ -217,3 +217,18 @@ }; }; }; + +ð0 { status = "okay"; }; +&egiga0 { + status = "okay"; + phy = <ðphy0>; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 8 { + device_type = "ethernet-phy"; + reg = <8>; + }; +};
arch/arm/boot/dts/kirkwood-dockstar.dts +15 -0
@@ -91,3 +91,18 @@ }; }; }; + +ð0 { status = "okay"; }; +&egiga0 { + status = "okay"; + phy = <ðphy0>; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; +};
arch/arm/boot/dts/kirkwood-dreamplug.dts +26 -0
@@ -99,3 +99,29 @@ }; }; }; + +ð0 { status = "okay"; }; +&egiga0 { + status = "okay"; + phy = <ðphy0>; +}; + +ð1 { status = "okay"; }; +&egiga1 { + status = "okay"; + phy = <ðphy1>; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; + + ethphy1: ethernet-phy at 1 { + device_type = "ethernet-phy"; + reg = <1>; + }; +};
arch/arm/boot/dts/kirkwood-goflexnet.dts +15 -0
@@ -170,3 +170,18 @@ }; }; }; + +ð0 { status = "okay"; }; +&egiga0 { + status = "okay"; + phy = <ðphy0>; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; +};
arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts +26 -0
@@ -96,3 +96,29 @@ }; }; }; + +ð0 { status = "okay"; }; +&egiga0 { + status = "okay"; + phy = <ðphy0>; +}; + +ð1 { status = "okay"; }; +&egiga1 { + status = "okay"; + phy = <ðphy1>; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; + + ethphy1: ethernet-phy at 1 { + device_type = "ethernet-phy"; + reg = <1>; + }; +};
arch/arm/boot/dts/kirkwood-ib62x0.dts +15 -0
@@ -119,3 +119,18 @@ }; + +ð0 { status = "okay"; }; +&egiga0 { + status = "okay"; + phy = <ðphy0>; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 8 { + device_type = "ethernet-phy"; + reg = <8>; + }; +};
arch/arm/boot/dts/kirkwood-iconnect.dts +15 -0
@@ -168,3 +168,18 @@ }; }; }; + +ð0 { status = "okay"; }; +&egiga0 { + status = "okay"; + phy = <ðphy0>; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 11 { + device_type = "ethernet-phy"; + reg = <11>; + }; +};
arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts +22 -0
@@ -191,3 +191,25 @@ }; }; }; + +ð0 { status = "okay"; }; +&egiga0 { + status = "okay"; + speed = <1000>; + duplex = <1>; +}; + +ð1 { status = "okay"; }; +&egiga1 { + status = "okay"; + phy = <ðphy1>; +}; + +&mdio { + status = "okay"; + + ethphy1: ethernet-phy at 11 { + device_type = "ethernet-phy"; + reg = <11>; + }; +};
arch/arm/boot/dts/kirkwood-is2.dts +2 -0
@@ -28,3 +28,5 @@ }; }; }; + +ðphy0 { reg = <8>; };
arch/arm/boot/dts/kirkwood-km_kirkwood.dts +15 -0
@@ -43,3 +43,18 @@ }; }; }; + +ð0 { status = "okay"; }; +&egiga0 { + status = "okay"; + phy = <ðphy0>; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; +};
arch/arm/boot/dts/kirkwood-lsxl.dtsi +26 -0
@@ -201,3 +201,29 @@ }; }; }; + +ð0 { status = "okay"; }; +&egiga0 { + status = "okay"; + phy = <ðphy0>; +}; + +ð1 { status = "okay"; }; +&egiga1 { + status = "okay"; + phy = <ðphy1>; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; + + ethphy1: ethernet-phy at 8 { + device_type = "ethernet-phy"; + reg = <8>; + }; +};
arch/arm/boot/dts/kirkwood-mplcec4.dts +25 -0
@@ -182,3 +182,28 @@ }; }; +ð0 { status = "okay"; }; +&egiga0 { + status = "okay"; + phy = <ðphy0>; +}; + +ð1 { status = "okay"; }; +&egiga1 { + status = "okay"; + phy = <ðphy1>; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 1 { + device_type = "ethernet-phy"; + reg = <1>; + }; + + ethphy1: ethernet-phy at 2 { + device_type = "ethernet-phy"; + reg = <2>; + }; +};
arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts +15 -0
@@ -178,3 +178,18 @@ }; }; }; + +ð0 { status = "okay"; }; +&egiga0 { + status = "okay"; + phy = <ðphy0>; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; +};
arch/arm/boot/dts/kirkwood-ns2-common.dtsi +15 -0
@@ -82,3 +82,18 @@ }; }; + +ð0 { status = "okay"; }; +&egiga0 { + status = "okay"; + phy = <ðphy0>; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy { + device_type = "ethernet-phy"; + /* overwrite reg property in board file */ + }; +};
arch/arm/boot/dts/kirkwood-ns2.dts +2 -0
@@ -28,3 +28,5 @@ }; }; }; + +ðphy0 { reg = <8>; };
arch/arm/boot/dts/kirkwood-ns2lite.dts +2 -0
@@ -28,3 +28,5 @@ }; }; }; + +ðphy0 { reg = <0>; };
arch/arm/boot/dts/kirkwood-ns2max.dts +2 -0
@@ -47,3 +47,5 @@ }; }; }; + +ðphy0 { reg = <8>; };
arch/arm/boot/dts/kirkwood-ns2mini.dts +2 -0
@@ -48,3 +48,5 @@ }; }; }; + +ðphy0 { reg = <0>; };
arch/arm/boot/dts/kirkwood-openblocks_a6.dts +15 -0
@@ -210,3 +210,18 @@ }; }; }; + +ð0 { status = "okay"; }; +&egiga0 { + status = "okay"; + phy = <ðphy0>; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; +};
arch/arm/boot/dts/kirkwood-topkick.dts +15 -0
@@ -201,3 +201,18 @@ }; }; }; + +ð0 { status = "okay"; }; +&egiga0 { + status = "okay"; + phy = <ðphy0>; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; +};
arch/arm/boot/dts/kirkwood-ts219-6281.dts +3 -1
@@ -49,4 +49,6 @@ gpios = <&gpio0 16 1>; }; }; -}; +}; + +ðphy0 { reg = <8>; };
arch/arm/boot/dts/kirkwood-ts219-6282.dts +3 -1
@@ -49,4 +49,6 @@ gpios = <&gpio1 5 1>; }; }; -}; +}; + +ðphy0 { reg = <8>; };
arch/arm/boot/dts/kirkwood-ts219.dtsi +15 -0
@@ -76,3 +76,18 @@ }; }; }; + +ð0 { status = "okay"; }; +&egiga0 { + status = "okay"; + phy = <ðphy0>; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy { + device_type = "ethernet-phy"; + /* overwrite reg property in board file */ + }; +};
arch/arm/boot/dts/kirkwood.dtsi +52 -0
57 lines not on this page · raw message
Signature · 1 line
1.7.2.5
Re: [PATCH v3 6/7] ARM: kirkwood: add gigabit ethernet and mvmdio device tree nodes
Hi Sebastian,
Quoted 3 lines · Sebastian Hesselbarth
This patch adds
mv643xx_ethand mvmdio device tree nodes for DT enabled Kirkwood boards. Phy nodes are also added with reg property set on a per-board basis.
...
arch/arm/boot/dts/kirkwood.dtsi line 209
Quoted 13 lines
arch/arm/boot/dts/kirkwood.dtsi +5
-0@@ -202,5 +202,57 @@ clocks = <&gate_clk 4>; status = "disabled"; }; + + mdio: mdio-bus at 72004 { + compatible = "marvell,orion-mdio"; + reg = <0x72004 0x84>; + interrupts = <11>;
Shouldn't this be 46?
- Simon
Sebastian Hesselbarth
maintainerRe: [PATCH v3 6/7] ARM: kirkwood: add gigabit ethernet and mvmdio device tree nodes
Quoted 7 lines · Simon Baatz
Hi Sebastian,
Quoted 3 lines · Sebastian Hesselbarth
This patch adds
mv643xx_ethand mvmdio device tree nodes for DT enabled Kirkwood boards. Phy nodes are also added with reg property set on a per-board basis....
Quoted 15 lines
arch/arm/boot/dts/kirkwood.dtsi line 209
Quoted 13 lines
arch/arm/boot/dts/kirkwood.dtsi +5
-0@@ -202,5 +202,57 @@ clocks =<&gate_clk 4>; status = "disabled"; }; + + mdio: mdio-bus at 72004 { + compatible = "marvell,orion-mdio"; + reg =<0x72004 0x84>; + interrupts =<11>;Shouldn't this be 46?
Yes, mdio is using GbE0Err interrupt and that is 14 on IRQ HIGH CAUSE. I was misled by 11 on IRQ LOW CAUSE.
Sebastian
PATCH v3 7/7 ARM: kirkwood: remove legacy clk alias for mv643xx_eth
In reply to a message not in the archiveWith all boards converted to DT enabled mv643xx_eth we can now remove the clock alias for gbe clocks.
---
Cc: Grant Likely <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Rob Landley <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: David Miller <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Arnaud Patard <[email protected]>
Cc: Russell King <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Jean-Francois Moine <[email protected]>
Cc: Thomas Petazzoni <[email protected]>
Cc: Simon Guinot <[email protected]>
Cc: Jamie Lentin <[email protected]>
Cc: Michael Walle <[email protected]>
Cc: Eric Hutter <[email protected]>
Cc: Joshua Coombs <[email protected]>
Cc: Willy Tarreau <[email protected]>
Cc: Simon Baatz <[email protected]>
Cc: Alan M Butler <[email protected]>
Cc: Nigel Roberts <[email protected]>
Cc: Valentin Longchamp <[email protected]>
Cc: Stefan Peter <[email protected]>
Cc: Arnaud Ebalard <[email protected]>
Cc: Nobuhiro Iwamatsu <[email protected]>
Cc: netdev at vger.kernel.org
Cc: devicetree-discuss at lists.ozlabs.org
Cc: linux-doc at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
--- arch/arm/mach-kirkwood/board-dt.c | 16 ---------------- 1 files changed, 0 insertions(+), 16 deletions(-)
arch/arm/mach-kirkwood/board-dt.c +0 -16
@@ -42,7 +42,6 @@ static void __init kirkwood_legacy_clk_init(void)struct device_node *np =of_find_compatible_node (NULL ,NULL ,"marvell,kirkwood-gating-clock" );struct of_phandle_args clkspec; -struct clk *clk; clkspec.np = np; clkspec.args_count =1 ;
@@ -58,21 +57,6 @@ static void __init kirkwood_legacy_clk_init(void) clkspec.args[0 ] =CGC_BIT_SDIO ;orion_clkdev_add (NULL ,"mvsdio" ,of_clk_get_from_provider (&clkspec)); - -/* -* The ethernet interfaces forget the MAC address assigned by -* u-boot if the clocks are turned off. Until proper DT support -* is available we always enable them for now. -*/ - clkspec.args[0 ] =CGC_BIT_GE0 ; - clk =of_clk_get_from_provider (&clkspec); -orion_clkdev_add (NULL ,"mv643xx_eth_port.0" , clk); -clk_prepare_enable (clk); - - clkspec.args[0 ] =CGC_BIT_GE1 ; - clk =of_clk_get_from_provider (&clkspec); -orion_clkdev_add (NULL ,"mv643xx_eth_port.1" , clk); -clk_prepare_enable (clk); }static void __init kirkwood_of_clk_init (void )
Signature · 1 line
1.7.2.5
Sebastian,
Thanks for picking this up! A few comments about merging strategy:
Quoted 7 lines · Sebastian Hesselbarth
This patch set picks up work by Florian Fainelli bringing full DT support to
mv643xx_ethand Marvell SoCs using it.The current patch set drops Florian's device tree conversions for Kirkwood, Dove, and Orion5x in favour of split patches for board files and board descriptor files.
Quoted 6 lines
Device tree conversion for Dove and Kirkwood is added. Dove has been fully tested, while Kirkwood is compile-tested only.
Florian Fainelli (2):
net:mv643xx_eth: add Device Tree bindings
net:mv643xx_eth: update Device Tree bindings documentation
Obviously, these will go through -net once the submission window opens.
Quoted 1 line
Sebastian Hesselbarth (5):
(reordered for clarity)
Quoted 3 lines
ARM: dove: remove legacy
mv643xx_ethsetup
ARM: kirkwood: remove legacymv643xx_ethboard setup
ARM: kirkwood: remove legacy clk alias formv643xx_eth
mvebu/boards or /soc.
Quoted 2 lines
ARM: kirkwood: add gigabit ethernet and mvmdio device tree nodes
ARM: dove: add gigabit ethernet and mvmdio device tree nodes
mvebu/dt
mvebu/dt and -net are fine. They have no dependencies. The problem is mvebu/boards. To boot with networking, it needs -net *and* mvebu/dt. Otherwise, the board needs to do legacy init.
I'd like to attempt to remove this dependency-hell with code. eg some quick pseudo-code:
if (!dt_node_present("marvell,mv643xx_eth") ||
!mvebu_dt_bindings_present())
kirkwood_ge00_init();The advantages of figuring this out are:
- *no* branch dependencies
- whole conversion done in one merge window
The drawbacks:
- need to remember to do a follow-on patch if all branches are successfuly merged, removing the unneeded logic (after -rc1)
- considered churn?
The easy answer is to merge mvebu/dt, and -net, wait one cycle, and merge the board stuff as you have it now (with Thomas' comment).
If we can figure this out, I'd like to do the same for the kirkwood-pcie series.
thoughts?
thx,
Jason.
A message that is not in the archive (sent off-list or not yet received): 20130506160743.GV31290-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org
Quoted 56 lines · Jason Cooper
Sebastian,
Thanks for picking this up! A few comments about merging strategy:
Quoted 7 lines · Sebastian Hesselbarth
This patch set picks up work by Florian Fainelli bringing full DT support to
mv643xx_ethand Marvell SoCs using it.The current patch set drops Florian's device tree conversions for Kirkwood, Dove, and Orion5x in favour of split patches for board files and board descriptor files.
Quoted 6 lines
Device tree conversion for Dove and Kirkwood is added. Dove has been fully tested, while Kirkwood is compile-tested only.
Florian Fainelli (2):
net:mv643xx_eth: add Device Tree bindings
net:mv643xx_eth: update Device Tree bindings documentationObviously, these will go through -net once the submission window opens.
Quoted 1 line
Sebastian Hesselbarth (5):
(reordered for clarity)
Quoted 3 lines
ARM: dove: remove legacy
mv643xx_ethsetup
ARM: kirkwood: remove legacymv643xx_ethboard setup
ARM: kirkwood: remove legacy clk alias formv643xx_ethmvebu/boards or /soc.
Quoted 2 lines
ARM: kirkwood: add gigabit ethernet and mvmdio device tree nodes
ARM: dove: add gigabit ethernet and mvmdio device tree nodesmvebu/dt
mvebu/dt and -net are fine. They have no dependencies. The problem is mvebu/boards. To boot with networking, it needs -net *and* mvebu/dt. Otherwise, the board needs to do legacy init.
I'd like to attempt to remove this dependency-hell with code. eg some quick pseudo-code:
if (!dt_node_present("marvell,mv643xx_eth") || !mvebu_dt_bindings_present()) kirkwood_ge00_init();The advantages of figuring this out are:
- *no* branch dependencies
- whole conversion done in one merge windowThe drawbacks:
- need to remember to do a follow-on patch if all branches are successfuly merged, removing the unneeded logic (after -rc1)
- considered churn?
Quoted 5 lines
The easy answer is to merge mvebu/dt, and -net, wait one cycle, and merge the board stuff as you have it now (with Thomas' comment).
If we can figure this out, I'd like to do the same for the kirkwood-pcie series.
Jason,
I suggest to take the "easy answer", i.e. merge mvebu/dt and -net and take all board merges one cycle later.
Waiting for -net will stall irqchip but will give us enough time to add DT timer and get rid of any legacy init code introduced for irqchip. Also orion5x and mv78x00 can be added to mv643xx_eth conversion.
I am preparing empty board files removal as Thomas suggested.
Sebastian
P.S.: I was hoping that adding all people scripts/get_maintainers.pl throws out, will notice all kirkwood board users ever committed to mainline kernel. But as David Miller pointed out, it will not go through SPAM filters that way. So have an eye open for v4 on mailing lists as soon as -net merge window re-opens.
David Miller
maintainerTwo things:
1) None of your postings make the mailing lists because your CC: line is too large, and we block large ones because those are %99 of SPAM.
It really isn't reasonable to CC: so many people, and I do understand that you're just sifting email addresses from MAINTAINERS or whatever, but just use the appropriate mailing lists and the absolute most direct developer(s). Probably just the person who you believe should apply this patch.
2) Networking feature patch submissions are closed, as per:
http://marc.info/?l=linux-netdev&m=136730964130303&w=2
Therefore please resubmit this after the merge window is closed and I have explicitly announced that the net-next tree is open again for submissions.
Thanks.
Sebastian,
Quoted 14 lines · Sebastian Hesselbarth
This patch set picks up work by Florian Fainelli bringing full DT support to
mv643xx_ethand Marvell SoCs using it.The current patch set drops Florian's device tree conversions for Kirkwood, Dove, and Orion5x in favour of split patches for board files and board descriptor files.
Device tree conversion for Dove and Kirkwood is added. Dove has been fully tested, while Kirkwood is compile-tested only.
Florian Fainelli (2):
net:mv643xx_eth: add Device Tree bindings
net:mv643xx_eth: update Device Tree bindings documentation
Quoted 7 lines
Sebastian Hesselbarth (5):
ARM: dove: remove legacymv643xx_ethsetup
ARM: dove: add gigabit ethernet and mvmdio device tree nodes
ARM: kirkwood: remove legacymv643xx_ethboard setup
ARM: kirkwood: add gigabit ethernet and mvmdio device tree nodes
ARM: kirkwood: remove legacy clk alias formv643xx_eth
I have successfully tested these patches on km_kirkwood, you can add my tested-by:
Sebastian Hesselbarth
maintainerv4 cover net: mv643xx_eth DT support and fixes
In reply to Sebastian HesselbarthThis patch set picks up work by Florian Fainelli bringing full DT support to mv643xx_eth and Marvell SoCs using it.
The current v4 patch set drops 1:1 compatibiliy with PPC binding for two reasons:
(a) PPC parses DT nodes in arch/ppc/sysdev and creates non-DT platform_devices itself,
(b) property and node naming for new ethernet devices is slightly different ("phy" vs "phy-handle", "marvell," prefix)
Anyway, the two bindings are functionally compatible and PPC bindings can be converted if desireable. The patch set if fully bisectable and care has been taken to (a) not reparse on PPC platforms, (b) allow to use platform_device based registration even if on CONFIG_OF. Not tested is double registration issues, i.e. if DT nodes are provided but legacy registration it not yet removed. This double registration should lead to either non-DT or DT registered device fail on already claimed ressources.
Also this patch set picks up the opportunity to fix some repeatedly reported issues with modular mvmdio/mv643xx_eth loading, unloading, and reloading. It has been tested on SolidRun CuBox (Dove) and Seagate Dockstar (Kirkwood) so far.
Patch 1 fixes an issue introduced with switch to separate mvmdio driver, where detaching mv643xx_eth from a phy will not stop the phy state machine and finally dereference the already removed network device. Using phy_disconnect properly stops the phy state machine before detaching from it. Perhaps, this patch should go back in stable (most likely 3.9 only) if mvmdio separation patch went in there.
Patch 2 makes use of managed devm_ioremap for the last remaining non-managed resource.
Patches 3-4 prepare DT support for mv643xx_eth by adding a phy_node pointer to platform_data and exploiting that phy_node when attaching to a phy.
Patch 5 introduces DT parsing support for mv643xx_eth by adding a match table to the shared driver and adding a platform_device for each of its child nodes.
Patches 6-8 add corresponding device tree nodes to Marvell Dove, Kirkwood, and Orion5x including all boards. Where known, also the PHY compatible string has been set to what is reported in the boards boot loader.
Patches 9, 10-11, and 12 finally remove all legacy platform_device based registration from Dove, Kirkwood, and Orion5x DT setup. For Kirkwood also now obsolete board specific setup is removed from common DT board setup, Kconfig, Makefile, and kirkwood_defconfig.
For the patches above I suggest to take Patches 1-5 through David Miller's branch, and Patches 6-12 through Jason Cooper's when they have appeared on mainline linux. The patch set has been based on todays net-next, if I shall rebase them on any other branch please name it.
Sebastian Hesselbarth (12):
net: mv643xx_eth: use phy_disconnect instead of phy_detach
net: mv643xx_eth: use managed devm_ioremap for port registers
net: mv643xx_eth: add phy_node to platform_data struct
net: mv643xx_eth: use of_phy_connect if phy_node present
net: mv643xx_eth: add DT parsing support
ARM: dove: add gigabit ethernet and mvmdio device tree nodes
ARM: kirkwood: add gigabit ethernet and mvmdio device tree nodes
ARM: orion5x: add gigabit ethernet and mvmdio device tree nodes
ARM: dove: remove legacy mv643xx_eth setup
ARM: kirkwood: remove legacy clk alias for mv643xx_eth
ARM: kirkwood: remove redundant DT board files
ARM: orion5x: remove legacy mv643xx_eth board setup
.../devicetree/bindings/net/marvell-orion-net.txt | 83 +++++++++ arch/arm/boot/dts/dove-cubox.dts | 7 + arch/arm/boot/dts/dove.dtsi | 35 ++++ arch/arm/boot/dts/kirkwood-cloudbox.dts | 16 ++ arch/arm/boot/dts/kirkwood-dnskw.dtsi | 16 ++ arch/arm/boot/dts/kirkwood-dockstar.dts | 17 ++ arch/arm/boot/dts/kirkwood-dreamplug.dts | 28 +++ arch/arm/boot/dts/kirkwood-goflexnet.dts | 16 ++ .../arm/boot/dts/kirkwood-guruplug-server-plus.dts | 30 ++++ arch/arm/boot/dts/kirkwood-ib62x0.dts | 16 ++ arch/arm/boot/dts/kirkwood-iconnect.dts | 16 ++ arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts | 24 +++ arch/arm/boot/dts/kirkwood-is2.dts | 2 + arch/arm/boot/dts/kirkwood-km_kirkwood.dts | 16 ++ arch/arm/boot/dts/kirkwood-lsxl.dtsi | 28 +++ arch/arm/boot/dts/kirkwood-mplcec4.dts | 27 +++ .../boot/dts/kirkwood-netgear_readynas_duo_v2.dts | 16 ++ arch/arm/boot/dts/kirkwood-ns2-common.dtsi | 16 ++ arch/arm/boot/dts/kirkwood-ns2.dts | 2 + arch/arm/boot/dts/kirkwood-ns2lite.dts | 2 + arch/arm/boot/dts/kirkwood-ns2max.dts | 2 + arch/arm/boot/dts/kirkwood-ns2mini.dts | 2 + arch/arm/boot/dts/kirkwood-openblocks_a6.dts | 16 ++ arch/arm/boot/dts/kirkwood-topkick.dts | 16 ++ arch/arm/boot/dts/kirkwood-ts219-6281.dts | 4 +- arch/arm/boot/dts/kirkwood-ts219-6282.dts | 4 +- arch/arm/boot/dts/kirkwood-ts219.dtsi | 16 ++ arch/arm/boot/dts/kirkwood.dtsi | 52 ++++++ .../dts/orion5x-lacie-ethernet-disk-mini-v2.dts | 17 ++ arch/arm/boot/dts/orion5x.dtsi | 29 ++++ arch/arm/configs/kirkwood_defconfig | 16 -- arch/arm/mach-dove/board-dt.c | 9 - arch/arm/mach-kirkwood/Kconfig | 117 ------------- arch/arm/mach-kirkwood/Makefile | 16 -- arch/arm/mach-kirkwood/board-dnskw.c | 7 - arch/arm/mach-kirkwood/board-dockstar.c | 32 ---- arch/arm/mach-kirkwood/board-dreamplug.c | 35 ---- arch/arm/mach-kirkwood/board-dt.c | 40 ----- arch/arm/mach-kirkwood/board-goflexnet.c | 34 ---- arch/arm/mach-kirkwood/board-guruplug.c | 33 ---- arch/arm/mach-kirkwood/board-ib62x0.c | 29 ---- arch/arm/mach-kirkwood/board-iconnect.c | 10 -- arch/arm/mach-kirkwood/board-iomega_ix2_200.c | 34 ---- arch/arm/mach-kirkwood/board-km_kirkwood.c | 44 ----- arch/arm/mach-kirkwood/board-lsxl.c | 16 -- arch/arm/mach-kirkwood/board-mplcec4.c | 14 -- arch/arm/mach-kirkwood/board-ns2.c | 35 ---- arch/arm/mach-kirkwood/board-openblocks_a6.c | 26 --- arch/arm/mach-kirkwood/board-readynas.c | 6 - arch/arm/mach-kirkwood/board-ts219.c | 13 -- arch/arm/mach-kirkwood/board-usi_topkick.c | 29 ---- arch/arm/mach-orion5x/edmini_v2-setup.c | 10 -- drivers/net/ethernet/marvell/mv643xx_eth.c | 182 ++++++++++++++++++-- include/linux/mv643xx_eth.h | 2 + 54 files changed, 739 insertions(+), 621 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/marvell-orion-net.txt delete mode 100644 arch/arm/mach-kirkwood/board-dockstar.c delete mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c delete mode 100644 arch/arm/mach-kirkwood/board-goflexnet.c delete mode 100644 arch/arm/mach-kirkwood/board-guruplug.c delete mode 100644 arch/arm/mach-kirkwood/board-ib62x0.c delete mode 100644 arch/arm/mach-kirkwood/board-iomega_ix2_200.c delete mode 100644 arch/arm/mach-kirkwood/board-km_kirkwood.c delete mode 100644 arch/arm/mach-kirkwood/board-ns2.c delete mode 100644 arch/arm/mach-kirkwood/board-openblocks_a6.c delete mode 100644 arch/arm/mach-kirkwood/board-usi_topkick.c
---
Cc: David Miller <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: netdev at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-kernel at vger.kernel.org
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH v4 1/12 net: mv643xx_eth: use phy_disconnect instead of phy_detach
Using a separated mdio bus driver with mvmdio, phy_detach on network device removal will not stop the phy and finally lead to NULL pointer dereference in mvmdio due to non-existent network device. Use phy_disconnect instead to properly stop phy device from accessing network device prior removal of the network device.
---
Note: I observed this behavior when removing a modular mv643xx_eth driver after attaching it to a phy handled by (also modular) mvmdio. The mvmdio conversion has been done in
commit c3a07134e6aa5b93a37f72ffa3d11fadf72bf757
("mv643xx_eth: convert to use the Marvell Orion MDIO driver")
and should go back any -stable version with that commit (propably only 3.9)
@David: I am not sure if the above description is sufficient for a -stable patch, if you need more, like actual kernel failure, I am sure I can reproduce it.
--- drivers/net/ethernet/marvell/mv643xx_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/mv643xx_eth.c +1 -1
@@ -2805,7 +2805,7 @@ static int mv643xx_eth_remove(struct platform_device *pdev)unregister_netdev (mp->dev);if (mp->phy !=NULL ) -phy_detach (mp->phy); +phy_disconnect (mp->phy);cancel_work_sync (&mp->tx_timeout_task);if (!IS_ERR (mp->clk))
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH v4 2/12 net: mv643xx_eth: use managed devm_ioremap for port registers
In reply to Sebastian HesselbarthMake use of managed devm_ioremap and remove corresponding iounmap.
---
Cc: David Miller <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: netdev at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-kernel at vger.kernel.org
--- drivers/net/ethernet/marvell/mv643xx_eth.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/marvell/mv643xx_eth.c +1 -2
@@ -2470,7 +2470,7 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)if (msp ==NULL )return -ENOMEM ; - msp->base =ioremap (res->start,resource_size (res)); + msp->base =devm_ioremap (&pdev->dev, res->start,resource_size (res));if (msp->base ==NULL )return -ENOMEM ;
@@ -2498,7 +2498,6 @@ static int mv643xx_eth_shared_remove(struct platform_device *pdev) {struct mv643xx_eth_shared_private *msp =platform_get_drvdata (pdev); -iounmap (msp->base);if (!IS_ERR (msp->clk))clk_disable_unprepare (msp->clk);
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH v4 3/12 net: mv643xx_eth: add phy_node to platform_data struct
In reply to Sebastian HesselbarthThis adds a struct device_node pointer for a phy passed by phandle to mv643xx_eth node.
---
Cc: David Miller <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: netdev at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-kernel at vger.kernel.org
--- include/linux/mv643xx_eth.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/mv643xx_eth.h +2 -0
@@ -30,6 +30,7 @@ struct mv643xx_eth_shared_platform_data {#define MV643XX_ETH_PHY_ADDR (x) (0x80 | (x))#define MV643XX_ETH_PHY_NONE 0xff +struct device_node ;struct mv643xx_eth_platform_data {/* * Pointer back to our parent instance, and our port number.
@@ -41,6 +42,7 @@ struct mv643xx_eth_platform_data {* Whether a PHY is present, and if yes, at which address. */ int phy_addr; +struct device_node *phy_node;/* * Use this MAC address if it is valid, overriding the
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH v4 4/12 net: mv643xx_eth: use of_phy_connect if phy_node present
In reply to Sebastian HesselbarthThis connects to a phy node passed to the port device instead of probing the phy by phy_addr.
---
Cc: David Miller <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: netdev at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-kernel at vger.kernel.org
--- drivers/net/ethernet/marvell/mv643xx_eth.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-)
drivers/net/ethernet/marvell/mv643xx_eth.c +18 -7
@@ -60,6 +60,7 @@#include <linux/types.h> #include <linux/slab.h> #include <linux/clk.h> +#include <linux/of_mdio.h> static char mv643xx_eth_driver_name[] ="mv643xx_eth" ;static char mv643xx_eth_driver_version[] ="1.4" ;
@@ -2715,17 +2716,27 @@ static int mv643xx_eth_probe(struct platform_device *pdev)netif_set_real_num_tx_queues (dev, mp->txq_count);netif_set_real_num_rx_queues (dev, mp->rxq_count); -if (pd->phy_addr !=MV643XX_ETH_PHY_NONE ) { + err =0 ; +if (pd->phy_node) { + mp->phy =of_phy_connect (mp->dev, pd->phy_node, + mv643xx_eth_adjust_link,0 , +PHY_INTERFACE_MODE_GMII ); +if (!mp->phy) + err = -ENODEV ; + }else if (pd->phy_addr !=MV643XX_ETH_PHY_NONE ) { mp->phy =phy_scan (mp, pd->phy_addr); -if (IS_ERR (mp->phy)) { +if (IS_ERR (mp->phy)) err =PTR_ERR (mp->phy); -if (err == -ENODEV ) - err = -EPROBE_DEFER ; - goto out; - } -phy_init (mp, pd->speed, pd->duplex); +else +phy_init (mp, pd->speed, pd->duplex); } +if (err == -ENODEV ) { + err = -EPROBE_DEFER ; + goto out; + } +if (err) + goto out;SET_ETHTOOL_OPS (dev, &mv643xx_eth_ethtool_ops);
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH v4 5/12 net: mv643xx_eth: add DT parsing support
In reply to Sebastian HesselbarthThis adds device tree parsing support for the shared driver of mv643xx_eth. As the bindings are slightly different from current PPC bindings new binding documentation is also added. Following PPC-style device setup, the shared driver now also adds port platform_devices and sets up port platform_data.
---
Note: Although different, device tree bindings are compatible with PPC bindings. As I do not have access to any PPC platform using mv643xx_eth, I leave conversion ("phy" vs "phy-handle") and compatible string name up to PPC guys.
Due to hang reports for modular built mvmdio and mv643xx_eth, I have tested module loading/unloading/reloading on CuBox (Dove) and Dockstar (Kirkwood) without any issues for the whole patch set.
Changelog:v3->v4:
- separation of independent patches (phy, of_mdio, devm)
- stand-alone device tree binding compatible to existing mv64x60 binding
- device node match for shared driver only
- device node registration for port drivers
- properly return -EPROBE_DEFER on missing of phy (Reported by Simon Baatz)
v2->v3:
- rebase on top of mv643xx_eth clean-ups
- do not reparse existing platform_data
- use managed devm_kzalloc for parsed platform_data
- use of_property_read_u32 where applicable
- add phy_node to platform_data
- use of_connect_phy if DT phy node was found
v1->v2:
- properly ifdef of_platform_bus_probe with CONFIG_OF
- handle of_platform_bus_probe errors and cleanup accordingly
- use of_property_read_u32 where applicable
- parse "duplex" and "speed" property in PHY-less configuration
--- .../devicetree/bindings/net/marvell-orion-net.txt | 83 +++++++++++ drivers/net/ethernet/marvell/mv643xx_eth.c | 152 +++++++++++++++++++- 2 files changed, 231 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/marvell-orion-net.txt
Documentation/devicetree/bindings/net/marvell-orion-net.txt new file +83 -0
@@ -0,0 +1,83 @@ +Marvell Orion/Discovery ethernet controller +============================================= + +The Marvell Discovery ethernet controller can be found on Marvell Orion SoCs +(Kirkwood, Dove, Orion5x, and Discovery Innovation) and as part of Marvell +Discovery system controller chips (mv64[345]60). + +The Discovery ethernet controller is described with two levels of nodes. The +first level describes the ethernet controller itself and the second level +describes up to 3 ethernet port nodes within that controller. The reason for +the multiple levels is that the port registers are interleaved within a single +set of controller registers. Each port node describes port-specific properties. + +Note: The above separation is only true for Discovery system controllers. +For Orion SoCs we stick to the separation, although there each controller has +only one port associated. Multiple ports are implemented as multiple single-port +controllers. + +* Ethernet controller node + +Required controller properties: + - #address-cells: shall be 1. + - #size-cells: shall be 0. + - compatible: shall be "marvell,orion-eth". + - reg: address and length of the controller registers. + +Optional controller properties: + - clocks: phandle reference to the controller clock. + - marvell,tx-checksum-limit: max tx packet size for hardware checksum. + +* Ethernet port node + +Required port properties: + - device_type: shall be "network". + - compatible: shall be "marvell,orion-eth-port". + - reg: port number relative to ethernet controller, shall be 0, 1, or 2. + - interrupts: port interrupt. + - local-mac-address: 6 bytes MAC address. + +Optional port properties: + - marvell,tx-queue-size: size of the transmit ring buffer. + - marvell,tx-sram-addr: address of transmit descriptor buffer located in SRAM. + - marvell,tx-sram-size: size of transmit descriptor buffer located in SRAM. + - marvell,rx-queue-size: size of the receive ring buffer. + - marvell,rx-sram-addr: address of receive descriptor buffer located in SRAM. + - marvell,rx-sram-size: size of receive descriptor buffer located in SRAM. + +and + + - phy-handle: phandle reference to ethernet PHY. + +or + + - speed: port speed if no PHY connected. + - duplex: port mode if no PHY connected. + +* Node example: + +mdio-bus { + ... + ethphy: ethernet-phy at 8 { + device_type = "ethernet-phy"; + ... + }; +}; + +eth: ethernet-controller at 72000 { + compatible = "marvell,orion-eth"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x72000 0x2000>; + clocks = <&gate_clk 2>; + marvell,tx-checksum-limit = <1600>; + + ethernet at 0 { + device_type = "network"; + compatible = "marvell,orion-eth-port"; + reg = <0>; + interrupts = <29>; + phy-handle = <ðphy>; + local-mac-address = [00 00 00 00 00 00]; + }; +};
drivers/net/ethernet/marvell/mv643xx_eth.c +148 -4
206 lines not on this page · raw message
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH v4 6/12 ARM: dove: add gigabit ethernet and mvmdio device tree nodes
In reply to Sebastian HesselbarthThis patch adds orion-eth and mvmdio device tree nodes for DT enabled Dove boards. As there is only one ethernet controller on Dove, a default phy node is also added with a note to set its reg property on a per-board basis.
---
Changelog:v3->v4:
- convert to new device tree binding
--- arch/arm/boot/dts/dove-cubox.dts | 7 +++++++ arch/arm/boot/dts/dove.dtsi | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+)
arch/arm/boot/dts/dove-cubox.dts +7 -0
@@ -49,6 +49,13 @@ &uart0 { status = "okay"; }; &sata0 { status = "okay"; }; &i2c0 { status = "okay"; }; +&mdio { status = "okay"; }; +ð { status = "okay"; }; + +ðphy { + compatible = "marvell,88e1310"; + reg = <1>; +}; &sdio0 { status = "okay";
arch/arm/boot/dts/dove.dtsi +35 -0
@@ -258,5 +258,40 @@ dmacap,xor; }; }; + + mdio: mdio-bus at 72004 { + compatible = "marvell,orion-mdio"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x72004 0x84>; + interrupts = <30>; + clocks = <&gate_clk 2>; + status = "disabled"; + + ethphy: ethernet-phy { + device-type = "ethernet-phy"; + /* set phy address in board file */ + }; + }; + + eth: ethernet-controller at 72000 { + compatible = "marvell,orion-eth"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x72000 0x4000>; + clocks = <&gate_clk 2>; + marvell,tx-checksum-limit = <1600>; + status = "disabled"; + + ethernet-port at 0 { + device_type = "network"; + compatible = "marvell,orion-eth-port"; + reg = <0>; + interrupts = <29>; + /* overwrite MAC address in bootloader */ + local-mac-address = [00 00 00 00 00 00]; + phy-handle = <ðphy>; + }; + }; }; };
Signature · 1 line
1.7.10.4
Andrew Lunn
maintainerRe: [PATCH v4 06/12] ARM: dove: add gigabit ethernet and mvmdio device tree nodes
Quoted 73 lines · Sebastian Hesselbarth
This patch adds orion-eth and mvmdio device tree nodes for DT enabled Dove boards. As there is only one ethernet controller on Dove, a default phy node is also added with a note to set its reg property on a per-board basis.
Signed-off-by Sebastian Hesselbarth <[email protected]>---
Changelog:v3->v4:
- convert to new device tree bindingCc David Miller <[email protected]>Cc Lennert Buytenhek <[email protected]>Cc Jason Cooper <[email protected]>Cc Andrew Lunn <[email protected]>Cc Benjamin Herrenschmidt <[email protected]>Cc netdev at vger.kernel.orgCc linux-arm-kernel at lists.infradead.orgCc linuxppc-dev at lists.ozlabs.orgCc linux-kernel at vger.kernel.org--- arch/arm/boot/dts/dove-cubox.dts | 7 +++++++ arch/arm/boot/dts/dove.dtsi | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+)arch/arm/boot/dts/dove-cubox.dts +7
-0@@ -49,6 +49,13 @@ &uart0 { status = "okay"; }; &sata0 { status = "okay"; }; &i2c0 { status = "okay"; }; +&mdio { status = "okay"; }; +ð { status = "okay"; }; + +ðphy { + compatible = "marvell,88e1310"; + reg = <1>; +}; &sdio0 { status = "okay";arch/arm/boot/dts/dove.dtsi +22
-0@@ -258,5 +258,40 @@ dmacap,xor; }; }; + + mdio: mdio-bus at 72004 { + compatible = "marvell,orion-mdio"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x72004 0x84>; + interrupts = <30>; + clocks = <&gate_clk 2>; + status = "disabled"; + + ethphy: ethernet-phy { + device-type = "ethernet-phy"; + /* set phy address in board file */ + }; + }; + + eth: ethernet-controller at 72000 { + compatible = "marvell,orion-eth"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x72000 0x4000>; + clocks = <&gate_clk 2>;
arch/arm/boot/dts/dove.dtsi line 292
Quoted 10 lines
arch/arm/boot/dts/dove.dtsi +10
-0+ marvell,tx-checksum-limit = <1600>; + status = "disabled"; + + ethernet-port at 0 { + device_type = "network"; + compatible = "marvell,orion-eth-port"; + reg = <0>; + interrupts = <29>; + /* overwrite MAC address in bootloader */ + local-mac-address = [00 00 00 00 00 00];
Hi Sebastian
Its probably a good idea to set the local administration bit in this MAC address. i.e. first byte is 02.
Andrew
Sebastian Hesselbarth
maintainerRe: [PATCH v4 06/12] ARM: dove: add gigabit ethernet and mvmdio device tree nodes
Quoted 8 lines · Andrew Lunn
Quoted 7 lines · Sebastian Hesselbarth
This patch adds orion-eth and mvmdio device tree nodes for DT enabled Dove boards. As there is only one ethernet controller on Dove, a default phy node is also added with a note to set its reg property on a per-board basis.
Signed-off-by Sebastian Hesselbarth<[email protected]>---
...
Quoted 10 lines
arch/arm/boot/dts/dove.dtsi line 292
Quoted 7 lines
arch/arm/boot/dts/dove.dtsi +7
-0+ ethernet-port at 0 { + device_type = "network"; + compatible = "marvell,orion-eth-port"; + reg =<0>; + interrupts =<29>; + /* overwrite MAC address in bootloader */ + local-mac-address = [00 00 00 00 00 00];Hi Sebastian
Quoted 2 lines
Its probably a good idea to set the local administration bit in this MAC address. i.e. first byte is 02.
Andrew,
we just need an invalid address here to trigger the default behavior of the driver and load the MAC address from its register. As PPC binding documentation also has all zero, I just took it.
Sebastian
Re: [PATCH v4 06/12] ARM: dove: add gigabit ethernet and mvmdio device tree nodes
Quoted 20 lines · Sebastian Hesselbarth
Quoted 8 lines · Andrew Lunn
Quoted 7 lines · Sebastian Hesselbarth
This patch adds orion-eth and mvmdio device tree nodes for DT enabled Dove boards. As there is only one ethernet controller on Dove, a default phy node is also added with a note to set its reg property on a per-board basis.
Signed-off-by Sebastian Hesselbarth<[email protected]>---
...
Quoted 10 lines
arch/arm/boot/dts/dove.dtsi line 292
Quoted 7 lines
arch/arm/boot/dts/dove.dtsi +7
-0+ ethernet-port at 0 { + device_type = "network"; + compatible = "marvell,orion-eth-port"; + reg =<0>; + interrupts =<29>; + /* overwrite MAC address in bootloader */ + local-mac-address = [00 00 00 00 00 00];Hi Sebastian
Quoted 8 lines
Quoted 2 lines
Its probably a good idea to set the local administration bit in this MAC address. i.e. first byte is 02.
Andrew,
we just need an invalid address here to trigger the default behavior of the driver and load the MAC address from its register. As PPC binding documentation also has all zero, I just took it.
The truth is in PPC case, often we set the real mac address with some variables like 'eth[x]addr' in u-boot prompt, then u-boot will parse that value to fill the dtb. At last the associated driver can get the actual mac address from the dtb. And especially for those older u-boot version, even you have to reset the 'local-mac-address' property in dts directly with the real mac address before generate the dtb since the older u-boot have no this ability to fill dtb again before pass the kernel.
Tiejun
Sebastian Hesselbarth
maintainerRe: [PATCH v4 06/12] ARM: dove: add gigabit ethernet and mvmdio device tree nodes
Quoted 32 lines · tiejun.chen
Quoted 22 lines · Sebastian Hesselbarth
Quoted 10 lines · Andrew Lunn
Quoted 9 lines · Sebastian Hesselbarth
This patch adds orion-eth and mvmdio device tree nodes for DT enabled Dove boards. As there is only one ethernet controller on Dove, a default
phy node is also added with a note to set its reg property on a per-board
basis.Signed-off-by Sebastian Hesselbarth<[email protected]>---
...
Quoted 10 lines
Quoted 7 lines
+ ethernet-port at 0 {
+device_type= "network";
+ compatible = "marvell,orion-eth-port";
+ reg =<0>;
+ interrupts =<29>;
+ /* overwrite MAC address in bootloader */
+ local-mac-address = [00 00 00 00 00 00];Hi Sebastian
Quoted 8 lines
Quoted 2 lines
Its probably a good idea to set the local administration bit in this MAC address. i.e. first byte is 02.
Andrew,
we just need an invalid address here to trigger the default behavior of the driver and load the MAC address from its register. As PPC binding documentation also has all zero, I just took it.
Quoted 7 lines
The truth is in PPC case, often we set the real mac address with some variables like 'eth[x]addr' in u-boot prompt, then u-boot will parse that value to fill the dtb. At last the associated driver can get the actual mac address from the dtb. And especially for those older u-boot version, even you have to reset the 'local-mac-address' property in dts directly with the real mac address before generate the dtb since the older u-boot have no this ability to fill dtb again before pass the kernel.
Tiejun,
with Marvell SoCs it is no different, except that there is almost no dtb support in their u-boot. The default behavior of the driver always was to load the MAC address from its register if there is no valid overwrite value. Using an invalid address (and all zero above is invalid) will cause of_get_mac_address() to fail (which we allow), the corresponding platform_data will never be written, and cause the default behavior.
We only need an invalid address passed initially on local-mac-address. DT aware boot loader will overwrite but DT agnositic boot loader will not. I can put any invalid MAC address in here, so I have chosen the very first I can think of.
Sebastian
Re: [PATCH v4 06/12] ARM: dove: add gigabit ethernet and mvmdio device tree nodes
Quoted 41 lines · Sebastian Hesselbarth
Quoted 32 lines · tiejun.chen
Quoted 22 lines · Sebastian Hesselbarth
Quoted 10 lines · Andrew Lunn
Quoted 9 lines · Sebastian Hesselbarth
This patch adds orion-eth and mvmdio device tree nodes for DT enabled Dove boards. As there is only one ethernet controller on Dove, a default
phy node is also added with a note to set its reg property on a per-board
basis.Signed-off-by Sebastian Hesselbarth<[email protected]>---
...
Quoted 10 lines
Quoted 7 lines
+ ethernet-port at 0 {
+device_type= "network";
+ compatible = "marvell,orion-eth-port";
+ reg =<0>;
+ interrupts =<29>;
+ /* overwrite MAC address in bootloader */
+ local-mac-address = [00 00 00 00 00 00];Hi Sebastian
Quoted 8 lines
Quoted 2 lines
Its probably a good idea to set the local administration bit in this MAC address. i.e. first byte is 02.
Andrew,
we just need an invalid address here to trigger the default behavior of the driver and load the MAC address from its register. As PPC binding documentation also has all zero, I just took it.
Quoted 7 lines
The truth is in PPC case, often we set the real mac address with some variables like 'eth[x]addr' in u-boot prompt, then u-boot will parse that value to fill the dtb. At last the associated driver can get the actual mac address from the dtb. And especially for those older u-boot version, even you have to reset the 'local-mac-address' property in dts directly with the real mac address before generate the dtb since the older u-boot have no this ability to fill dtb again before pass the kernel.
Quoted 4 lines
Tiejun,
with Marvell SoCs it is no different, except that there is almost no dtb support in their u-boot.
iirc, our solution to this was to parse the ATAGs for the mac addr and update the appended dtb. This way, module load and unload would work without loosing the mac address. I believe Jason Gunthorpe has a patch to atags_to_fdt() for this... This should allow us to get rid of the clocks hack.
thx,
Jason.
Re: [PATCH v4 06/12] ARM: dove: add gigabit ethernet and mvmdio device tree nodes
Quoted 5 lines · Jason Cooper
iirc, our solution to this was to parse the ATAGs for the mac addr and update the appended dtb. This way, module load and unload would work without loosing the mac address. I believe Jason Gunthorpe has a patch to
atags_to_fdt()for this... This should allow us to get rid of the clocks hack.
Sorry, no, we don't use ATAGs here, our platforms start the kernel with a correct DTB that has the correct mac address to use. My patch was to have the driver accept it, and I think Sebastian has already got that functionality...
Jason
Re: [PATCH v4 06/12] ARM: dove: add gigabit ethernet and mvmdio device tree nodes
Quoted 8 lines · Jason Gunthorpe
Quoted 5 lines · Jason Cooper
iirc, our solution to this was to parse the ATAGs for the mac addr and update the appended dtb. This way, module load and unload would work without loosing the mac address. I believe Jason Gunthorpe has a patch to
atags_to_fdt()for this... This should allow us to get rid of the clocks hack.
Quoted 4 lines
Sorry, no, we don't use ATAGs here, our platforms start the kernel with a correct DTB that has the correct mac address to use. My patch was to have the driver accept it, and I think Sebastian has already got that functionality...
Yes, you're right.
thx,
Jason.
Sebastian Hesselbarth
maintainerRe: [PATCH v4 06/12] ARM: dove: add gigabit ethernet and mvmdio device tree nodes
In reply to Jason GunthorpeQuoted 11 lines · Jason Gunthorpe
Quoted 5 lines · Jason Cooper
iirc, our solution to this was to parse the ATAGs for the mac addr and update the appended dtb. This way, module load and unload would work without loosing the mac address. I believe Jason Gunthorpe has a patch to
atags_to_fdt()for this... This should allow us to get rid of the clocks hack.Sorry, no, we don't use ATAGs here, our platforms start the kernel with a correct DTB that has the correct mac address to use. My patch was to have the driver accept it, and I think Sebastian has already got that functionality...
Not neccessary anyway, after talking Jason C in a Kirkwood-only workaround I prepared a patch that reads mac address registers early and stores it in the local-mac-address property.
Just tested on Dockstar with gated clocks and modular DT mv643xx_eth.
Will append to the DT mv643xx_eth patch set if a v5 will be required or as single patch prior Jason C taking in the ARM part of it otherwise.
Sebastian
Re: [PATCH v4 06/12] ARM: dove: add gigabit ethernet and mvmdio device tree nodes
Quoted 8 lines · Sebastian Hesselbarth
Quoted 7 lines · Jason Gunthorpe
Quoted 5 lines · Jason Cooper
iirc, our solution to this was to parse the ATAGs for the mac addr and update the appended dtb. This way, module load and unload would work without loosing the mac address. I believe Jason Gunthorpe has a patch to
atags_to_fdt()for this... This should allow us to get rid of the clocks hack.
Quoted 8 lines
Quoted 4 lines
Sorry, no, we don't use ATAGs here, our platforms start the kernel with a correct DTB that has the correct mac address to use. My patch was to have the driver accept it, and I think Sebastian has already got that functionality...
Not neccessary anyway, after talking Jason C in a Kirkwood-only workaround I prepared a patch that reads mac address registers early and stores it in the local-mac-address property.
Sweet!
Quoted 5 lines
Just tested on Dockstar with gated clocks and modular DT
mv643xx_eth.Will append to the DT
mv643xx_ethpatch set if a v5 will be required or as single patch prior Jason C taking in the ARM part of it otherwise.
Please post, in-reply-to v4 is fine.
thx,
Jason.
Sebastian Hesselbarth
maintainerRe: [PATCH v4 06/12] ARM: dove: add gigabit ethernet and mvmdio device tree nodes
Quoted 20 lines · Jason Cooper
Quoted 8 lines · Sebastian Hesselbarth
Quoted 7 lines · Jason Gunthorpe
Quoted 5 lines · Jason Cooper
iirc, our solution to this was to parse the ATAGs for the mac addr and update the appended dtb. This way, module load and unload would work without loosing the mac address. I believe Jason Gunthorpe has a patch to
atags_to_fdt()for this... This should allow us to get rid of the clocks hack.Quoted 8 lines
Quoted 4 lines
Sorry, no, we don't use ATAGs here, our platforms start the kernel with a correct DTB that has the correct mac address to use. My patch was to have the driver accept it, and I think Sebastian has already got that functionality...
Not neccessary anyway, after talking Jason C in a Kirkwood-only workaround I prepared a patch that reads mac address registers early and stores it in the local-mac-address property.
Sweet!
Quoted 7 lines
Quoted 5 lines
Just tested on Dockstar with gated clocks and modular DT
mv643xx_eth.Will append to the DT
mv643xx_ethpatch set if a v5 will be required or as single patch prior Jason C taking in the ARM part of it otherwise.Please post, in-reply-to v4 is fine.
Hmm, maybe a little bit too early. While restoring the MAC address now works, another bug arises which I guess is related with phy setup and aneg.
Will investigate and update patch set accordingly.
Sebastian
Re: [PATCH v4 06/12] ARM: dove: add gigabit ethernet and mvmdio device tree nodes
Quoted 27 lines · Sebastian Hesselbarth
Quoted 26 lines · Jason Cooper
Quoted 8 lines · Sebastian Hesselbarth
Quoted 7 lines · Jason Gunthorpe
Quoted 5 lines · Jason Cooper
iirc, our solution to this was to parse the ATAGs for the mac addr and update the appended dtb. This way, module load and unload would work without loosing the mac address. I believe Jason Gunthorpe has a patch to
atags_to_fdt()for this... This should allow us to get rid of the clocks hack.Quoted 8 lines
Quoted 4 lines
Sorry, no, we don't use ATAGs here, our platforms start the kernel with a correct DTB that has the correct mac address to use. My patch was to have the driver accept it, and I think Sebastian has already got that functionality...
Not neccessary anyway, after talking Jason C in a Kirkwood-only workaround I prepared a patch that reads mac address registers early and stores it in the local-mac-address property.
Sweet!
Quoted 5 lines
Just tested on Dockstar with gated clocks and modular DT
mv643xx_eth.Will append to the DT
mv643xx_ethpatch set if a v5 will be required or as single patch prior Jason C taking in the ARM part of it otherwise.
Quoted 7 lines
Quoted 1 line
Please post, in-reply-to v4 is fine.
Hmm, maybe a little bit too early. While restoring the MAC address now works, another bug arises which I guess is related with phy setup and aneg.
Will investigate and update patch set accordingly.
Cool, chances are, we should be able to take that patch in by itself for this merge window...
thx,
Jason.
Sebastian Hesselbarth
maintainerRe: [PATCH v4 06/12] ARM: dove: add gigabit ethernet and mvmdio device tree nodes
Quoted 9 lines · Jason Cooper
Quoted 5 lines · Sebastian Hesselbarth
Hmm, maybe a little bit too early. While restoring the MAC address now works, another bug arises which I guess is related with phy setup and aneg.
Will investigate and update patch set accordingly.
Cool, chances are, we should be able to take that patch in by itself for this merge window...
Which patch do you mean? The local-mac-address workaround will only be available for DT mv643xx_eth because it uses the DT node to store the MAC.
Anyway, I found the bit that caused the other issue. It is the Clk125_Bypass_En bit in PORT_SERIAL_CONTROL1 register. What bothers me about it is:
- Only Dove and Kirkwood have the bit, MV78x00 doesn't have it, Orion5x doesn't have the register at all. With ppc mv64x60 I can only guess, but think it is like in Orion5x.
- Reset value of that bit should be 0, but after gating clock on Kirkwood it is set to 1 causing wrong port clock to be selected. Also Thomas Petazzoni confirmed that it is set after reset so either FS is wrong about it or BootROM messes with it.
- Kirkwood and Dove FS tell me that port link must be down when you change the bit.
As I can't be sure about how mv643xx_eth will behave on other platforms except Kirkwood and Dove when writing that register, I tend to force that bit to zero in the driver but only for those two by #ifdefs.
Sebastian
Re: [PATCH v4 06/12] ARM: dove: add gigabit ethernet and mvmdio device tree nodes
Quoted 6 lines · Sebastian Hesselbarth
Quoted 5 lines · Jason Cooper
Quoted 4 lines · Sebastian Hesselbarth
Hmm, maybe a little bit too early. While restoring the MAC address now works, another bug arises which I guess is related with phy setup and aneg.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Will investigate and update patch set accordingly.
Cool, chances are, we should be able to take that patch in by itself for this merge window...
Which patch do you mean? The local-mac-address workaround will only be available for DT
mv643xx_ethbecause it uses the DT node to store the MAC.
I thought you were replacing the unconditional ethernet clock grabbing with reading the mac from the registers and updating the dtb? In mach-kirkwood/board-dt.c?
confused. :-/
Jason.
Sebastian Hesselbarth
maintainerRe: [PATCH v4 06/12] ARM: dove: add gigabit ethernet and mvmdio device tree nodes
Quoted 12 lines · Jason Cooper
Quoted 11 lines · Sebastian Hesselbarth
Quoted 9 lines · Jason Cooper
Quoted 5 lines · Sebastian Hesselbarth
Hmm, maybe a little bit too early. While restoring the MAC address now works, another bug arises which I guess is related with phy setup and aneg.
Will investigate and update patch set accordingly.
Cool, chances are, we should be able to take that patch in by itself for this merge window...
Quoted 7 lines
Quoted 3 lines
Which patch do you mean? The local-mac-address workaround will only be available for DT
mv643xx_ethbecause it uses the DT node to store the MAC.I thought you were replacing the unconditional ethernet clock grabbing with reading the mac from the registers and updating the dtb? In
mach-kirkwood/board-dt.c?
True. But there is no node for ethernet controllers in kirkwood.dtsi yet. It will be there with mv643xx_eth DT patches applied and that is when the corresponding replacement patch should also be taken in.
I was just confused about your referral to the merge window, because I guess it is up to David Miller to decide when/whether to take mv643xx_eth patches in.
Sebastian
Re: [PATCH v4 06/12] ARM: dove: add gigabit ethernet and mvmdio device tree nodes
Quoted 21 lines · Sebastian Hesselbarth
Quoted 12 lines · Jason Cooper
Quoted 11 lines · Sebastian Hesselbarth
Quoted 9 lines · Jason Cooper
Quoted 5 lines · Sebastian Hesselbarth
Hmm, maybe a little bit too early. While restoring the MAC address now works, another bug arises which I guess is related with phy setup and aneg.
Will investigate and update patch set accordingly.
Cool, chances are, we should be able to take that patch in by itself for this merge window...
Quoted 7 lines
Quoted 3 lines
Which patch do you mean? The local-mac-address workaround will only be available for DT
mv643xx_ethbecause it uses the DT node to store the MAC.I thought you were replacing the unconditional ethernet clock grabbing with reading the mac from the registers and updating the dtb? In
mach-kirkwood/board-dt.c?
Quoted 7 lines
True. But there is no node for ethernet controllers in
kirkwood.dtsiyet. It will be there withmv643xx_ethDT patches applied and that is when the corresponding replacement patch should also be taken in.I was just confused about your referral to the merge window, because I guess it is up to David Miller to decide when/whether to take
mv643xx_ethpatches in.
Ahh, no, that was me. I was contemplating adding the dt entries in this merge window at one point and must've got my wires crossed. Sorry for the confusion.
thx,
Jason.
Sebastian Hesselbarth
maintainerRe: [PATCH v4 06/12] ARM: dove: add gigabit ethernet and mvmdio device tree nodes
In reply to Jason CooperQuoted 9 lines · Jason Cooper
Quoted 8 lines · Sebastian Hesselbarth
Quoted 7 lines · Jason Cooper
Quoted 5 lines · Sebastian Hesselbarth
Just tested on Dockstar with gated clocks and modular DT
mv643xx_eth.Will append to the DT
mv643xx_ethpatch set if a v5 will be required or as single patch prior Jason C taking in the ARM part of it otherwise.
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Please post, in-reply-to v4 is fine.
Hmm, maybe a little bit too early. While restoring the MAC address now works, another bug arises which I guess is related with phy setup and aneg.
Will investigate and update patch set accordingly.
Ok, have it working now by properly clearing CLK125_BYPASS_EN bit in PORT_SERIAL_CTRL1 register for Kirkwood only. I have two more patches ready that I will post as single patches in reply to v4.
If David gives his ACK for the patch set and names a branch to base it on, I will send a v5 including all patches.
Sebastian
Re: [PATCH v4 06/12] ARM: dove: add gigabit ethernet and mvmdio device tree nodes
In reply to Sebastian HesselbarthQuoted 3 lines · Sebastian Hesselbarth
Not neccessary anyway, after talking Jason C in a Kirkwood-only workaround I prepared a patch that reads mac address registers early and stores it in the local-mac-address property.
That sounds great, but, FWIW, our bootloaders don't set the MAC address registers. Does the work around only trigger if the local-mac-address property is 0?
Jason
Sebastian Hesselbarth
maintainerRe: [PATCH v4 06/12] ARM: dove: add gigabit ethernet and mvmdio device tree nodes
Quoted 8 lines · Jason Gunthorpe
Quoted 3 lines · Sebastian Hesselbarth
Not neccessary anyway, after talking Jason C in a Kirkwood-only workaround I prepared a patch that reads mac address registers early and stores it in the local-mac-address property.
That sounds great, but, FWIW, our bootloaders don't set the MAC address registers. Does the work around only trigger if the local-mac-address property is 0?
I already thought about bootloaders not setting the register, but I will not start parsing 1001 places for a valid MAC only for those. Also reading the MAC address registers is default behavior of mv643xx_eth if no MAC address is passed through platform_data.
But you are right, there is plenty of sanity checks in the workaround to ensure that local-mac-address is only overwritten by it when
- you are on DT
- there is no valid MAC address in that node (of_get_mac_address)
- there is a local-mac-address property with a length of 6 bytes
So this workaround only applies on DT booted kernels with no mac set in DT.
Sebastian
Sebastian Hesselbarth
maintainerPATCH v4 7/12 ARM: kirkwood: add gigabit ethernet and mvmdio device tree nodes
In reply to Sebastian HesselbarthThis patch adds mv643xx_eth and mvmdio device tree nodes for DT enabled Kirkwood boards. Phy nodes are also added with reg property set on a per-board basis.
---
Changelog:v3->v4:
- convert to new device tree binding
- fix phy addr of kirkwood-ts219-6282.dts (Reported by Andrew Lunn)
- fix mvmdio interrupt (Reported by Simon Baatz)
--- arch/arm/boot/dts/kirkwood-cloudbox.dts | 16 ++++++ arch/arm/boot/dts/kirkwood-dnskw.dtsi | 16 ++++++ arch/arm/boot/dts/kirkwood-dockstar.dts | 17 +++++++ arch/arm/boot/dts/kirkwood-dreamplug.dts | 28 +++++++++++ arch/arm/boot/dts/kirkwood-goflexnet.dts | 16 ++++++ .../arm/boot/dts/kirkwood-guruplug-server-plus.dts | 30 +++++++++++ arch/arm/boot/dts/kirkwood-ib62x0.dts | 16 ++++++ arch/arm/boot/dts/kirkwood-iconnect.dts | 16 ++++++ arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts | 24 +++++++++ arch/arm/boot/dts/kirkwood-is2.dts | 2 + arch/arm/boot/dts/kirkwood-km_kirkwood.dts | 16 ++++++ arch/arm/boot/dts/kirkwood-lsxl.dtsi | 28 +++++++++++ arch/arm/boot/dts/kirkwood-mplcec4.dts | 27 ++++++++++ .../boot/dts/kirkwood-netgear_readynas_duo_v2.dts | 16 ++++++ arch/arm/boot/dts/kirkwood-ns2-common.dtsi | 16 ++++++ arch/arm/boot/dts/kirkwood-ns2.dts | 2 + arch/arm/boot/dts/kirkwood-ns2lite.dts | 2 + arch/arm/boot/dts/kirkwood-ns2max.dts | 2 + arch/arm/boot/dts/kirkwood-ns2mini.dts | 2 + arch/arm/boot/dts/kirkwood-openblocks_a6.dts | 16 ++++++ arch/arm/boot/dts/kirkwood-topkick.dts | 16 ++++++ arch/arm/boot/dts/kirkwood-ts219-6281.dts | 4 +- arch/arm/boot/dts/kirkwood-ts219-6282.dts | 4 +- arch/arm/boot/dts/kirkwood-ts219.dtsi | 16 ++++++ arch/arm/boot/dts/kirkwood.dtsi | 52 ++++++++++++++++++++ 25 files changed, 398 insertions(+), 2 deletions(-)
arch/arm/boot/dts/kirkwood-cloudbox.dts +16 -0
@@ -87,3 +87,19 @@ gpios = <&gpio0 17 0>; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-dnskw.dtsi +16 -0
@@ -217,3 +217,19 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 8 { + device_type = "ethernet-phy"; + reg = <8>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-dockstar.dts +17 -0
@@ -91,3 +91,20 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + compatible = "marvell,88e1116"; + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-dreamplug.dts +28 -0
@@ -99,3 +99,31 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; + + ethphy1: ethernet-phy at 1 { + device_type = "ethernet-phy"; + reg = <1>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +}; + +ð1 { + status = "okay"; + ethernet1-port at 0 { + phy-handle = <ðphy1>; + }; +};
arch/arm/boot/dts/kirkwood-goflexnet.dts +16 -0
@@ -170,3 +170,19 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts +30 -0
@@ -96,3 +96,33 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + compatible = "marvell,88e1121"; + reg = <0>; + }; + + ethphy1: ethernet-phy at 1 { + device_type = "ethernet-phy"; + compatible = "marvell,88e1121"; + reg = <1>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +}; + +ð1 { + status = "okay"; + ethernet1-port at 0 { + phy-handle = <ðphy1>; + }; +};
arch/arm/boot/dts/kirkwood-ib62x0.dts +16 -0
@@ -119,3 +119,19 @@ }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 8 { + device_type = "ethernet-phy"; + reg = <8>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-iconnect.dts +16 -0
@@ -168,3 +168,19 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 11 { + device_type = "ethernet-phy"; + reg = <11>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts +24 -0
@@ -191,3 +191,27 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy1: ethernet-phy at 11 { + device_type = "ethernet-phy"; + reg = <11>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + speed = <1000>; + duplex = <1>; + }; +}; + +ð1 { + status = "okay"; + ethernet1-port at 0 { + phy-handle = <ðphy1>; + }; +};
arch/arm/boot/dts/kirkwood-is2.dts +2 -0
@@ -28,3 +28,5 @@ }; }; }; + +ðphy0 { reg = <8>; };
arch/arm/boot/dts/kirkwood-km_kirkwood.dts +16 -0
@@ -43,3 +43,19 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-lsxl.dtsi +28 -0
@@ -201,3 +201,31 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; + + ethphy1: ethernet-phy at 8 { + device_type = "ethernet-phy"; + reg = <8>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +}; + +ð1 { + status = "okay"; + ethernet1-port at 0 { + phy-handle = <ðphy1>; + }; +};
arch/arm/boot/dts/kirkwood-mplcec4.dts +27 -0
@@ -182,3 +182,30 @@ }; }; +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 1 { + device_type = "ethernet-phy"; + reg = <1>; + }; + + ethphy1: ethernet-phy at 2 { + device_type = "ethernet-phy"; + reg = <2>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +}; + +ð1 { + status = "okay"; + ethernet1-port at 0 { + phy-handle = <ðphy1>; + }; +};
arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts +16 -0
@@ -178,3 +178,19 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-ns2-common.dtsi +16 -0
@@ -82,3 +82,19 @@ }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy { + device_type = "ethernet-phy"; + /* overwrite reg property in board file */ + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-ns2.dts +2 -0
@@ -28,3 +28,5 @@ }; }; }; + +ðphy0 { reg = <8>; };
arch/arm/boot/dts/kirkwood-ns2lite.dts +2 -0
@@ -28,3 +28,5 @@ }; }; }; + +ðphy0 { reg = <0>; };
arch/arm/boot/dts/kirkwood-ns2max.dts +2 -0
@@ -47,3 +47,5 @@ }; }; }; + +ðphy0 { reg = <8>; };
arch/arm/boot/dts/kirkwood-ns2mini.dts +2 -0
@@ -48,3 +48,5 @@ }; }; }; + +ðphy0 { reg = <0>; };
arch/arm/boot/dts/kirkwood-openblocks_a6.dts +16 -0
@@ -210,3 +210,19 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-topkick.dts +16 -0
@@ -201,3 +201,19 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-ts219-6281.dts +3 -1
@@ -49,4 +49,6 @@ gpios = <&gpio0 16 1>; }; }; -}; +}; + +ðphy0 { reg = <8>; };
arch/arm/boot/dts/kirkwood-ts219-6282.dts +3 -1
@@ -49,4 +49,6 @@ gpios = <&gpio1 5 1>; }; }; -}; +}; + +ðphy0 { reg = <0>; };
arch/arm/boot/dts/kirkwood-ts219.dtsi +16 -0
@@ -76,3 +76,19 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy { + device_type = "ethernet-phy"; + /* overwrite reg property in board file */ + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood.dtsi +52 -0
57 lines not on this page · raw message
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH v4 8/12 ARM: orion5x: add gigabit ethernet and mvmdio device tree nodes
In reply to Sebastian HesselbarthThis patch adds mv643xx_eth and mvmdio device tree nodes for DT enabled Orion5x boards. Phy nodes are also added with reg property set on a per-board basis.
---
Changelog:v3->v4:
- convert to new device tree binding
--- .../dts/orion5x-lacie-ethernet-disk-mini-v2.dts | 17 ++++++++++++ arch/arm/boot/dts/orion5x.dtsi | 29 ++++++++++++++++++++ 2 files changed, 46 insertions(+)
arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts +17 -0
@@ -53,3 +53,20 @@ }; }; }; + +&mdio { + status = "okay"; + + ðphy: ethernet-phy { + device-type = "ethernet-phy"; + reg = <8>; + }; +}; + +ð { + status = "okay"; + + ethernet-port at 0 { + phy-handle = <ðphy>; + }; +};
arch/arm/boot/dts/orion5x.dtsi +29 -0
@@ -132,5 +132,34 @@ interrupts = <28>; status = "okay"; }; + + mdio: mdio-bus at 72004 { + compatible = "marvell,orion-mdio"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x72004 0x84>; + interrupts = <22>; + status = "disabled"; + + /* add phy nodes in board file */ + }; + + eth: ethernet-controller at 72000 { + compatible = "marvell,orion-eth"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x72000 0x4000>; + marvell,tx-checksum-limit = <1600>; + status = "disabled"; + + ethernet-port at 0 { + device_type = "network"; + compatible = "marvell,orion-eth-port"; + reg = <0>; + /* overwrite MAC address in bootloader */ + local-mac-address = [00 00 00 00 00 00]; + /* set phy-handle property in board file */ + }; + }; }; };
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH v4 9/12 ARM: dove: remove legacy mv643xx_eth setup
In reply to Sebastian HesselbarthWith DT support for mv643xx_eth we do not need legacy platform_data based setup for DT enabled boards anymore.
---
Cc: David Miller <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: netdev at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-kernel at vger.kernel.org
--- arch/arm/mach-dove/board-dt.c | 9 --------- 1 file changed, 9 deletions(-)
arch/arm/mach-dove/board-dt.c +0 -9
@@ -34,10 +34,6 @@ static void __init dove_legacy_clk_init(void) clkspec.np = np; clkspec.args_count =1 ; - clkspec.args[0 ] =CLOCK_GATING_BIT_GBE ; -orion_clkdev_add (NULL ,"mv643xx_eth_port.0" , -of_clk_get_from_provider (&clkspec)); - clkspec.args[0 ] =CLOCK_GATING_BIT_PCIE0 ;orion_clkdev_add ("0" ,"pcie" ,of_clk_get_from_provider (&clkspec));
@@ -53,10 +49,6 @@ static void __init dove_of_clk_init(void)dove_legacy_clk_init (); } -static struct mv643xx_eth_platform_data dove_dt_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR_DEFAULT , -}; -static void __init dove_dt_init (void ) {pr_info ("Dove 88AP510 SoC\n" );
@@ -70,7 +62,6 @@ static void __init dove_dt_init(void)dove_of_clk_init ();/* Internal devices not ported to DT yet */ -dove_ge00_init (&dove_dt_ge00_data);dove_pcie_init (1 ,1 );of_platform_populate (NULL , of_default_bus_match_table,NULL ,NULL );
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH v4 10/12 ARM: kirkwood: remove legacy clk alias for mv643xx_eth
In reply to Sebastian HesselbarthWith all boards converted to DT enabled mv643xx_eth we can now remove the clock alias for gbe clocks. The workaround for ge0/ge1 clock gates is not removed, as Kirkwood ethernet controllers loose MAC address stored in internal registers on gated ge0/ge1 clocks.
---
Note: I confirm that the above workaround is still required, i.e. when booting DT kernel with non-DT boot loader (no local-mac-address property) MAC address registers looses its content on clock gating.
--- arch/arm/mach-kirkwood/board-dt.c | 2 -- 1 file changed, 2 deletions(-)
arch/arm/mach-kirkwood/board-dt.c +0 -2
@@ -66,12 +66,10 @@ static void __init kirkwood_legacy_clk_init(void)*/ clkspec.args[0 ] =CGC_BIT_GE0 ; clk =of_clk_get_from_provider (&clkspec); -orion_clkdev_add (NULL ,"mv643xx_eth_port.0" , clk);clk_prepare_enable (clk); clkspec.args[0 ] =CGC_BIT_GE1 ; clk =of_clk_get_from_provider (&clkspec); -orion_clkdev_add (NULL ,"mv643xx_eth_port.1" , clk);clk_prepare_enable (clk); }
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH v4 11/12 ARM: kirkwood: remove redundant DT board files
In reply to Sebastian HesselbarthWith DT support for mv643xx_eth, board specific init for some boards now is unneccessary. Remove those board files, Kconfig entries, and corresponding entries in kirkwood_defconfig.
---
Note: board-km_kirkwood.c is also removed, as Valentin Longchamp confirmed the lock-up is not caused by accessing clock gating registers but rather non-existent device registers. This will be addressed by dtsi separation for kirkwood and bobcat SoC variants.
Changelog:v3->v4:
- remove more boards that don't require board specific setup
--- arch/arm/configs/kirkwood_defconfig | 16 ---- arch/arm/mach-kirkwood/Kconfig | 117 ------------------------- arch/arm/mach-kirkwood/Makefile | 16 ---- arch/arm/mach-kirkwood/board-dnskw.c | 7 -- arch/arm/mach-kirkwood/board-dockstar.c | 32 ------- arch/arm/mach-kirkwood/board-dreamplug.c | 35 -------- arch/arm/mach-kirkwood/board-dt.c | 38 -------- arch/arm/mach-kirkwood/board-goflexnet.c | 34 ------- arch/arm/mach-kirkwood/board-guruplug.c | 33 ------- arch/arm/mach-kirkwood/board-ib62x0.c | 29 ------ arch/arm/mach-kirkwood/board-iconnect.c | 10 --- arch/arm/mach-kirkwood/board-iomega_ix2_200.c | 34 ------- arch/arm/mach-kirkwood/board-km_kirkwood.c | 44 ---------- arch/arm/mach-kirkwood/board-lsxl.c | 16 ---- arch/arm/mach-kirkwood/board-mplcec4.c | 14 --- arch/arm/mach-kirkwood/board-ns2.c | 35 -------- arch/arm/mach-kirkwood/board-openblocks_a6.c | 26 ------ arch/arm/mach-kirkwood/board-readynas.c | 6 -- arch/arm/mach-kirkwood/board-ts219.c | 13 --- arch/arm/mach-kirkwood/board-usi_topkick.c | 29 ------ 20 files changed, 584 deletions(-) delete mode 100644 arch/arm/mach-kirkwood/board-dockstar.c delete mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c delete mode 100644 arch/arm/mach-kirkwood/board-goflexnet.c delete mode 100644 arch/arm/mach-kirkwood/board-guruplug.c delete mode 100644 arch/arm/mach-kirkwood/board-ib62x0.c delete mode 100644 arch/arm/mach-kirkwood/board-iomega_ix2_200.c delete mode 100644 arch/arm/mach-kirkwood/board-km_kirkwood.c delete mode 100644 arch/arm/mach-kirkwood/board-ns2.c delete mode 100644 arch/arm/mach-kirkwood/board-openblocks_a6.c delete mode 100644 arch/arm/mach-kirkwood/board-usi_topkick.c
arch/arm/configs/kirkwood_defconfig +0 -16
@@ -30,27 +30,11 @@ CONFIG_MACH_SHEEVAPLUG=y CONFIG_MACH_T5325=y CONFIG_MACH_TS219=y CONFIG_MACH_TS41X=y -CONFIG_MACH_CLOUDBOX_DT=y CONFIG_MACH_DLINK_KIRKWOOD_DT=y -CONFIG_MACH_DOCKSTAR_DT=y -CONFIG_MACH_DREAMPLUG_DT=y -CONFIG_MACH_GOFLEXNET_DT=y -CONFIG_MACH_GURUPLUG_DT=y -CONFIG_MACH_IB62X0_DT=y -CONFIG_MACH_ICONNECT_DT=y -CONFIG_MACH_INETSPACE_V2_DT=y -CONFIG_MACH_IOMEGA_IX2_200_DT=y -CONFIG_MACH_KM_KIRKWOOD_DT=y CONFIG_MACH_LSXL_DT=y CONFIG_MACH_MPLCEC4_DT=y -CONFIG_MACH_NETSPACE_LITE_V2_DT=y -CONFIG_MACH_NETSPACE_MAX_V2_DT=y -CONFIG_MACH_NETSPACE_MINI_V2_DT=y -CONFIG_MACH_NETSPACE_V2_DT=y CONFIG_MACH_NSA310_DT=y -CONFIG_MACH_OPENBLOCKS_A6_DT=y CONFIG_MACH_READYNAS_DT=y -CONFIG_MACH_TOPKICK_DT=y CONFIG_MACH_TS219_DT=y # CONFIG_CPU_FEROCEON_OLD_ID is not set CONFIG_PREEMPT=y
arch/arm/mach-kirkwood/Kconfig +0 -117
147 lines not on this page · raw message
arch/arm/mach-kirkwood/Makefile +0 -16
@@ -20,25 +20,9 @@ obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o -obj-$(CONFIG_MACH_CLOUDBOX_DT) += board-ns2.o obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += board-dnskw.o -obj-$(CONFIG_MACH_DOCKSTAR_DT) += board-dockstar.o -obj-$(CONFIG_MACH_DREAMPLUG_DT) += board-dreamplug.o -obj-$(CONFIG_MACH_GOFLEXNET_DT) += board-goflexnet.o -obj-$(CONFIG_MACH_GURUPLUG_DT) += board-guruplug.o -obj-$(CONFIG_MACH_IB62X0_DT) += board-ib62x0.o -obj-$(CONFIG_MACH_ICONNECT_DT) += board-iconnect.o -obj-$(CONFIG_MACH_INETSPACE_V2_DT) += board-ns2.o -obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT) += board-iomega_ix2_200.o -obj-$(CONFIG_MACH_KM_KIRKWOOD_DT) += board-km_kirkwood.o obj-$(CONFIG_MACH_LSXL_DT) += board-lsxl.o obj-$(CONFIG_MACH_MPLCEC4_DT) += board-mplcec4.o -obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT) += board-ns2.o -obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT) += board-ns2.o -obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT) += board-ns2.o -obj-$(CONFIG_MACH_NETSPACE_V2_DT) += board-ns2.o obj-$(CONFIG_MACH_NSA310_DT) += board-nsa310.o -obj-$(CONFIG_MACH_OPENBLOCKS_A6_DT) += board-openblocks_a6.o obj-$(CONFIG_MACH_READYNAS_DT) += board-readynas.o -obj-$(CONFIG_MACH_TOPKICK_DT) += board-usi_topkick.o obj-$(CONFIG_MACH_TS219_DT) += board-ts219.o tsx1x-common.o
arch/arm/mach-kirkwood/board-dnskw.c +0 -7
@@ -14,14 +14,9 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> -#include <linux/mv643xx_eth.h> #include <linux/gpio.h> #include "common.h" -static struct mv643xx_eth_platform_data dnskw_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (8 ), -}; -/* Register any GPIO for output and set the value */ static void __init dnskw_gpio_register (unsigned gpio,char *name,int def) {
@@ -36,8 +31,6 @@ static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)void __init dnskw_init (void ) { -kirkwood_ge00_init (&dnskw_ge00_data); -/* Set NAS to turn back on after a power failure */ dnskw_gpio_register (37 ,"dnskw:power:recover" ,1 ); }
arch/arm/mach-kirkwood/board-dockstar.c deleted +0 -32
@@ -1,32 +0,0 @@ -/* -* arch/arm/mach-kirkwood/board-dockstar.c -* -* Seagate FreeAgent Dockstar Board Init for drivers not converted to -* flattened device tree yet. -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -* -* Copied and modified for Seagate GoFlex Net support by -* Joshua Coombs <[email protected]> based on ArchLinux ARM's -* GoFlex kernel patches. -* -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/mv643xx_eth.h> -#include "common.h" - -static struct mv643xx_eth_platform_data dockstar_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; - -void __init dockstar_dt_init (void ) -{ -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&dockstar_ge00_data); -}
arch/arm/mach-kirkwood/board-dreamplug.c deleted +0 -35
@@ -1,35 +0,0 @@ -/* -* Copyright 2012 (C), Jason Cooper <[email protected]> -* -* arch/arm/mach-kirkwood/board-dreamplug.c -* -* Marvell DreamPlug Reference Board Init for drivers not converted to -* flattened device tree yet. -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/mv643xx_eth.h> -#include <linux/gpio.h> -#include "common.h" - -static struct mv643xx_eth_platform_data dreamplug_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; - -static struct mv643xx_eth_platform_data dreamplug_ge01_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (1 ), -}; - -void __init dreamplug_init (void ) -{ -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&dreamplug_ge00_data); -kirkwood_ge01_init (&dreamplug_ge01_data); -}
arch/arm/mach-kirkwood/board-dt.c +0 -38
@@ -104,59 +104,21 @@ static void __init kirkwood_dt_init(void) kexec_reinit = kirkwood_enable_pcie;#endif -if (of_machine_is_compatible ("globalscale,dreamplug" )) -dreamplug_init (); - -if (of_machine_is_compatible ("globalscale,guruplug" )) -guruplug_dt_init (); -if (of_machine_is_compatible ("dlink,dns-kirkwood" ))dnskw_init (); -if (of_machine_is_compatible ("iom,iconnect" )) -iconnect_init (); - -if (of_machine_is_compatible ("raidsonic,ib-nas62x0" )) -ib62x0_init (); -if (of_machine_is_compatible ("qnap,ts219" ))qnap_dt_ts219_init (); -if (of_machine_is_compatible ("seagate,dockstar" )) -dockstar_dt_init (); - -if (of_machine_is_compatible ("seagate,goflexnet" )) -goflexnet_init (); -if (of_machine_is_compatible ("buffalo,lsxl" ))lsxl_init (); -if (of_machine_is_compatible ("iom,ix2-200" )) -iomega_ix2_200_init (); - -if (of_machine_is_compatible ("keymile,km_kirkwood" )) -km_kirkwood_init (); - -if (of_machine_is_compatible ("lacie,cloudbox" ) || -of_machine_is_compatible ("lacie,inetspace_v2" ) || -of_machine_is_compatible ("lacie,netspace_lite_v2" ) || -of_machine_is_compatible ("lacie,netspace_max_v2" ) || -of_machine_is_compatible ("lacie,netspace_mini_v2" ) || -of_machine_is_compatible ("lacie,netspace_v2" )) -ns2_init (); -if (of_machine_is_compatible ("mpl,cec4" ))mplcec4_init ();if (of_machine_is_compatible ("netgear,readynas-duo-v2" ))netgear_readynas_init (); -if (of_machine_is_compatible ("plathome,openblocks-a6" )) -openblocks_a6_init (); - -if (of_machine_is_compatible ("usi,topkick" )) -usi_topkick_init (); -of_platform_populate (NULL , kirkwood_dt_match_table,NULL ,NULL ); }
arch/arm/mach-kirkwood/board-goflexnet.c deleted +0 -34
@@ -1,34 +0,0 @@ -/* -* Copyright 2012 (C), Jason Cooper <[email protected]> -* -* arch/arm/mach-kirkwood/board-goflexnet.c -* -* Seagate GoFlext Net Board Init for drivers not converted to -* flattened device tree yet. -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -* -* Copied and modified for Seagate GoFlex Net support by -* Joshua Coombs <[email protected]> based on ArchLinux ARM's -* GoFlex kernel patches. -* -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/mv643xx_eth.h> -#include "common.h" - -static struct mv643xx_eth_platform_data goflexnet_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; - -void __init goflexnet_init (void ) -{ -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&goflexnet_ge00_data); -}
arch/arm/mach-kirkwood/board-guruplug.c deleted +0 -33
@@ -1,33 +0,0 @@ -/* -* arch/arm/mach-kirkwood/board-guruplug.c -* -* Marvell Guruplug Reference Board Init for drivers not converted to -* flattened device tree yet. -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/mv643xx_eth.h> -#include <linux/gpio.h> -#include "common.h" - -static struct mv643xx_eth_platform_data guruplug_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; - -static struct mv643xx_eth_platform_data guruplug_ge01_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (1 ), -}; - -void __init guruplug_dt_init (void ) -{ -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&guruplug_ge00_data); -kirkwood_ge01_init (&guruplug_ge01_data); -}
arch/arm/mach-kirkwood/board-ib62x0.c deleted +0 -29
@@ -1,29 +0,0 @@ -/* -* Copyright 2012 (C), Simon Baatz <[email protected]> -* -* arch/arm/mach-kirkwood/board-ib62x0.c -* -* RaidSonic ICY BOX IB-NAS6210 & IB-NAS6220 init for drivers not -* converted to flattened device tree yet. -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/mv643xx_eth.h> -#include "common.h" - -static struct mv643xx_eth_platform_data ib62x0_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (8 ), -}; - -void __init ib62x0_init (void ) -{ -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&ib62x0_ge00_data); -}
arch/arm/mach-kirkwood/board-iconnect.c +0 -10
@@ -11,18 +11,8 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/of.h> -#include <linux/mv643xx_eth.h> #include "common.h" -static struct mv643xx_eth_platform_data iconnect_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (11 ), -}; - -void __init iconnect_init (void ) -{ -kirkwood_ge00_init (&iconnect_ge00_data); -} -static int __init iconnect_pci_init (void ) {if (of_machine_is_compatible ("iom,iconnect" ))
arch/arm/mach-kirkwood/board-iomega_ix2_200.c deleted +0 -34
@@ -1,34 +0,0 @@ -/* -* arch/arm/mach-kirkwood/board-iomega_ix2_200.c -* -* Iomega StorCenter ix2-200 -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/mv643xx_eth.h> -#include <linux/ethtool.h> -#include "common.h" - -static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_NONE , - .speed =SPEED_1000 , - .duplex =DUPLEX_FULL , -}; - -static struct mv643xx_eth_platform_data iomega_ix2_200_ge01_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (11 ), -}; - -void __init iomega_ix2_200_init (void ) -{ -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&iomega_ix2_200_ge00_data); -kirkwood_ge01_init (&iomega_ix2_200_ge01_data); -}
arch/arm/mach-kirkwood/board-km_kirkwood.c deleted +0 -44
44 lines not on this page · raw message
arch/arm/mach-kirkwood/board-lsxl.c +0 -16
@@ -14,17 +14,8 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> -#include <linux/mv643xx_eth.h> #include "common.h" -static struct mv643xx_eth_platform_data lsxl_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; - -static struct mv643xx_eth_platform_data lsxl_ge01_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (8 ), -}; -/* * On the LS-XHL/LS-CHLv2, the shutdown process is following: * - Userland monitors key events until the power switch goes to off position
@@ -40,13 +31,6 @@ static void lsxl_power_off(void)void __init lsxl_init (void ) { -/* -* Basic setup. Needs to be called early. -*/ - -kirkwood_ge00_init (&lsxl_ge00_data); -kirkwood_ge01_init (&lsxl_ge01_data); -/* register power-off method */ pm_power_off = lsxl_power_off; }
arch/arm/mach-kirkwood/board-mplcec4.c +0 -14
@@ -11,24 +11,10 @@#include <linux/kernel.h> #include <linux/init.h> -#include <linux/mv643xx_eth.h> #include "common.h" -static struct mv643xx_eth_platform_data mplcec4_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (1 ), -}; - -static struct mv643xx_eth_platform_data mplcec4_ge01_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (2 ), -}; -void __init mplcec4_init (void ) { -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&mplcec4_ge00_data); -kirkwood_ge01_init (&mplcec4_ge01_data);kirkwood_pcie_init (KW_PCIE0 ); }
arch/arm/mach-kirkwood/board-ns2.c deleted +0 -35
@@ -1,35 +0,0 @@ -/* -* Copyright 2012 (C), Simon Guinot <[email protected]> -* -* arch/arm/mach-kirkwood/board-ns2.c -* -* LaCie Network Space v2 board (and parents) initialization for drivers -* not converted to flattened device tree yet. -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/platform_device.h> -#include <linux/mv643xx_eth.h> -#include <linux/of.h> -#include "common.h" - -static struct mv643xx_eth_platform_data ns2_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (8 ), -}; - -void __init ns2_init (void ) -{ -/* -* Basic setup. Needs to be called early. -*/ -if (of_machine_is_compatible ("lacie,cloudbox" ) || -of_machine_is_compatible ("lacie,netspace_lite_v2" ) || -of_machine_is_compatible ("lacie,netspace_mini_v2" )) - ns2_ge00_data.phy_addr =MV643XX_ETH_PHY_ADDR (0 ); -kirkwood_ge00_init (&ns2_ge00_data); -}
arch/arm/mach-kirkwood/board-openblocks_a6.c deleted +0 -26
@@ -1,26 +0,0 @@ -/* -* Copyright 2012 Nobuhiro Iwamatsu <[email protected]> -* -* arch/arm/mach-kirkwood/board-openblocks_a6.c -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/mv643xx_eth.h> -#include "common.h" - -static struct mv643xx_eth_platform_data openblocks_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; - -void __init openblocks_a6_init (void ) -{ -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&openblocks_ge00_data); -}
arch/arm/mach-kirkwood/board-readynas.c +0 -6
@@ -13,16 +13,10 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> -#include <linux/mv643xx_eth.h> #include <mach/kirkwood.h> #include "common.h" -static struct mv643xx_eth_platform_data netgear_readynas_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; -void __init netgear_readynas_init (void ) { -kirkwood_ge00_init (&netgear_readynas_ge00_data);kirkwood_pcie_init (KW_PCIE0 ); }
arch/arm/mach-kirkwood/board-ts219.c +0 -13
@@ -18,27 +18,14 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> -#include <linux/mv643xx_eth.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <mach/kirkwood.h> #include "common.h" #include "tsx1x-common.h" -static struct mv643xx_eth_platform_data qnap_ts219_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (8 ), -}; -void __init qnap_dt_ts219_init (void ) { -u32 dev, rev; - -kirkwood_pcie_id (&dev, &rev); -if (dev ==MV88F6282_DEV_ID ) - qnap_ts219_ge00_data.phy_addr =MV643XX_ETH_PHY_ADDR (0 ); - -kirkwood_ge00_init (&qnap_ts219_ge00_data); - pm_power_off = qnap_tsx1x_power_off; }
arch/arm/mach-kirkwood/board-usi_topkick.c deleted +0 -29
@@ -1,29 +0,0 @@ -/* -* Copyright 2012 (C), Jason Cooper <[email protected]> -* -* arch/arm/mach-kirkwood/board-usi_topkick.c -* -* USI Topkick Init for drivers not converted to flattened device tree yet. -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/mv643xx_eth.h> -#include <linux/gpio.h> -#include "common.h" - -static struct mv643xx_eth_platform_data topkick_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; - -void __init usi_topkick_init (void ) -{ -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&topkick_ge00_data); -}
Signature · 1 line
1.7.10.4
Re: [PATCH v4 11/12] ARM: kirkwood: remove redundant DT board files
Hi Sebastian,
Quoted 57 lines · Sebastian Hesselbarth
With DT support for
mv643xx_eth, board specific init for some boards now is unneccessary. Remove those board files,Kconfigentries, and corresponding entries inkirkwood_defconfig.Signed-off-by Sebastian Hesselbarth <[email protected]>---
Note:board-km_kirkwood.cis also removed, as Valentin Longchamp confirmed the lock-up is not caused by accessing clock gating registers but rather non-existent device registers. This will be addressed by dtsi separation for kirkwood and bobcat SoC variants.Changelog:
v3->v4:
- remove more boards that don't require board specific setupCc David Miller <[email protected]>Cc Lennert Buytenhek <[email protected]>Cc Jason Cooper <[email protected]>Cc Andrew Lunn <[email protected]>Cc Benjamin Herrenschmidt <[email protected]>Cc netdev at vger.kernel.orgCc linux-arm-kernel at lists.infradead.orgCc linuxppc-dev at lists.ozlabs.orgCc linux-kernel at vger.kernel.org--- arch/arm/configs/kirkwood_defconfig | 16 ---- arch/arm/mach-kirkwood/Kconfig | 117 ------------------------- arch/arm/mach-kirkwood/Makefile | 16 ---- arch/arm/mach-kirkwood/board-dnskw.c | 7 -- arch/arm/mach-kirkwood/board-dockstar.c | 32 ------- arch/arm/mach-kirkwood/board-dreamplug.c | 35 -------- arch/arm/mach-kirkwood/board-dt.c | 38 -------- arch/arm/mach-kirkwood/board-goflexnet.c | 34 ------- arch/arm/mach-kirkwood/board-guruplug.c | 33 ------- arch/arm/mach-kirkwood/board-ib62x0.c | 29 ------ arch/arm/mach-kirkwood/board-iconnect.c | 10 --- arch/arm/mach-kirkwood/board-iomega_ix2_200.c | 34 ------- arch/arm/mach-kirkwood/board-km_kirkwood.c | 44 ---------- arch/arm/mach-kirkwood/board-lsxl.c | 16 ---- arch/arm/mach-kirkwood/board-mplcec4.c | 14 --- arch/arm/mach-kirkwood/board-ns2.c | 35 -------- arch/arm/mach-kirkwood/board-openblocks_a6.c | 26 ------ arch/arm/mach-kirkwood/board-readynas.c | 6 -- arch/arm/mach-kirkwood/board-ts219.c | 13 --- arch/arm/mach-kirkwood/board-usi_topkick.c | 29 ------ 20 files changed, 584 deletions(-) delete mode 100644 arch/arm/mach-kirkwood/board-dockstar.c delete mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c delete mode 100644 arch/arm/mach-kirkwood/board-goflexnet.c delete mode 100644 arch/arm/mach-kirkwood/board-guruplug.c delete mode 100644 arch/arm/mach-kirkwood/board-ib62x0.c delete mode 100644 arch/arm/mach-kirkwood/board-iomega_ix2_200.c delete mode 100644 arch/arm/mach-kirkwood/board-km_kirkwood.c delete mode 100644 arch/arm/mach-kirkwood/board-ns2.c delete mode 100644 arch/arm/mach-kirkwood/board-openblocks_a6.c delete mode 100644 arch/arm/mach-kirkwood/board-usi_topkick.c
...
Quoted 53 lines
arch/arm/mach-kirkwood/board-dt.c +0
-32@@ -104,59 +104,21 @@ static void __init kirkwood_dt_init(void) kexec_reinit = kirkwood_enable_pcie;#endif -if (of_machine_is_compatible ("globalscale,dreamplug" )) -dreamplug_init (); - -if (of_machine_is_compatible ("globalscale,guruplug" )) -guruplug_dt_init (); -if (of_machine_is_compatible ("dlink,dns-kirkwood" ))dnskw_init (); -if (of_machine_is_compatible ("iom,iconnect" )) -iconnect_init (); - -if (of_machine_is_compatible ("raidsonic,ib-nas62x0" )) -ib62x0_init (); -if (of_machine_is_compatible ("qnap,ts219" ))qnap_dt_ts219_init (); -if (of_machine_is_compatible ("seagate,dockstar" )) -dockstar_dt_init (); - -if (of_machine_is_compatible ("seagate,goflexnet" )) -goflexnet_init (); -if (of_machine_is_compatible ("buffalo,lsxl" ))lsxl_init (); -if (of_machine_is_compatible ("iom,ix2-200" )) -iomega_ix2_200_init (); - -if (of_machine_is_compatible ("keymile,km_kirkwood" )) -km_kirkwood_init (); - -if (of_machine_is_compatible ("lacie,cloudbox" ) || -of_machine_is_compatible ("lacie,inetspace_v2" ) || -of_machine_is_compatible ("lacie,netspace_lite_v2" ) || -of_machine_is_compatible ("lacie,netspace_max_v2" ) || -of_machine_is_compatible ("lacie,netspace_mini_v2" ) || -of_machine_is_compatible ("lacie,netspace_v2" )) -ns2_init (); -if (of_machine_is_compatible ("mpl,cec4" ))mplcec4_init ();if (of_machine_is_compatible ("netgear,readynas-duo-v2" ))
arch/arm/mach-kirkwood/board-dt.c static void __init kirkwood_dt_init(void) · line 123
Quoted 10 lines
arch/arm/mach-kirkwood/board-dt.c +0
-6netgear_readynas_init (); -if (of_machine_is_compatible ("plathome,openblocks-a6" )) -openblocks_a6_init (); - -if (of_machine_is_compatible ("usi,topkick" )) -usi_topkick_init (); -of_platform_populate (NULL , kirkwood_dt_match_table,NULL ,NULL ); }
We still have:
static const char * const kirkwood_dt_board_compat[] = {
"globalscale,dreamplug",
"globalscale,guruplug",
"dlink,dns-320",
"dlink,dns-325",
"iom,iconnect",
"raidsonic,ib-nas62x0",
"qnap,ts219",
"seagate,dockstar",
"seagate,goflexnet",
"buffalo,lsxl",
"iom,ix2-200",
"keymile,km_kirkwood",
"lacie,cloudbox",
"lacie,inetspace_v2",
"lacie,netspace_lite_v2",
"lacie,netspace_max_v2",
"lacie,netspace_mini_v2",
"lacie,netspace_v2",
"mpl,cec4",
"netgear,readynas-duo-v2",
"plathome,openblocks-a6",
"usi,topkick",
"zyxel,nsa310",
NULL
};in that file. I think it does not make sense that we need to list boards here that can be described fully by DT. When adding such a board in the future, you will still need to adapt board-dt.c.
Should we remove the boards that you removed above here as well and add
"marvell,kirkwood-88f6192", "marvell,kirkwood-88f6281", "marvell,kirkwood-88f6282", "marvell,kirkwood-88f6283", "marvell,kirkwood-88f6702", "marvell,kirkwood-98DX4122",
or even just state "marvell,kirkwood"?
- Simon
Sebastian Hesselbarth
maintainerRe: [PATCH v4 11/12] ARM: kirkwood: remove redundant DT board files
Quoted 18 lines · Simon Baatz
Hi Sebastian,
Quoted 15 lines · Sebastian Hesselbarth
With DT support for
mv643xx_eth, board specific init for some boards now is unneccessary. Remove those board files,Kconfigentries, and corresponding entries inkirkwood_defconfig.Signed-off-by Sebastian Hesselbarth<[email protected]>---
Note:board-km_kirkwood.cis also removed, as Valentin Longchamp confirmed the lock-up is not caused by accessing clock gating registers but rather non-existent device registers. This will be addressed by dtsi separation for kirkwood and bobcat SoC variants.Changelog:
v3->v4:
- remove more boards that don't require board specific setup
...
Quoted 29 lines
We still have:
static const char * const kirkwood_dt_board_compat[] = { "globalscale,dreamplug", "globalscale,guruplug", "dlink,dns-320", "dlink,dns-325", "iom,iconnect", "raidsonic,ib-nas62x0", "qnap,ts219", "seagate,dockstar", "seagate,goflexnet", "buffalo,lsxl", "iom,ix2-200", "keymile,km_kirkwood", "lacie,cloudbox", "lacie,inetspace_v2", "lacie,netspace_lite_v2", "lacie,netspace_max_v2", "lacie,netspace_mini_v2", "lacie,netspace_v2", "mpl,cec4", "netgear,readynas-duo-v2", "plathome,openblocks-a6", "usi,topkick", "zyxel,nsa310", NULL };
Quoted 3 lines
in that file. I think it does not make sense that we need to list boards here that can be described fully by DT. When adding such a board in the future, you will still need to adapt
board-dt.c.
True, will remove the redundant compatible strings for v5. Actually, if I am not missing something, all compatible strings except "marvell,kirkwood" are redundant as long as board.dts append it correctly.
Quoted 11 lines
Should we remove the boards that you removed above here as well and add
"marvell,kirkwood-88f6192", "marvell,kirkwood-88f6281", "marvell,kirkwood-88f6282", "marvell,kirkwood-88f6283", "marvell,kirkwood-88f6702", "marvell,kirkwood-98DX4122",or even just state "marvell,kirkwood"?
I would stick with "marvell,kirkwood" only. This is SoC init code and we do not distinguish variants here at all.
Sebastian
Re: [PATCH v4 11/12] ARM: kirkwood: remove redundant DT board files
Quoted 68 lines · Sebastian Hesselbarth
Quoted 18 lines · Simon Baatz
Hi Sebastian,
Quoted 15 lines · Sebastian Hesselbarth
With DT support for
mv643xx_eth, board specific init for some boards now is unneccessary. Remove those board files,Kconfigentries, and corresponding entries inkirkwood_defconfig.Signed-off-by Sebastian Hesselbarth<[email protected]>---
Note:board-km_kirkwood.cis also removed, as Valentin Longchamp confirmed the lock-up is not caused by accessing clock gating registers but rather non-existent device registers. This will be addressed by dtsi separation for kirkwood and bobcat SoC variants.Changelog:
v3->v4:
- remove more boards that don't require board specific setup...
Quoted 29 lines
We still have:
static const char * const kirkwood_dt_board_compat[] = { "globalscale,dreamplug", "globalscale,guruplug", "dlink,dns-320", "dlink,dns-325", "iom,iconnect", "raidsonic,ib-nas62x0", "qnap,ts219", "seagate,dockstar", "seagate,goflexnet", "buffalo,lsxl", "iom,ix2-200", "keymile,km_kirkwood", "lacie,cloudbox", "lacie,inetspace_v2", "lacie,netspace_lite_v2", "lacie,netspace_max_v2", "lacie,netspace_mini_v2", "lacie,netspace_v2", "mpl,cec4", "netgear,readynas-duo-v2", "plathome,openblocks-a6", "usi,topkick", "zyxel,nsa310", NULL };Quoted 3 lines
in that file. I think it does not make sense that we need to list boards here that can be described fully by DT. When adding such a board in the future, you will still need to adapt
board-dt.c.True, will remove the redundant compatible strings for v5. Actually, if I am not missing something, all compatible strings except "marvell,kirkwood" are redundant as long as
board.dtsappend it correctly.Quoted 10 lines
Should we remove the boards that you removed above here as well and add
"marvell,kirkwood-88f6192", "marvell,kirkwood-88f6281", "marvell,kirkwood-88f6282", "marvell,kirkwood-88f6283", "marvell,kirkwood-88f6702", "marvell,kirkwood-98DX4122",
Quoted 4 lines
Quoted 1 line
or even just state "marvell,kirkwood"?
I would stick with "marvell,kirkwood" only. This is SoC init code and we do not distinguish variants here at all.
Agreed, nice catch Simon.
thx,
Jason.
Sebastian Hesselbarth
maintainerRe: [PATCH v4 11/12] ARM: kirkwood: remove redundant DT board files
Quoted 20 lines · Jason Cooper
Quoted 19 lines · Sebastian Hesselbarth
Quoted 18 lines · Simon Baatz
Hi Sebastian,
Quoted 15 lines · Sebastian Hesselbarth
With DT support for
mv643xx_eth, board specific init for some boards now is unneccessary. Remove those board files,Kconfigentries, and corresponding entries inkirkwood_defconfig.Signed-off-by Sebastian Hesselbarth<[email protected]>---
Note:board-km_kirkwood.cis also removed, as Valentin Longchamp confirmed the lock-up is not caused by accessing clock gating registers but rather non-existent device registers. This will be addressed by dtsi separation for kirkwood and bobcat SoC variants.Changelog:
v3->v4:
- remove more boards that don't require board specific setup
Quoted 6 lines
Quoted 4 lines
...
I would stick with "marvell,kirkwood" only. This is SoC init code and we do not distinguish variants here at all.
Agreed, nice catch Simon.
I just confirmed all kirkwood dts/dtsi properly set "marvell,kirkwood" in their compatible strings. Will remove all other comapatible strings from mach-kirkwood/board-dt.c as Simon suggested for v5.
Sebastian
Sebastian Hesselbarth
maintainerPATCH v4 12/12 ARM: orion5x: remove legacy mv643xx_eth board setup
In reply to Sebastian HesselbarthWith DT support for mv643xx_eth we do not need legacy platform_data based setup for DT enabled boards. This patch removes eth setup for all orion5x DT board files.
---
Cc: David Miller <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: netdev at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-kernel at vger.kernel.org
--- arch/arm/mach-orion5x/edmini_v2-setup.c | 10 ---------- 1 file changed, 10 deletions(-)
arch/arm/mach-orion5x/edmini_v2-setup.c +0 -10
@@ -24,7 +24,6 @@#include <linux/pci.h> #include <linux/irq.h> #include <linux/mtd/physmap.h> -#include <linux/mv643xx_eth.h> #include <linux/leds.h> #include <linux/gpio_keys.h> #include <linux/input.h>
@@ -96,14 +95,6 @@ static struct platform_device edmini_v2_nor_flash = { };/***************************************************************************** -* Ethernet -****************************************************************************/ - -static struct mv643xx_eth_platform_data edmini_v2_eth_data = { - .phy_addr =8 , -}; - -/***************************************************************************** * RTC 5C372a on I2C bus ****************************************************************************/
@@ -152,7 +143,6 @@ void __init edmini_v2_init(void)* Configure peripherals. */ orion5x_ehci0_init (); -orion5x_eth_init (&edmini_v2_eth_data);mvebu_mbus_add_window ("devbus-boot" ,EDMINI_V2_NOR_BOOT_BASE ,EDMINI_V2_NOR_BOOT_SIZE );
Signature · 1 line
1.7.10.4
Re: [PATCH v4 00/12] net: mv643xx_eth DT support and fixes
In reply to Sebastian HesselbarthQuoted 2 lines · Sebastian Hesselbarth
This patch set picks up work by Florian Fainelli bringing full DT support to
mv643xx_ethand Marvell SoCs using it.
Hi Sebastian
I tested on my QNAP and topkick. Works great.
Andrew
Sebastian Hesselbarth
maintainerPATCH 1/2 ARM: kirkwood: proper retain MAC address workaround on DT ethernet
In reply to Sebastian HesselbarthKirkwood ethernet controllers suffer from loosing MAC register content on gated clocks. In the past this was prevented by not gating the ethernet controller clocks. With DT support for mv643xx_eth and corresponding nodes available, a different approach is more reasonable.
This patch replaces the former clock gating workaround by parsing the ethernet controller nodes for *invalid* MAC addresses and overwrites the local-mac-address property with MAC register contents early. The clock can now properly gated in modular mv643xx_eth and DT agnostic boot loader scenarios because mv643xx_eth will find the stored MAC in the corresponding MAC address property.
---
Cc: David Miller <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: netdev at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-kernel at vger.kernel.org
--- arch/arm/mach-kirkwood/board-dt.c | 67 +++++++++++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 14 deletions(-)
arch/arm/mach-kirkwood/board-dt.c +53 -14
@@ -13,6 +13,8 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/of.h> +#include <linux/of_address.h> +#include <linux/of_net.h> #include <linux/of_platform.h> #include <linux/clk-provider.h> #include <linux/clk/mvebu.h>
@@ -31,6 +33,56 @@ static struct of_device_id kirkwood_dt_match_table[] __initdata = { };/* +* Kirkwood ethernet controllers suffer from loosing the MAC address +* register content on gated clocks. Rather than always ungate the +* clocks, we get the MAC address early and put it into DT for those +* boot loaders that don't provide a valid MAC address property. +*/ +#define ETH_MAC_ADDR_L (n) (0x400 + ((n) * 0x400) + 0x14) +#define ETH_MAC_ADDR_H (n) (0x400 + ((n) * 0x400) + 0x18) + +static void __init kirkwood_dt_eth_quirk (void ) +{ +struct device_node *np; + +for_each_compatible_node (np,NULL ,"marvell,orion-eth" ) { +struct device_node *pnp; +void __iomem *base; + +if (!of_device_is_available (np)) +continue ; + + base =of_iomap (np,0 ); +if (!base) +continue ; + +for_each_available_child_of_node (np, pnp) { +const void *mac_addr; +struct property *p; +u32 n, reg[2 ]; + + mac_addr =of_get_mac_address (pnp); +if (mac_addr) +continue ; + + p =of_find_property (pnp,"local-mac-address" ,NULL ); +if (!p || p->length !=6 ) +continue ; + +if (of_property_read_u32 (pnp,"reg" , &n)) +continue ; + + reg[0 ] =cpu_to_be32 (readl (base +ETH_MAC_ADDR_H (n))); + reg[1 ] =cpu_to_be32 (readl (base + +ETH_MAC_ADDR_L (n)) <<16 ); +memcpy ((void *)p->value, reg,6 ); + } + +iounmap (base); + } +} + +/* * There are still devices that doesn't know about DT yet. Get clock * gates here and add a clock lookup alias, so that old platform * devices still work.
@@ -42,7 +94,6 @@ static void __init kirkwood_legacy_clk_init(void)struct device_node *np =of_find_compatible_node (NULL ,NULL ,"marvell,kirkwood-gating-clock" );struct of_phandle_args clkspec; -struct clk *clk; clkspec.np = np; clkspec.args_count =1 ;
@@ -58,19 +109,6 @@ static void __init kirkwood_legacy_clk_init(void) clkspec.args[0 ] =CGC_BIT_SDIO ;orion_clkdev_add (NULL ,"mvsdio" ,of_clk_get_from_provider (&clkspec)); - -/* -* The ethernet interfaces forget the MAC address assigned by -* u-boot if the clocks are turned off. Until proper DT support -* is available we always enable them for now. -*/ - clkspec.args[0 ] =CGC_BIT_GE0 ; - clk =of_clk_get_from_provider (&clkspec); -clk_prepare_enable (clk); - - clkspec.args[0 ] =CGC_BIT_GE1 ; - clk =of_clk_get_from_provider (&clkspec); -clk_prepare_enable (clk); }static void __init kirkwood_of_clk_init (void )
@@ -97,6 +135,7 @@ static void __init kirkwood_dt_init(void)/* Setup root of clk tree */ kirkwood_of_clk_init (); +kirkwood_dt_eth_quirk ();kirkwood_cpuidle_init ();
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH 2/2 net: mv643xx_eth: proper initialization for Kirkwood SoCs
Ethernet controllers found on Kirkwood SoCs not only suffer from loosing MAC address register contents on clock gating but also some important registers are reset to values that would break ethernet. This patch clears the CLK125_BYPASS_EN bit for DT enabled Kirkwood only by using of_machine_is_compatible() instead of #ifdefs. Non-DT Kirkwood is not affected as it installs a clock gating workaround because of the MAC address issue above. Other Orion SoCs do not suffer from register reset, do not have the bit in question, or do not have the register at all. Moreover, system controllers on PPC using this driver should also be protected from clearing that bit.
---
Note: In contrast to the reset value of 0 for CLK125_BYPASS_EN bit as stated in Kirkwood datasheet, we confirmed that reset value is 1 instead. Either datasheet is wrong about it, there is some post-boot self-check or BootROM flips that bit.
--- drivers/net/ethernet/marvell/mv643xx_eth.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/net/ethernet/marvell/mv643xx_eth.c +10 -0
@@ -119,6 +119,8 @@ static char mv643xx_eth_driver_version[] = "1.4";#define LINK_UP 0x00000002#define TXQ_COMMAND 0x0048#define TXQ_FIX_PRIO_CONF 0x004c +#define PORT_SERIAL_CONTROL1 0x004c +#define CLK125_BYPASS_EN 0x00000010#define TX_BW_RATE 0x0050#define TX_BW_MTU 0x0058#define TX_BW_BURST 0x005c
@@ -2843,6 +2845,14 @@ static int mv643xx_eth_probe(struct platform_device *pdev) mp->dev = dev; +/* Kirkwood resets some registers on gated clocks. Especially +* CLK125_BYPASS_EN must be cleared but is not available on +* all other SoCs/System Controllers using this driver. +*/ +if (of_machine_is_compatible ("marvell,kirkwood" )) +wrlp (mp,PORT_SERIAL_CONTROL1 , +rdlp (mp,PORT_SERIAL_CONTROL1 ) & ~CLK125_BYPASS_EN ); +/* * Start with a default rate, and if there is a clock, allow * it to override the default.
Signature · 1 line
1.7.10.4
Re: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs
Quoted 3 lines · Sebastian Hesselbarth
Ethernet controllers found on Kirkwood SoCs not only suffer from loosing MAC address register contents on clock gating but also some important registers are reset to values that would break ethernet. This patch
FWIW, we found that the bootloader has to write to PSC1, the driver doesn't work with the power on/reset value of the register. So I think it is safe to assume that all kirkwood bootloaders alter the value.
Our systems write the value 0x00638488 to PSC1.
I looked at patching mv643xx_eth, but ran into the same complexity you did, it isn't clear what variants of this IP block have the register/etc.
drivers/net/ethernet/marvell/mv643xx_eth.c static int mv643xx_eth_probe(struct platform_device *pdev) · line 2854
Quoted 7 lines
drivers/net/ethernet/marvell/mv643xx_eth.c +7
-0+/* Kirkwood resets some registers on gated clocks. Especially +* CLK125_BYPASS_EN must be cleared but is not available on +* all other SoCs/System Controllers using this driver. +*/ +if (of_machine_is_compatible ("marvell,kirkwood" )) +wrlp (mp,PORT_SERIAL_CONTROL1 , +rdlp (mp,PORT_SERIAL_CONTROL1 ) & ~CLK125_BYPASS_EN );
of_machine_is_compatible seems heavy handed, I would expect this to be based on the compatible string of the ethernet node itself, not the machine??
Jason
Sebastian Hesselbarth
maintainerRe: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs
Quoted 8 lines · Jason Gunthorpe
Quoted 3 lines · Sebastian Hesselbarth
Ethernet controllers found on Kirkwood SoCs not only suffer from loosing MAC address register contents on clock gating but also some important registers are reset to values that would break ethernet. This patch
FWIW, we found that the bootloader has to write to PSC1, the driver doesn't work with the power on/reset value of the register. So I think it is safe to assume that all kirkwood bootloaders alter the value.
It is safe to assume the bootloader alters it, but that modification is lost when clocks get gated. I assume on clock ungate, the controller is reset. Saying this, I will double check Dove's reset value but looks like reset mess has been fixed in that later SoC.
Quoted 5 lines
Our systems write the value
0x00638488to PSC1.I looked at patching
mv643xx_eth, but ran into the same complexity you did, it isn't clear what variants of this IP block have the register/etc.
For Orion SoCs it is quite clear to me, with Gregory Clement and Thomas Petazzoni we could also confirm if it does any harm there if we unconditionally clear it. But for PPC system controllers I have no idea...
Quoted 11 lines
drivers/net/ethernet/marvell/mv643xx_eth.c static int mv643xx_eth_probe(struct platform_device *pdev)
Quoted 7 lines
drivers/net/ethernet/marvell/mv643xx_eth.c +7
-0+/* Kirkwood resets some registers on gated clocks. Especially +* CLK125_BYPASS_EN must be cleared but is not available on +* all other SoCs/System Controllers using this driver. +*/ +if (of_machine_is_compatible ("marvell,kirkwood" )) +wrlp (mp,PORT_SERIAL_CONTROL1 , +rdlp (mp,PORT_SERIAL_CONTROL1 )& ~CLK125_BYPASS_EN );
of_machine_is_compatibleseems heavy handed, I would expect this to be based on the compatible string of the ethernet node itself, not the machine??
I have no strong opinion about checking the machine compatible or have an extra compatible string for Kirkwood ethernet. Both would work fine and are checked once upon probe anyway.
Sebastian
Re: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs
In reply to Jason GunthorpeSebastian,
Quoted 16 lines · Jason Gunthorpe
Quoted 3 lines · Sebastian Hesselbarth
Ethernet controllers found on Kirkwood SoCs not only suffer from loosing MAC address register contents on clock gating but also some important registers are reset to values that would break ethernet. This patch
FWIW, we found that the bootloader has to write to PSC1, the driver doesn't work with the power on/reset value of the register. So I think it is safe to assume that all kirkwood bootloaders alter the value.
Our systems write the value
0x00638488to PSC1.I looked at patching
mv643xx_eth, but ran into the same complexity you did, it isn't clear what variants of this IP block have the register/etc.
Quoted 11 lines
drivers/net/ethernet/marvell/mv643xx_eth.c static int mv643xx_eth_probe(struct platform_device *pdev) · line 2854
Quoted 7 lines
drivers/net/ethernet/marvell/mv643xx_eth.c +7
-0+/* Kirkwood resets some registers on gated clocks. Especially +* CLK125_BYPASS_EN must be cleared but is not available on +* all other SoCs/System Controllers using this driver. +*/ +if (of_machine_is_compatible ("marvell,kirkwood" )) +wrlp (mp,PORT_SERIAL_CONTROL1 , +rdlp (mp,PORT_SERIAL_CONTROL1 ) & ~CLK125_BYPASS_EN );
of_machine_is_compatibleseems heavy handed, I would expect this to be based on the compatible string of the ethernet node itself, not the machine??
Is there a model number variation between IP that needs this and IP that doesn't? If not, I'm fine with of_machine_is_compatible().
thx,
Jason.
Re: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs
Quoted 12 lines · Jason Cooper
Quoted 11 lines
drivers/net/ethernet/marvell/mv643xx_eth.c static int mv643xx_eth_probe(struct platform_device *pdev) · line 2854
Quoted 7 lines
drivers/net/ethernet/marvell/mv643xx_eth.c +7
-0+/* Kirkwood resets some registers on gated clocks. Especially +* CLK125_BYPASS_EN must be cleared but is not available on +* all other SoCs/System Controllers using this driver. +*/ +if (of_machine_is_compatible ("marvell,kirkwood" )) +wrlp (mp,PORT_SERIAL_CONTROL1 , +rdlp (mp,PORT_SERIAL_CONTROL1 ) & ~CLK125_BYPASS_EN );
of_machine_is_compatibleseems heavy handed, I would expect this to be based on the compatible string of the ethernet node itself, not the machine??
Quoted 2 lines
Is there a model number variation between IP that needs this and IP that doesn't? If not, I'm fine with
of_machine_is_compatible().
Well the name 'mv643xx' is a family of system controller SOC's from ages ago, it seems reasonble to continue the trend and label the IP variations with the SOC name:
compatible = "marvell,kirwood,ethernet", "marvell,mv643xx_eth"
Jason
Re: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs
Quoted 13 lines · Jason Gunthorpe
Quoted 12 lines · Jason Cooper
Quoted 11 lines
drivers/net/ethernet/marvell/mv643xx_eth.c static int mv643xx_eth_probe(struct platform_device *pdev) · line 2854
Quoted 7 lines
drivers/net/ethernet/marvell/mv643xx_eth.c +7
-0+/* Kirkwood resets some registers on gated clocks. Especially +* CLK125_BYPASS_EN must be cleared but is not available on +* all other SoCs/System Controllers using this driver. +*/ +if (of_machine_is_compatible ("marvell,kirkwood" )) +wrlp (mp,PORT_SERIAL_CONTROL1 , +rdlp (mp,PORT_SERIAL_CONTROL1 ) & ~CLK125_BYPASS_EN );
of_machine_is_compatibleseems heavy handed, I would expect this to be based on the compatible string of the ethernet node itself, not the machine??
Quoted 8 lines
Quoted 2 lines
Is there a model number variation between IP that needs this and IP that doesn't? If not, I'm fine with
of_machine_is_compatible().Well the name 'mv643xx' is a family of system controller SOC's from ages ago, it seems reasonble to continue the trend and label the IP variations with the SOC name:
compatible = "marvell,kirwood,ethernet", "marvell,mv643xx_eth"
Shouldn't it rather be
compatible = "marvell,kirkwood-eth", "marvell,orion-eth";
I'm inclined to go with of_machine_is_compatible() since the only concrete difference we know is that the tweak is needed on kirkwood and nowhere else.
If we had an errata, or a datasheet saying specifically flavor X needs this and none other does, then we could trigger on the ethernet node compatible string or a boolean in the node. But we don't have that...
thx,
Jason.
Re: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs
Quoted 3 lines · Jason Cooper
Shouldn't it rather be
compatible = "marvell,kirkwood-eth", "marvell,orion-eth";
Not sure about orion-eth?
Quoted 3 lines
I'm inclined to go with
of_machine_is_compatible()since the only concrete difference we know is that the tweak is needed on kirkwood and nowhere else.
But there is a larger problem here then just this one bit.
The PSC1 register must be set properly for the board layout, and today we rely on the bootloader to set it. In fact, even with Sebastian's change the ethernet port won't work without bootloader intervention. The PortReset bit should also be cleared by the driver (and it is only present on some variants of this IP block, apparently).
We know that some Marvell SOC's wack the ethernet registers when they clock gate, and the flip of Clk125Bypass is another symptom of this general problem.
So, long term, the PSC1 must be fully set by the driver, based on DT information describing the board (eg RGMII/MII/1000Base-X [SFP] Phy type), and the layout of this register seems to vary on a SOC by SOC basis.
Thus, I think it is appropriate to call this variant of the eth IP 'marvell,kirkwood-eth' which indicates that the register block follows the kirkwood manual and the PSC1 register specifically has the kirkwood layout.
The question is what other Marvell SOCs have the same PSC1 layout as kirkwood?
Jason
Re: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs
Quoted 30 lines · Jason Gunthorpe
Quoted 3 lines · Jason Cooper
Shouldn't it rather be
compatible = "marvell,kirkwood-eth", "marvell,orion-eth";Not sure about orion-eth?
Quoted 3 lines
I'm inclined to go with
of_machine_is_compatible()since the only concrete difference we know is that the tweak is needed on kirkwood and nowhere else.But there is a larger problem here then just this one bit.
The PSC1 register must be set properly for the board layout, and today we rely on the bootloader to set it. In fact, even with Sebastian's change the ethernet port won't work without bootloader intervention. The PortReset bit should also be cleared by the driver (and it is only present on some variants of this IP block, apparently).
We know that some Marvell SOC's wack the ethernet registers when they clock gate, and the flip of Clk125Bypass is another symptom of this general problem.
So, long term, the PSC1 must be fully set by the driver, based on DT information describing the board (eg RGMII/MII/1000Base-X [SFP] Phy type), and the layout of this register seems to vary on a SOC by SOC basis.
Quoted 4 lines
Thus, I think it is appropriate to call this variant of the eth IP 'marvell,kirkwood-eth' which indicates that the register block follows the kirkwood manual and the PSC1 register specifically has the kirkwood layout.
Ok, so mv643xx_eth would match both "marvell,orion-eth" and "marvell,kirkwood-eth", then write to PSC1 iff it sees a node matching "marvell,kirkwood-eth". I'm not too keen on that, however, the matching of the machine doesn't look to good, either.
Perhaps a better answer is to add a boolean, "marvell,kirkwood_psc1" and check for that?
Or, marvell,psc1_reset = <0xWWXXYYZZ>;
Quoted 2 lines
The question is what other Marvell SOCs have the same PSC1 layout as kirkwood?
I think marvell,psc1_reset = <>; gives us the most flexibility in accurately describing the hardware.
thx,
Jason.
Re: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs
Quoted 23 lines · Jason Cooper
Quoted 18 lines
But there is a larger problem here then just this one bit.
The PSC1 register must be set properly for the board layout, and today we rely on the bootloader to set it. In fact, even with Sebastian's change the ethernet port won't work without bootloader intervention. The PortReset bit should also be cleared by the driver (and it is only present on some variants of this IP block, apparently).
We know that some Marvell SOC's wack the ethernet registers when they clock gate, and the flip of Clk125Bypass is another symptom of this general problem.
So, long term, the PSC1 must be fully set by the driver, based on DT information describing the board (eg RGMII/MII/1000Base-X [SFP] Phy type), and the layout of this register seems to vary on a SOC by SOC basis.
Quoted 4 lines
Thus, I think it is appropriate to call this variant of the eth IP 'marvell,kirkwood-eth' which indicates that the register block follows the kirkwood manual and the PSC1 register specifically has the kirkwood layout.
Quoted 4 lines
Ok, so
mv643xx_ethwould match both "marvell,orion-eth" and "marvell,kirkwood-eth", then write to PSC1 iff it sees a node matching "marvell,kirkwood-eth". I'm not too keen on that, however, the matching of the machine doesn't look to good, either.
Why are you not keen on this? It seems like normal device driver practice, that is what the data field of of_device_id is typically used for..
There are more compatible strings than just kirkwood and orion in this driver, the whole TX_BW_CONTROL_OLD_LAYOUT/TX_BW_CONTROL_NEW_LAYOUT buisness (affecting PPC/MIPS) should also someday be captured with compatible strings rather than auto-detection too..
Quoted 5 lines
Quoted 2 lines
The question is what other Marvell SOCs have the same PSC1 layout as kirkwood?
I think marvell,psc1_reset = <>; gives us the most flexibility in accurately describing the hardware.
Agree, providing psc1_reset value is a good idea to setup the phy modes. If all 'orion' SOCs have the PSC1 value then we don't need the kirkwood differentiators, especially if things like the reset bit are in the same place.
The same trick Sebastian used to capture the mac address could be used to capture the PSC1 value from the bootloader.
Basically, I think any IP variants that have idential register layouts can share a compatible string, otherwise different layouts need different compatible strings, so the general format:
compatible = "marvell,SOCNAME-eth", "marvell,<something>-eth";
Seems very sane to me. At least this way if we discover more changes then the driver can match on the SOCNAME compatible string to find them.
<someting> = orion for TX_BW_CONTROL_NEW_LAYOUT variants also seems reasonable..
No idea what to call TX_BW_CONTROL_OLD_LAYOUT variants, or the PPC variants, not important right now it seems.
(BTW, I wonder if the driver should ideally toggle PSC1 reset at some point????)
Jason
Re: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs
Quoted 25 lines · Jason Gunthorpe
Quoted 23 lines · Jason Cooper
Quoted 22 lines
But there is a larger problem here then just this one bit.
The PSC1 register must be set properly for the board layout, and today we rely on the bootloader to set it. In fact, even with Sebastian's change the ethernet port won't work without bootloader intervention. The PortReset bit should also be cleared by the driver (and it is only present on some variants of this IP block, apparently).
We know that some Marvell SOC's wack the ethernet registers when they clock gate, and the flip of Clk125Bypass is another symptom of this general problem.
So, long term, the PSC1 must be fully set by the driver, based on DT information describing the board (eg RGMII/MII/1000Base-X [SFP] Phy type), and the layout of this register seems to vary on a SOC by SOC basis.
Thus, I think it is appropriate to call this variant of the eth IP 'marvell,kirkwood-eth' which indicates that the register block follows the kirkwood manual and the PSC1 register specifically has the kirkwood layout.
Quoted 8 lines
Quoted 4 lines
Ok, so
mv643xx_ethwould match both "marvell,orion-eth" and "marvell,kirkwood-eth", then write to PSC1 iff it sees a node matching "marvell,kirkwood-eth". I'm not too keen on that, however, the matching of the machine doesn't look to good, either.Why are you not keen on this? It seems like normal device driver practice, that is what the data field of
of_device_idis typically used for..
I'm not keen on it because we don't have a document saying "All kirkwood SoCs need PSC1 set to X after reset." We know it, but have we tested the 6282?
That being said, if "marvell,kirkwood-eth" is the best we can do for now, I'm all for it. I would just like to be reasonably certain that the binding we are creating doesn't lock us into a difficult decision later.
Quoted 4 lines
There are more compatible strings than just kirkwood and orion in this driver, the whole TX_BW_CONTROL_OLD_LAYOUT/TX_BW_CONTROL_NEW_LAYOUT buisness (affecting PPC/MIPS) should also someday be captured with compatible strings rather than auto-detection too..
Agreed.
Quoted 18 lines
Quoted 5 lines
Quoted 2 lines
The question is what other Marvell SOCs have the same PSC1 layout as kirkwood?
I think marvell,psc1_reset = <>; gives us the most flexibility in accurately describing the hardware.
Agree, providing
psc1_resetvalue is a good idea to setup the phy modes. If all 'orion' SOCs have the PSC1 value then we don't need the kirkwood differentiators, especially if things like the reset bit are in the same place.The same trick Sebastian used to capture the mac address could be used to capture the PSC1 value from the bootloader.
Basically, I think any IP variants that have idential register layouts can share a compatible string, otherwise different layouts need different compatible strings, so the general format:
Quoted 5 lines
compatible = "marvell,SOCNAME-eth", "marvell,<something>-eth";
Seems very sane to me. At least this way if we discover more changes then the driver can match on the SOCNAME compatible string to find them.
After glancing a LinusW's email, I'm thinking this isn't the correct path. I'll write more in my response to him.
thx,
Jason.
Andrew Lunn
maintainerRe: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs
Quoted 7 lines
Quoted 3 lines
Why are you not keen on this? It seems like normal device driver practice, that is what the data field of
of_device_idis typically used for..I'm not keen on it because we don't have a document saying "All kirkwood SoCs need PSC1 set to X after reset." We know it, but have we tested the 6282?
6282 looses its MAC address, that much i know. I've no idea about PSC1, but if its MAC address behaviour is the same as 6281, is expect PSC1 is the same.
Andrew
Re: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs
Quoted 11 lines · Andrew Lunn
Quoted 7 lines
Quoted 3 lines
Why are you not keen on this? It seems like normal device driver practice, that is what the data field of
of_device_idis typically used for..I'm not keen on it because we don't have a document saying "All kirkwood SoCs need PSC1 set to X after reset." We know it, but have we tested the 6282?
6282 looses its MAC address, that much i know. I've no idea about PSC1, but if its MAC address behaviour is the same as 6281, is expect PSC1 is the same.
Do you have a board set up for testing you could try Sebastian's forthcoming series on (with "marvell,kirkwood-eth")?
thx,
Jason.
Re: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs
In reply to Jason CooperQuoted 7 lines · Jason Cooper
Quoted 3 lines
Why are you not keen on this? It seems like normal device driver practice, that is what the data field of
of_device_idis typically used for..I'm not keen on it because we don't have a document saying "All kirkwood SoCs need PSC1 set to X after reset." We know it, but have we tested the 6282?
I disagree. The manul is very clear how PSC1 must be set for proper operation. Clk125BypassEn bit is used only for loopback testing, it should never set for driver operation. Similarly PortReset must be cleared for driver operation.
It is always safe for the driver to clear these bits, if it knows they are available. In fact, I would argue the driver should always clear these bits so that the bootloader isn't relied on to do it. It doesn't matter if the SOC errantly sets the bit or not, it can *always* be safely cleared.
Further, I compared my 88F6282/88F6283 manual against the public 88F6180/88F619x/88F6281 spec and confirmed that the PSC1 layout is the same.
So all of these SOC's can share a driver compatible string.
AFAICT the only reason the driver doesn't touch PSC1 today is because the PSC1 was introduced in a later IP revision and its presence isn't auto-detectable.
The last bit of the puzzle to get bootloader independence on kirkwood is to encode the phy interface type (GMII/RGMII/BASE-X) in the DT so the entire PSC1 can be set by the driver..
Jason
Re: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs
Jason,
Sorry, I meant to get back to this earlier and it slipped off of my plate. :(
Quoted 15 lines · Jason Gunthorpe
Quoted 7 lines · Jason Cooper
Quoted 3 lines
Why are you not keen on this? It seems like normal device driver practice, that is what the data field of
of_device_idis typically used for..I'm not keen on it because we don't have a document saying "All kirkwood SoCs need PSC1 set to X after reset." We know it, but have we tested the 6282?
I disagree. The manul is very clear how PSC1 must be set for proper operation. Clk125BypassEn bit is used only for loopback testing, it should never set for driver operation. Similarly PortReset must be cleared for driver operation.
Quoted 5 lines
It is always safe for the driver to clear these bits, if it knows they are available. In fact, I would argue the driver should always clear these bits so that the bootloader isn't relied on to do it. It doesn't matter if the SOC errantly sets the bit or not, it can *always* be safely cleared.
Great!
Quoted 3 lines
Further, I compared my 88F6282/88F6283 manual against the public 88F6180/88F619x/88F6281 spec and confirmed that the PSC1 layout is the same.
Even better.
Quoted 1 line
So all of these SOC's can share a driver compatible string.
Ok, "marvell,kirkwood-eth" works for me then. I think Sebastian already has patches for that.
Quoted 3 lines
AFAICT the only reason the driver doesn't touch PSC1 today is because the PSC1 was introduced in a later IP revision and its presence isn't auto-detectable.
Makes sense.
Quoted 3 lines
The last bit of the puzzle to get bootloader independence on kirkwood is to encode the phy interface type (GMII/RGMII/BASE-X) in the DT so the entire PSC1 can be set by the driver..
Hmm, let's work on that separately, and later. I've snowballed this attempt enough ;-)
Thanks for digging into this for us,
Jason.
Sebastian Hesselbarth
maintainerRe: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs
In reply to Jason CooperQuoted 7 lines · Jason Cooper
Quoted 6 lines · Jason Gunthorpe
Quoted 3 lines · Jason Cooper
Shouldn't it rather be
compatible = "marvell,kirkwood-eth", "marvell,orion-eth";Not sure about orion-eth?
Jason, Jason,
sorry I didn't came back to this conversation earlier. I already reworked the patch to rely on of_device_is_compatible(.."marvell,kirkwood-eth"..). This is a kirkwood only thing as other Orions cannot do clock gating or retain critcal register content (Dove). I will stick with orion-eth for all other and maybe introduce new compatible strings (and new fixes) as soon as issues surface.
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
I'm inclined to go with
of_machine_is_compatible()since the only concrete difference we know is that the tweak is needed on kirkwood and nowhere else.
Quoted 8 lines
Quoted 8 lines
But there is a larger problem here then just this one bit.
The PSC1 register must be set properly for the board layout, and today we rely on the bootloader to set it. In fact, even with Sebastian's change the ethernet port won't work without bootloader intervention. The PortReset bit should also be cleared by the driver (and it is only present on some variants of this IP block, apparently).
Actually, fixing modular scenarios is only for the sake of multiarch someday. I don't see the point in running current kernel without eth compiled in _on a NAS SoC_ ;)
On Dockstar which I tested, clearing CLK125_BYPASS_EN to make it work after clock gating, it might be a coincidence that bootloader's PSC1 setup matches reset value here - so please test the patch on other Kirkwood boards also.
But, as long as no other issue arise, I will not start to modifiy mv643xx_eth out of the blue. I has been working for ages and breaking PPC is not my intention. There are other things David Miller already requested to get fixed and honestly I even thought about a fresh start for it. Maybe I'll come back to it when barebox gets it's driver someday.
Quoted 3 lines
Quoted 3 lines
We know that some Marvell SOC's wack the ethernet registers when they clock gate, and the flip of Clk125Bypass is another symptom of this general problem.
Which SoCs except Kirkwood? I cannot reproduce any of this behavior on Dove - and from what I can see from the FS of Orion5x or MV78x00 there are no clock gating registers.
Quoted 4 lines
Quoted 4 lines
So, long term, the PSC1 must be fully set by the driver, based on DT information describing the board (eg RGMII/MII/1000Base-X [SFP] Phy type), and the layout of this register seems to vary on a SOC by SOC basis.
Agree, but I tend to not go at it now. mv643xx_eth has never set up that registers and actually it never connects anything else than GMII phy (or no phy at all). The latter is easy but the for the other, I like to give up that brain-dead multi-device driver and stick with one device for both shared and up to three ports. From what I can see from e.g. ixgbe or any other multi-port eth drivers they all attach the network device to a single (pci) device.
Quoted 9 lines
Quoted 4 lines
Thus, I think it is appropriate to call this variant of the eth IP 'marvell,kirkwood-eth' which indicates that the register block follows the kirkwood manual and the PSC1 register specifically has the kirkwood layout.
Ok, so
mv643xx_ethwould match both "marvell,orion-eth" and "marvell,kirkwood-eth", then write to PSC1 iff it sees a node matching "marvell,kirkwood-eth". I'm not too keen on that, however, the matching of the machine doesn't look to good, either.
I didn't choose "marvell,mv643xx-eth" for two reasons
(a) The DT layout is slightly different with phy-handle instead of phy and marvell prefixed properties. Choosing a compatible string that matches any PPC compatible string will cause driver racing with sysdev code to set up platform_data.
(b) I chose to name the controller "orion-eth" and the port "orion-eth-port" .. PPC has "mv64360-eth" for the port and some "mv64360-eth-block" or "-group" for the controller. IMHO not intuitive, but it just a name anyway.
Quoted 4 lines
Perhaps a better answer is to add a boolean, "marvell,kirkwood_psc1" and check for that?
Or, marvell,psc1_reset =<0xWWXXYYZZ>;
For the _long_ run: Exploit either already present phy properties for MII and friends or introduce new marvell prefixed .. but not misuse DT for register values here. Each SoC should setup mv643xx_eth properly, but that should be based on a clean approach _and_ enough people willing to test that.
I just have a Dockstar and Topkick which is running 24/7. I didn't even check if only 6281 suffers from it or also 6282 or maybe only some revisions of 6281. This patch is a fix, nothing more nothing less. If you have Kirkwoods around, please test if it suffers from loosing the MAC address and if it works after insmod with the fix installed.
Quoted 5 lines
Quoted 2 lines
The question is what other Marvell SOCs have the same PSC1 layout as kirkwood?
I think marvell,psc1_reset =<>; gives us the most flexibility in accurately describing the hardware.
IMHO using that is just another workaround for a broken driver. We could hack the whole register setup in DT as it would still accurately describe HW. Don't get me wrong, but I don't like it.
Haven't checked how happy Linus Walleij is about pinctrl drivers with reg values hacked in lately.
Sebastian
Re: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs
Quoted 6 lines · Sebastian Hesselbarth
Quoted 2 lines · Jason Cooper
I think marvell,psc1_reset =<>; gives us the most flexibility in accurately describing the hardware.
Quoted 6 lines
IMHO using that is just another workaround for a broken driver. We could hack the whole register setup in DT as it would still accurately describe HW. Don't get me wrong, but I don't like it.
Haven't checked how happy Linus Walleij is about pinctrl drivers with reg values hacked in lately.
One of the things I've been ranting about lately is that Linux subsystem maintainers have become de-facto device tree standard commite chairs. :-(
So to the actual question:
In general I think we need to draw a line and define what we mean with "describing the hardware" in a device tree.
We have some consensus:
- <reg> properties to describe regsiter BASE offset in physical memory and size.
- Resources like IRQ, DMA channel, regulator, GPIO pin control handles, are passed using <&ersand> notation.
And so it goes on.
When it comes to defining different registers and their individual bits and the meaning of these and/or default values, I personally think that is making things harder for developers rather than simplifying things. I know that pinctrl-single is anyway doing this and I was talked into accepting it under circumstances where developers are being passed opaque machine-generated data that would otherwise be translated into unreadable header files littering the kernel.
For a coder it is definately better if the *driver* know these details, but whether that is possible seems to depend on things like hardware development process.
IMO: if you want to go down that road, what you really want is not ever more expressible device trees, but real open firmware, or ACPI or UEFI that can interpret and run bytecode as some "bios" for you. With DT coming from OF maybe this is a natural progression of things, but one has to realize when we reach the point where what we really want is a bios. Then your time is likely better spent with Tianocore or something than with the kernel.
Yours,
Linus Walleij
Re: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs
Quoted 12 lines · Linus Walleij
Quoted 10 lines · Sebastian Hesselbarth
Quoted 2 lines · Jason Cooper
I think marvell,psc1_reset =<>; gives us the most flexibility in accurately describing the hardware.
IMHO using that is just another workaround for a broken driver. We could hack the whole register setup in DT as it would still accurately describe HW. Don't get me wrong, but I don't like it.
Quoted 6 lines
Quoted 2 lines
Haven't checked how happy Linus Walleij is about pinctrl drivers with reg values hacked in lately.
One of the things I've been ranting about lately is that Linux subsystem maintainers have become de-facto device tree standard commite chairs. :-(
This is the first I've heard this rant. :(
To that end, I agree with you. My frustration boiled down to trying to predict the future, which is futile. :-P
For our scenario, once we can confirm our least popular kirkwood variant, the 6282, behaves the same as we've seen so far, then "marvell,kirkwood-eth" is fine by me.
Quoted 22 lines
So to the actual question:
In general I think we need to draw a line and define what we mean with "describing the hardware" in a device tree.
We have some consensus:
- <reg> properties to describe regsiter BASE offset in physical memory and size.
- Resources like IRQ, DMA channel, regulator, GPIO pin control handles, are passed using <&ersand> notation.And so it goes on.
When it comes to defining different registers and their individual bits and the meaning of these and/or default values, I personally think that is making things harder for developers rather than simplifying things. I know that pinctrl-single is anyway doing this and I was talked into accepting it under circumstances where developers are being passed opaque machine-generated data that would otherwise be translated into unreadable header files littering the kernel.
Quoted 3 lines
For a coder it is definately better if the *driver* know these details, but whether that is possible seems to depend on things like hardware development process.
Agree.
Quoted 8 lines
IMO: if you want to go down that road, what you really want is not ever more expressible device trees, but real open firmware, or ACPI or UEFI that can interpret and run bytecode as some "bios" for you. With DT coming from OF maybe this is a natural progression of things, but one has to realize when we reach the point where what we really want is a bios. Then your time is likely better spent with Tianocore or something than with the kernel.
shudder. I like embedded systems because the *don't* have a bios.
thx,
Jason.
Re: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs
Quoted 11 lines · Jason Cooper
Quoted 8 lines · Linus Walleij
IMO: if you want to go down that road, what you really want is not ever more expressible device trees, but real open firmware, or ACPI or UEFI that can interpret and run bytecode as some "bios" for you. With DT coming from OF maybe this is a natural progression of things, but one has to realize when we reach the point where what we really want is a bios. Then your time is likely better spent with Tianocore or something than with the kernel.
shudder. I like embedded systems because the *don't* have a bios.
Then you're into scenarios like I have with my laptop, where - those of you who check the nightly build results will have noticed - one of my serial ports doesn't always exist. That's because the ACPI data in the BIOS is *wrong*. It reports that it has been enabled when it hasn't, and the disassembled byte code is at fault here.
The fix? God knows. As far as I'm concerned as a user, or even as an OS developer, it's unfixable without getting the ACPI data structures changed, and that's not something I can do.
Do you really want that on ARM? Given the fiasco with the location of the registers, are you sure you want to place more trust in that direction? Does it give you a warm fuzzy feeling to know that you might have to work out some way to patch vendor supplied bytecode?
Sebastian Hesselbarth
maintainerRe: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs
Quoted 4 lines · Russell King - ARM Linux
Do you really want that on ARM? Given the fiasco with the location of the registers, are you sure you want to place more trust in that direction? Does it give you a warm fuzzy feeling to know that you might have to work out some way to patch vendor supplied bytecode?
Don't get me wrong. I want mv643xx_eth DT or even platform_data to evolve to a fully self configured driver not depending on proper u-boot setup at all.
But I don't want to go that road now and I wonder if it might be safer for us (and PPC guys) if we start mv643xx_eth over from scratch one day.
For this patch set, I want a basic DT binding that works. Patching the driver to play with kirkwood loosing the MAC and other important registers is not my main concern here. If clearing that one bit doesn't help for all kirkwood boards, I'd rather leave the non-gating workaround.
mv643xx_eth not knowing DT for ARM is stalling last important bits for Orion SoCs. I want this to go in first as with David another maintainer is involved.
Sebastian
Re: [PATCH 2/2] net: mv643xx_eth: proper initialization for Kirkwood SoCs
In reply to Sebastian HesselbarthQuoted 8 lines · Sebastian Hesselbarth
Quoted 7 lines · Jason Cooper
Quoted 6 lines · Jason Gunthorpe
Quoted 3 lines · Jason Cooper
Shouldn't it rather be
compatible = "marvell,kirkwood-eth", "marvell,orion-eth";Not sure about orion-eth?
Sorry, yep, one or the other.
Quoted 1 line
Jason, Jason,
For a second, I read this as "tsk tsk tsk..." ;-)
Quoted 7 lines
sorry I didn't came back to this conversation earlier. I already reworked the patch to rely on
of_device_is_compatible(.."marvell,kirkwood-eth"..). This is a kirkwood only thing as other Orions cannot do clock gating or retain critcal register content (Dove). I will stick with orion-eth for all other and maybe introduce new compatible strings (and new fixes) as soon as issues surface.
Okay, as I mentioned to Jason, I would like to test 6282 before we settle on this path. Other than that, I'm fine with it.
Quoted 13 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
I'm inclined to go with
of_machine_is_compatible()since the only concrete difference we know is that the tweak is needed on kirkwood and nowhere else.Quoted 8 lines
Quoted 8 lines
But there is a larger problem here then just this one bit.
The PSC1 register must be set properly for the board layout, and today we rely on the bootloader to set it. In fact, even with Sebastian's change the ethernet port won't work without bootloader intervention. The PortReset bit should also be cleared by the driver (and it is only present on some variants of this IP block, apparently).
Quoted 3 lines
Actually, fixing modular scenarios is only for the sake of multiarch someday. I don't see the point in running current kernel without eth compiled in
_ona NASSoC_;)
Good point, but if the eth can be gated to save power, we shouldn't limit the user's ability just because the SoC is primarily in NAS's.
thx,
Jason.
David Miller
maintainerRe: [PATCH 1/2] ARM: kirkwood: proper retain MAC address workaround on DT ethernet
In reply to Sebastian HesselbarthFrom: Sebastian Hesselbarth <[email protected]>
Date: Wed, 22 May 2013 22:04:01 +0200
arch/arm/mach-kirkwood/board-dt.c static struct of_device_id kirkwood_dt_match_table[] __initdata = { · line 78
Quoted 1 line
arch/arm/mach-kirkwood/board-dt.c +1
-0+memcpy ((void *)p->value, reg,6 );
This cast is completely unnecessary, non-void to void pointer casts are automatic.
If it is necessary, because p->value is const, then you are trying to change something behind the OF layer's back and need to use the appropriate interface to change the property contents.
Sebastian Hesselbarth
maintainerRe: [PATCH 1/2] ARM: kirkwood: proper retain MAC address workaround on DT ethernet
Quoted 11 lines · David Miller
From: Sebastian Hesselbarth<[email protected]>
Date: Wed, 22 May 2013 22:04:01 +0200arch/arm/mach-kirkwood/board-dt.c static struct of_device_id kirkwood_dt_match_table[] __initdata = { · line 78
Quoted 1 line
arch/arm/mach-kirkwood/board-dt.c +1
-0+memcpy ((void *)p->value, reg,6 );This cast is completely unnecessary, non-void to void pointer casts are automatic.
If it is necessary, because
p->valueis const, then you are trying to change something behind the OF layer's back and need to use the appropriate interface to change the property contents.
David,
good you mention it. I added Grant on Cc and will give a short sum-up why I casted the const from property->value away here.
Maybe I overlooked the API for modifying the DT property but as far as I've seen - there is no API for modifying it. And yes, you are right, it is kind of an abuse of DT here.
As Kirkwoods loose their MAC address on clock gating, I was looking for a place to store it early. (a) DT property "local-mac-address" looked as a good place as it will allow the driver to find it without any extra code. Of course, I am doing severaly sanity checks if it is safe to overwrite it, i.e. no other MAC set, property is there, long enough.
If Grant also NACKs modifying the DT we basically have two more options left for Kirkwood: (b) have MAC stored early in two global arrays in board init and reference that from mv643xx_eth or (c) leave the clock ungated unconditionally on all Kirkwoods.
I can live with all three, just name it and I prepare a final patch set.
Sebastian
David Miller
maintainerRe: [PATCH 1/2] ARM: kirkwood: proper retain MAC address workaround on DT ethernet
From: Sebastian Hesselbarth <[email protected]>
Date: Sun, 26 May 2013 22:06:58 +0200
Quoted 6 lines
good you mention it. I added Grant on Cc and will give a short sum-up why I casted the const from
property->valueaway here.Maybe I overlooked the API for modifying the DT property but as far as I've seen - there is no API for modifying it. And yes, you are right, it is kind of an abuse of DT here.
Sparc has an of_set_property(), it needs to become generic.
Re: [PATCH 1/2] ARM: kirkwood: proper retain MAC address workaround on DT ethernet
Quoted 1 line · David Miller
Sparc has an
of_set_property(), it needs to become generic.
There is an of_update_property(), we could change the name though, yours is nicer :-)
Cheers,
Ben.
Sebastian Hesselbarth
maintainerRe: [PATCH 1/2] ARM: kirkwood: proper retain MAC address workaround on DT ethernet
Quoted 5 lines · Benjamin Herrenschmidt
Quoted 1 line · David Miller
Sparc has an
of_set_property(), it needs to become generic.There is an
of_update_property(), we could change the name though, yours is nicer :-)
Ben, David,
I had a quick look at sparc's of_set_property. Nothing special except it depends on OF_DYNAMIC at some place. Using of_update_property instead should be the correct function to use. Thanks for the hint, I'll update the patches accordingly and send v5 hopefully by today.
Sebastian
Re: [PATCH 1/2] ARM: kirkwood: proper retain MAC address workaround on DT ethernet
Quoted 4 lines · Sebastian Hesselbarth
Quoted 1 line
There is an
of_update_property(), we could change the name though,yours
Quoted 1 line
is nicer :-)
Quoted 8 lines
Ben, David,
I had a quick look at sparc's
of_set_property. Nothing special except it
depends onOF_DYNAMICat some place. Usingof_update_propertyinstead should be the correct function to use. Thanks for the hint, I'll update
the patches accordingly and send v5 hopefully by today.
The only thing is that of_update_property() is a bit awkward to use, requiring the caller to provide an allocated struct property with associated allocated content. It also leaks the old property which is annoying but we haven't sorted out how to deal with allocation of properties and property content yet.
It would be handy to be able to just do something like
of_set_property(node, name, ptr, len);
However, that wouldn't help much with the allocation/leak problem, though at least it would be easier to use. It could also *try* to re-use the current allocation if the new content is of smaller or equal size.
Cheers,
Ben.
Re: [PATCH 1/2] ARM: kirkwood: proper retain MAC address workaround on DT ethernet
Quoted 3 lines · On Monday 27 May 2013 21:50:04 Benjamin Herrenschmidt wrote:
However, that wouldn't help much with the allocation/leak problem, though at least it would be easier to use. It could also *try* to re-use the current allocation if the new content is of smaller or equal size.
I thought that dtc tried to aggressively save space by folding identical strings. If you tried to reuse a property that had its contents shared with another one, you would get interesting results I guess.
Arnd
Re: [PATCH 1/2] ARM: kirkwood: proper retain MAC address workaround on DT ethernet
Quoted 8 lines · Arnd Bergmann
Quoted 3 lines · On Monday 27 May 2013 21:50:04 Benjamin Herrenschmidt wrote:
However, that wouldn't help much with the allocation/leak problem, though at least it would be easier to use. It could also *try* to re-use the current allocation if the new content is of smaller or equal size.
I thought that dtc tried to aggressively save space by folding identical strings. If you tried to reuse a property that had its contents shared with another one, you would get interesting results I guess.
It used to be only property names, unless that has changed in recent dtc. But that's a good point, we probably want a flag in struct property like we have for nodes, indicating whether it comes from the original fdt data pool or not.
Cheers,
Ben.
Sebastian Hesselbarth
maintainerRe: [PATCH 1/2] ARM: kirkwood: proper retain MAC address workaround on DT ethernet
Quoted 6 lines · Benjamin Herrenschmidt
Quoted 5 lines · Arnd Bergmann
Quoted 3 lines · On Monday 27 May 2013 21:50:04 Benjamin Herrenschmidt wrote:
However, that wouldn't help much with the allocation/leak problem, though at least it would be easier to use. It could also *try* to re-use the current allocation if the new content is of smaller or equal size.
Quoted 8 lines
Quoted 3 lines
I thought that dtc tried to aggressively save space by folding identical strings. If you tried to reuse a property that had its contents shared with another one, you would get interesting results I guess.
It used to be only property names, unless that has changed in recent dtc. But that's a good point, we probably want a flag in struct property like we have for nodes, indicating whether it comes from the original fdt data pool or not.
But isn't that what current sparc implementation of of_set_property does when it marks the property as dynamic?
Anyway, this definitely exceeds my knowledge of OF API for sure, so what do I do about the MAC workaround now?
Prepare the patch with global arrays and switch to some of_set_property as soon as it is available?
Sebastian
David Miller
maintainerRe: [PATCH 1/2] ARM: kirkwood: proper retain MAC address workaround on DT ethernet
In reply to Benjamin HerrenschmidtFrom: Benjamin Herrenschmidt <[email protected]>
Date: Tue, 28 May 2013 07:50:06 +1000
Quoted 6 lines · Arnd Bergmann
Quoted 5 lines · On Monday 27 May 2013 21:50:04 Benjamin Herrenschmidt wrote:
Quoted 3 lines
However, that wouldn't help much with the allocation/leak problem, though at least it would be easier to use. It could also *try* to re-use the current allocation if the new content is of smaller or equal size.
Quoted 8 lines
Quoted 3 lines
I thought that dtc tried to aggressively save space by folding identical strings. If you tried to reuse a property that had its contents shared with another one, you would get interesting results I guess.
It used to be only property names, unless that has changed in recent dtc. But that's a good point, we probably want a flag in struct property like we have for nodes, indicating whether it comes from the original fdt data pool or not.
This is similar to what the "OF_IS_DYNAMIC()" thing on sparc indicates.
David Miller
maintainerRe: [PATCH 1/2] ARM: kirkwood: proper retain MAC address workaround on DT ethernet
In reply to Benjamin HerrenschmidtFrom: Benjamin Herrenschmidt <[email protected]>
Date: Mon, 27 May 2013 21:50:04 +1000
Quoted 7 lines
It would be handy to be able to just do something like
of_set_property(node, name, ptr, len);However, that wouldn't help much with the allocation/leak problem, though at least it would be easier to use. It could also *try* to re-use the current allocation if the new content is of smaller or equal size.
And this is so much better of an interface because it allows the OF implementation to decide how to deal with memory allocation and freeing.
Re: [PATCH 1/2] ARM: kirkwood: proper retain MAC address workaround on DT ethernet
Quoted 7 lines · David Miller
From: Benjamin Herrenschmidt <[email protected]>
Date: Mon, 27 May 2013 21:50:04 +1000Quoted 4 lines
It would be handy to be able to just do something like
of_set_property(node, name, ptr, len);
Quoted 7 lines
Quoted 3 lines
However, that wouldn't help much with the allocation/leak problem, though at least it would be easier to use. It could also *try* to re-use the current allocation if the new content is of smaller or equal size.
And this is so much better of an interface because it allows the OF implementation to decide how to deal with memory allocation and freeing.
Absolutely, I'm not arguing that point.
Cheers,
Ben.
Re: [PATCH 1/2] ARM: kirkwood: proper retain MAC address workaround on DT ethernet
In reply to Sebastian HesselbarthQuoted 6 lines · Sebastian Hesselbarth
good you mention it. I added Grant on Cc and will give a short sum-up why I casted the const from
property->valueaway here.Maybe I overlooked the API for modifying the DT property but as far as I've seen - there is no API for modifying it. And yes, you are right, it is kind of an abuse of DT here.
of_update_property(). That also makes sure that any notifiers is called and proc/device-tree is updated in the case where the property is new.
Quoted 7 lines
As Kirkwoods loose their MAC address on clock gating, I was looking for a place to store it early. (a) DT property "local-mac-address" looked as a good place as it will allow the driver to find it without any extra code. Of course, I am doing severaly sanity checks if it is safe to overwrite it, i.e. no other MAC set, property is there, long enough.
Quoted 6 lines
If Grant also NACKs modifying the DT we basically have two more options left for Kirkwood: (b) have MAC stored early in two global arrays in board init and reference that from
mv643xx_ethor (c) leave the clock ungated unconditionally on all Kirkwoods.I can live with all three, just name it and I prepare a final patch set.
No, putting it in the DT makes sense, just use the right accessor.
Cheers,
Ben.
Quoted 6 lines
Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Sebastian Hesselbarth
maintainerv5 cover net: mv643xx_eth DT support and fixes
In reply to Sebastian HesselbarthThis patch set picks up work by Florian Fainelli bringing full DT support to mv643xx_eth and Marvell SoCs using it.
The current v5 patch set drops 1:1 compatibiliy with PPC binding for two reasons:
(a) PPC parses DT nodes in arch/ppc/sysdev and creates non-DT platform_devices itself,
(b) property and node naming for new ethernet devices is slightly different ("phy" vs "phy-handle", "marvell," prefix)
Anyway, the two bindings are functionally compatible and PPC bindings can be converted if desireable. The patch set if fully bisectable and care has been taken to (a) not reparse on PPC platforms, (b) allow to use platform_device based registration even if on CONFIG_OF. Not tested is double registration issues, i.e. if DT nodes are provided but legacy registration it not yet removed. This double registration should lead to either non-DT or DT registered device fail on already claimed ressources.
Also this patch set picks up the opportunity to fix some repeatedly reported issues with modular mvmdio/mv643xx_eth loading, unloading, and reloading. It has been tested on SolidRun CuBox (Dove) and Seagate Dockstar, QNAP, and USI Topkick (Kirkwood) by me or Andrew Lunn.
Patch 1 fixes an issue introduced with switch to separate mvmdio driver, where detaching mv643xx_eth from a phy will not stop the phy state machine and finally dereference the already removed network device. Using phy_disconnect properly stops the phy state machine before detaching from it. Perhaps, this patch should go back in stable (most likely 3.9 only) if mvmdio separation patch went in there.
Patch 2 makes use of managed devm_ioremap for the last remaining non-managed resource.
Patches 3-4 prepare DT support for mv643xx_eth by adding a phy_node pointer to platform_data and exploiting that phy_node when attaching to a phy.
Patch 5 adds a Kirkwood specific workaround for PORT_SERIAL_CTRL1 register which is reset to loopback mode when clocks are gated.
Patch 6 introduces DT parsing support for mv643xx_eth by adding a match table for marvell,orion-eth and marvell,kirkwood-eth to the shared driver and adding a platform_device for each of its child nodes.
Patches 7-9 add corresponding device tree nodes to Marvell Dove, Kirkwood, and Orion5x including all boards. Where known, also the PHY compatible string has been set to what is reported in the boards boot loader.
Patches 10, 11-12, and 14 finally remove all legacy platform_device based registration from Dove, Kirkwood, and Orion5x DT setup. For Kirkwood also now obsolete board specific setup is removed from common DT board setup, Kconfig, Makefile, and kirkwood_defconfig.
For the patches above I suggest to take Patches 1-6 through David Miller's branch, and Patches 7-12 through Jason Cooper's when the former have appeared on mainline linux. The patch set has been based on v3.10-rc3.
Overall Changelog:v4->v5: v5 drops Kirkwood MAC address workaround by using DT
property because OF API does not allow to modify properties easily. Instead the current workaround by not gating ge clocks is kept. The OF property workaround is postponed until some easy to use of_set_property is available.
Sebastian Hesselbarth (13):
net: mv643xx_eth: use phy_disconnect instead of phy_detach
net: mv643xx_eth: use managed devm_ioremap for port registers
net: mv643xx_eth: add phy_node to platform_data struct
net: mv643xx_eth: use of_phy_connect if phy_node present
net: mv643xx_eth: proper initialization for Kirkwood SoCs
net: mv643xx_eth: add DT parsing support
ARM: dove: add gigabit ethernet and mvmdio device tree nodes
ARM: kirkwood: add gigabit ethernet and mvmdio device tree nodes
ARM: orion5x: add gigabit ethernet and mvmdio device tree nodes
ARM: dove: remove legacy mv643xx_eth setup
ARM: kirkwood: remove legacy clk alias for mv643xx_eth
ARM: kirkwood: remove redundant DT board files
ARM: orion5x: remove legacy mv643xx_eth board setup
.../devicetree/bindings/net/marvell-orion-net.txt | 85 +++++++++ arch/arm/boot/dts/dove-cubox.dts | 7 + arch/arm/boot/dts/dove.dtsi | 35 ++++ arch/arm/boot/dts/kirkwood-cloudbox.dts | 16 ++ arch/arm/boot/dts/kirkwood-dnskw.dtsi | 16 ++ arch/arm/boot/dts/kirkwood-dockstar.dts | 17 ++ arch/arm/boot/dts/kirkwood-dreamplug.dts | 28 +++ arch/arm/boot/dts/kirkwood-goflexnet.dts | 16 ++ .../arm/boot/dts/kirkwood-guruplug-server-plus.dts | 30 +++ arch/arm/boot/dts/kirkwood-ib62x0.dts | 16 ++ arch/arm/boot/dts/kirkwood-iconnect.dts | 16 ++ arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts | 24 +++ arch/arm/boot/dts/kirkwood-is2.dts | 2 + arch/arm/boot/dts/kirkwood-km_kirkwood.dts | 16 ++ arch/arm/boot/dts/kirkwood-lsxl.dtsi | 28 +++ arch/arm/boot/dts/kirkwood-mplcec4.dts | 27 +++ .../boot/dts/kirkwood-netgear_readynas_duo_v2.dts | 16 ++ arch/arm/boot/dts/kirkwood-ns2-common.dtsi | 16 ++ arch/arm/boot/dts/kirkwood-ns2.dts | 2 + arch/arm/boot/dts/kirkwood-ns2lite.dts | 2 + arch/arm/boot/dts/kirkwood-ns2max.dts | 2 + arch/arm/boot/dts/kirkwood-ns2mini.dts | 2 + arch/arm/boot/dts/kirkwood-openblocks_a6.dts | 16 ++ arch/arm/boot/dts/kirkwood-topkick.dts | 16 ++ arch/arm/boot/dts/kirkwood-ts219-6281.dts | 4 +- arch/arm/boot/dts/kirkwood-ts219-6282.dts | 4 +- arch/arm/boot/dts/kirkwood-ts219.dtsi | 16 ++ arch/arm/boot/dts/kirkwood.dtsi | 52 ++++++ .../dts/orion5x-lacie-ethernet-disk-mini-v2.dts | 17 ++ arch/arm/boot/dts/orion5x.dtsi | 29 +++ arch/arm/configs/kirkwood_defconfig | 16 -- arch/arm/mach-dove/board-dt.c | 9 - arch/arm/mach-kirkwood/Kconfig | 117 ------------ arch/arm/mach-kirkwood/Makefile | 16 -- arch/arm/mach-kirkwood/board-dnskw.c | 7 - arch/arm/mach-kirkwood/board-dockstar.c | 32 ---- arch/arm/mach-kirkwood/board-dreamplug.c | 35 ---- arch/arm/mach-kirkwood/board-dt.c | 64 +------ arch/arm/mach-kirkwood/board-goflexnet.c | 34 ---- arch/arm/mach-kirkwood/board-guruplug.c | 33 ---- arch/arm/mach-kirkwood/board-ib62x0.c | 29 --- arch/arm/mach-kirkwood/board-iconnect.c | 10 - arch/arm/mach-kirkwood/board-iomega_ix2_200.c | 34 ---- arch/arm/mach-kirkwood/board-km_kirkwood.c | 44 ----- arch/arm/mach-kirkwood/board-lsxl.c | 16 -- arch/arm/mach-kirkwood/board-mplcec4.c | 14 -- arch/arm/mach-kirkwood/board-ns2.c | 35 ---- arch/arm/mach-kirkwood/board-openblocks_a6.c | 26 --- arch/arm/mach-kirkwood/board-readynas.c | 6 - arch/arm/mach-kirkwood/board-ts219.c | 13 -- arch/arm/mach-kirkwood/board-usi_topkick.c | 29 --- arch/arm/mach-orion5x/edmini_v2-setup.c | 10 - drivers/net/ethernet/marvell/mv643xx_eth.c | 194 ++++++++++++++++++-- include/linux/mv643xx_eth.h | 2 + 54 files changed, 754 insertions(+), 644 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/marvell-orion-net.txt delete mode 100644 arch/arm/mach-kirkwood/board-dockstar.c delete mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c delete mode 100644 arch/arm/mach-kirkwood/board-goflexnet.c delete mode 100644 arch/arm/mach-kirkwood/board-guruplug.c delete mode 100644 arch/arm/mach-kirkwood/board-ib62x0.c delete mode 100644 arch/arm/mach-kirkwood/board-iomega_ix2_200.c delete mode 100644 arch/arm/mach-kirkwood/board-km_kirkwood.c delete mode 100644 arch/arm/mach-kirkwood/board-ns2.c delete mode 100644 arch/arm/mach-kirkwood/board-openblocks_a6.c delete mode 100644 arch/arm/mach-kirkwood/board-usi_topkick.c
---
Cc: David Miller <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: netdev at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-kernel at vger.kernel.org
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH v5 1/13 net: mv643xx_eth: use phy_disconnect instead of phy_detach
Using a separated mdio bus driver with mvmdio, phy_detach on network device removal will not stop the phy and finally lead to NULL pointer dereference in mvmdio due to non-existent network device. Use phy_disconnect instead to properly stop phy device from accessing network device prior removal of the network device.
---
Note: I observed this behavior when removing a modular mv643xx_eth driver after attaching it to a phy handled by (also modular) mvmdio. The mvmdio conversion has been done in
commit c3a07134e6aa5b93a37f72ffa3d11fadf72bf757
("mv643xx_eth: convert to use the Marvell Orion MDIO driver")
and should go back any -stable version with that commit (propably only 3.9)
--- drivers/net/ethernet/marvell/mv643xx_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/mv643xx_eth.c +1 -1
@@ -2805,7 +2805,7 @@ static int mv643xx_eth_remove(struct platform_device *pdev)unregister_netdev (mp->dev);if (mp->phy !=NULL ) -phy_detach (mp->phy); +phy_disconnect (mp->phy);cancel_work_sync (&mp->tx_timeout_task);if (!IS_ERR (mp->clk))
Signature · 1 line
1.7.10.4
Re: [PATCH v5 01/13] net: mv643xx_eth: use phy_disconnect instead of phy_detach
Sebastian,
Quoted 12 lines · Sebastian Hesselbarth
Using a separated mdio bus driver with mvmdio,
phy_detachon network device removal will not stop the phy and finally lead to NULL pointer dereference in mvmdio due to non-existent network device. Usephy_disconnectinstead to properly stop phy device from accessing network device prior removal of the network device.Signed-off-by Sebastian Hesselbarth <[email protected]>---
Note: I observed this behavior when removing a modularmv643xx_ethdriver after attaching it to a phy handled by (also modular) mvmdio. The mvmdio conversion has been done in
Quoted 4 lines
commit
c3a07134e6aa5b93a37f72ffa3d11fadf72bf757
("mv643xx_eth: convert to use the Marvell Orion MDIO driver")and should go back any -stable version with that commit (propably only 3.9)
It looks like just v3.10-rcX, here.
thx,
Jason.
Sebastian Hesselbarth
maintainerPATCH v5 2/13 net: mv643xx_eth: use managed devm_ioremap for port registers
In reply to Sebastian HesselbarthMake use of managed devm_ioremap and remove corresponding iounmap.
---
Cc: David Miller <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: netdev at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-kernel at vger.kernel.org
--- drivers/net/ethernet/marvell/mv643xx_eth.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/marvell/mv643xx_eth.c +1 -2
@@ -2470,7 +2470,7 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)if (msp ==NULL )return -ENOMEM ; - msp->base =ioremap (res->start,resource_size (res)); + msp->base =devm_ioremap (&pdev->dev, res->start,resource_size (res));if (msp->base ==NULL )return -ENOMEM ;
@@ -2498,7 +2498,6 @@ static int mv643xx_eth_shared_remove(struct platform_device *pdev) {struct mv643xx_eth_shared_private *msp =platform_get_drvdata (pdev); -iounmap (msp->base);if (!IS_ERR (msp->clk))clk_disable_unprepare (msp->clk);
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH v5 3/13 net: mv643xx_eth: add phy_node to platform_data struct
In reply to Sebastian HesselbarthThis adds a struct device_node pointer for a phy passed by phandle to mv643xx_eth node.
---
Cc: David Miller <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: netdev at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-kernel at vger.kernel.org
--- include/linux/mv643xx_eth.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/mv643xx_eth.h +2 -0
@@ -30,6 +30,7 @@ struct mv643xx_eth_shared_platform_data {#define MV643XX_ETH_PHY_ADDR (x) (0x80 | (x))#define MV643XX_ETH_PHY_NONE 0xff +struct device_node ;struct mv643xx_eth_platform_data {/* * Pointer back to our parent instance, and our port number.
@@ -41,6 +42,7 @@ struct mv643xx_eth_platform_data {* Whether a PHY is present, and if yes, at which address. */ int phy_addr; +struct device_node *phy_node;/* * Use this MAC address if it is valid, overriding the
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH v5 4/13 net: mv643xx_eth: use of_phy_connect if phy_node present
In reply to Sebastian HesselbarthThis connects to a phy node passed to the port device instead of probing the phy by phy_addr.
---
Cc: David Miller <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: netdev at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-kernel at vger.kernel.org
--- drivers/net/ethernet/marvell/mv643xx_eth.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-)
drivers/net/ethernet/marvell/mv643xx_eth.c +18 -7
@@ -60,6 +60,7 @@#include <linux/types.h> #include <linux/slab.h> #include <linux/clk.h> +#include <linux/of_mdio.h> static char mv643xx_eth_driver_name[] ="mv643xx_eth" ;static char mv643xx_eth_driver_version[] ="1.4" ;
@@ -2715,17 +2716,27 @@ static int mv643xx_eth_probe(struct platform_device *pdev)netif_set_real_num_tx_queues (dev, mp->txq_count);netif_set_real_num_rx_queues (dev, mp->rxq_count); -if (pd->phy_addr !=MV643XX_ETH_PHY_NONE ) { + err =0 ; +if (pd->phy_node) { + mp->phy =of_phy_connect (mp->dev, pd->phy_node, + mv643xx_eth_adjust_link,0 , +PHY_INTERFACE_MODE_GMII ); +if (!mp->phy) + err = -ENODEV ; + }else if (pd->phy_addr !=MV643XX_ETH_PHY_NONE ) { mp->phy =phy_scan (mp, pd->phy_addr); -if (IS_ERR (mp->phy)) { +if (IS_ERR (mp->phy)) err =PTR_ERR (mp->phy); -if (err == -ENODEV ) - err = -EPROBE_DEFER ; - goto out; - } -phy_init (mp, pd->speed, pd->duplex); +else +phy_init (mp, pd->speed, pd->duplex); } +if (err == -ENODEV ) { + err = -EPROBE_DEFER ; + goto out; + } +if (err) + goto out;SET_ETHTOOL_OPS (dev, &mv643xx_eth_ethtool_ops);
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH v5 5/13 net: mv643xx_eth: proper initialization for Kirkwood SoCs
In reply to Sebastian HesselbarthEthernet controllers found on Kirkwood SoCs not only suffer from loosing MAC address register contents on clock gating but also some important registers are reset to values that would break ethernet. This patch clears the CLK125_BYPASS_EN bit for DT enabled Kirkwood only by using of_device_is_compatible() instead of #ifdefs. Non-DT Kirkwood is not affected as it installs a clock gating workaround because of the MAC address issue above. Other Orion SoCs do not suffer from register reset, do not have the bit in question, or do not have the register at all. Moreover, system controllers on PPC using this driver should also be protected from clearing that bit.
---
Note: In contrast to the reset value of 0 for CLK125_BYPASS_EN bit as stated in Kirkwood datasheet, we confirmed that reset value is 1 instead. Either datasheet is wrong about it, there is some post-boot self-check or BootROM flips that bit.
Changelogv4->v5:
- check for device compatible instead of machine compatible (Suggested by Jason Gunthorpe)
--- drivers/net/ethernet/marvell/mv643xx_eth.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/net/ethernet/marvell/mv643xx_eth.c +11 -0
@@ -116,6 +116,8 @@ static char mv643xx_eth_driver_version[] = "1.4";#define LINK_UP 0x00000002#define TXQ_COMMAND 0x0048#define TXQ_FIX_PRIO_CONF 0x004c +#define PORT_SERIAL_CONTROL1 0x004c +#define CLK125_BYPASS_EN 0x00000010#define TX_BW_RATE 0x0050#define TX_BW_MTU 0x0058#define TX_BW_BURST 0x005c
@@ -2701,6 +2703,15 @@ static int mv643xx_eth_probe(struct platform_device *pdev) mp->dev = dev; +/* Kirkwood resets some registers on gated clocks. Especially +* CLK125_BYPASS_EN must be cleared but is not available on +* all other SoCs/System Controllers using this driver. +*/ +if (of_device_is_compatible (pdev->dev.of_node, +"marvell,kirkwood-eth-port" )) +wrlp (mp,PORT_SERIAL_CONTROL1 , +rdlp (mp,PORT_SERIAL_CONTROL1 ) & ~CLK125_BYPASS_EN ); +/* * Start with a default rate, and if there is a clock, allow * it to override the default.
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH v5 6/13 net: mv643xx_eth: add DT parsing support
In reply to Sebastian HesselbarthThis adds device tree parsing support for the shared driver of mv643xx_eth. As the bindings are slightly different from current PPC bindings new binding documentation is also added. Following PPC-style device setup, the shared driver now also adds port platform_devices and sets up port platform_data.
---
Note: Although different, device tree bindings are compatible with PPC bindings. As I do not have access to any PPC platform using mv643xx_eth, I leave conversion ("phy" vs "phy-handle") and compatible string name up to PPC guys.
Due to hang reports for modular built mvmdio and mv643xx_eth, I have tested module loading/unloading/reloading on CuBox (Dove) and Dockstar (Kirkwood) without any issues for the whole patch set.
Changelog:v5->v4:
- add Kirkwood specific compatible string
v3->v4:
- separation of independent patches (phy, of_mdio, devm)
- stand-alone device tree binding compatible to existing mv64x60 binding
- device node match for shared driver only
- device node registration for port drivers
- properly return -EPROBE_DEFER on missing of phy (Reported by Simon Baatz)
--- .../devicetree/bindings/net/marvell-orion-net.txt | 85 +++++++++++ drivers/net/ethernet/marvell/mv643xx_eth.c | 153 +++++++++++++++++++- 2 files changed, 234 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/marvell-orion-net.txt
Documentation/devicetree/bindings/net/marvell-orion-net.txt new file +85 -0
@@ -0,0 +1,85 @@ +Marvell Orion/Discovery ethernet controller +============================================= + +The Marvell Discovery ethernet controller can be found on Marvell Orion SoCs +(Kirkwood, Dove, Orion5x, and Discovery Innovation) and as part of Marvell +Discovery system controller chips (mv64[345]60). + +The Discovery ethernet controller is described with two levels of nodes. The +first level describes the ethernet controller itself and the second level +describes up to 3 ethernet port nodes within that controller. The reason for +the multiple levels is that the port registers are interleaved within a single +set of controller registers. Each port node describes port-specific properties. + +Note: The above separation is only true for Discovery system controllers. +For Orion SoCs we stick to the separation, although there each controller has +only one port associated. Multiple ports are implemented as multiple single-port +controllers. As Kirkwood has some issues with proper initialization after reset, +an extra compatible string is added for it. + +* Ethernet controller node + +Required controller properties: + - #address-cells: shall be 1. + - #size-cells: shall be 0. + - compatible: shall be one of "marvell,orion-eth", "marvell,kirkwood-eth". + - reg: address and length of the controller registers. + +Optional controller properties: + - clocks: phandle reference to the controller clock. + - marvell,tx-checksum-limit: max tx packet size for hardware checksum. + +* Ethernet port node + +Required port properties: + - device_type: shall be "network". + - compatible: shall be one of "marvell,orion-eth-port", + "marvell,kirkwood-eth-port". + - reg: port number relative to ethernet controller, shall be 0, 1, or 2. + - interrupts: port interrupt. + - local-mac-address: 6 bytes MAC address. + +Optional port properties: + - marvell,tx-queue-size: size of the transmit ring buffer. + - marvell,tx-sram-addr: address of transmit descriptor buffer located in SRAM. + - marvell,tx-sram-size: size of transmit descriptor buffer located in SRAM. + - marvell,rx-queue-size: size of the receive ring buffer. + - marvell,rx-sram-addr: address of receive descriptor buffer located in SRAM. + - marvell,rx-sram-size: size of receive descriptor buffer located in SRAM. + +and + + - phy-handle: phandle reference to ethernet PHY. + +or + + - speed: port speed if no PHY connected. + - duplex: port mode if no PHY connected. + +* Node example: + +mdio-bus { + ... + ethphy: ethernet-phy at 8 { + device_type = "ethernet-phy"; + ... + }; +}; + +eth: ethernet-controller at 72000 { + compatible = "marvell,orion-eth"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x72000 0x2000>; + clocks = <&gate_clk 2>; + marvell,tx-checksum-limit = <1600>; + + ethernet at 0 { + device_type = "network"; + compatible = "marvell,orion-eth-port"; + reg = <0>; + interrupts = <29>; + phy-handle = <ðphy>; + local-mac-address = [00 00 00 00 00 00]; + }; +};
drivers/net/ethernet/marvell/mv643xx_eth.c +149 -4
207 lines not on this page · raw message
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH v5 7/13 ARM: dove: add gigabit ethernet and mvmdio device tree nodes
In reply to Sebastian HesselbarthThis patch adds orion-eth and mvmdio device tree nodes for DT enabled Dove boards. As there is only one ethernet controller on Dove, a default phy node is also added with a note to set its reg property on a per-board basis.
---
Changelog:v3->v4:
- convert to new device tree binding
--- arch/arm/boot/dts/dove-cubox.dts | 7 +++++++ arch/arm/boot/dts/dove.dtsi | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+)
arch/arm/boot/dts/dove-cubox.dts +7 -0
@@ -49,6 +49,13 @@ &uart0 { status = "okay"; }; &sata0 { status = "okay"; }; &i2c0 { status = "okay"; }; +&mdio { status = "okay"; }; +ð { status = "okay"; }; + +ðphy { + compatible = "marvell,88e1310"; + reg = <1>; +}; &sdio0 { status = "okay";
arch/arm/boot/dts/dove.dtsi +35 -0
@@ -258,5 +258,40 @@ dmacap,xor; }; }; + + mdio: mdio-bus at 72004 { + compatible = "marvell,orion-mdio"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x72004 0x84>; + interrupts = <30>; + clocks = <&gate_clk 2>; + status = "disabled"; + + ethphy: ethernet-phy { + device-type = "ethernet-phy"; + /* set phy address in board file */ + }; + }; + + eth: ethernet-controller at 72000 { + compatible = "marvell,orion-eth"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x72000 0x4000>; + clocks = <&gate_clk 2>; + marvell,tx-checksum-limit = <1600>; + status = "disabled"; + + ethernet-port at 0 { + device_type = "network"; + compatible = "marvell,orion-eth-port"; + reg = <0>; + interrupts = <29>; + /* overwrite MAC address in bootloader */ + local-mac-address = [00 00 00 00 00 00]; + phy-handle = <ðphy>; + }; + }; }; };
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH v5 8/13 ARM: kirkwood: add gigabit ethernet and mvmdio device tree nodes
In reply to Sebastian HesselbarthThis patch adds mv643xx_eth and mvmdio device tree nodes for DT enabled Kirkwood boards. Phy nodes are also added with reg property set on a per-board basis.
---
Changelog:v4->v5:
- use Kirkwood specific compatible string
--- arch/arm/boot/dts/kirkwood-cloudbox.dts | 16 ++++++ arch/arm/boot/dts/kirkwood-dnskw.dtsi | 16 ++++++ arch/arm/boot/dts/kirkwood-dockstar.dts | 17 +++++++ arch/arm/boot/dts/kirkwood-dreamplug.dts | 28 +++++++++++ arch/arm/boot/dts/kirkwood-goflexnet.dts | 16 ++++++ .../arm/boot/dts/kirkwood-guruplug-server-plus.dts | 30 +++++++++++ arch/arm/boot/dts/kirkwood-ib62x0.dts | 16 ++++++ arch/arm/boot/dts/kirkwood-iconnect.dts | 16 ++++++ arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts | 24 +++++++++ arch/arm/boot/dts/kirkwood-is2.dts | 2 + arch/arm/boot/dts/kirkwood-km_kirkwood.dts | 16 ++++++ arch/arm/boot/dts/kirkwood-lsxl.dtsi | 28 +++++++++++ arch/arm/boot/dts/kirkwood-mplcec4.dts | 27 ++++++++++ .../boot/dts/kirkwood-netgear_readynas_duo_v2.dts | 16 ++++++ arch/arm/boot/dts/kirkwood-ns2-common.dtsi | 16 ++++++ arch/arm/boot/dts/kirkwood-ns2.dts | 2 + arch/arm/boot/dts/kirkwood-ns2lite.dts | 2 + arch/arm/boot/dts/kirkwood-ns2max.dts | 2 + arch/arm/boot/dts/kirkwood-ns2mini.dts | 2 + arch/arm/boot/dts/kirkwood-openblocks_a6.dts | 16 ++++++ arch/arm/boot/dts/kirkwood-topkick.dts | 16 ++++++ arch/arm/boot/dts/kirkwood-ts219-6281.dts | 4 +- arch/arm/boot/dts/kirkwood-ts219-6282.dts | 4 +- arch/arm/boot/dts/kirkwood-ts219.dtsi | 16 ++++++ arch/arm/boot/dts/kirkwood.dtsi | 52 ++++++++++++++++++++ 25 files changed, 398 insertions(+), 2 deletions(-)
arch/arm/boot/dts/kirkwood-cloudbox.dts +16 -0
@@ -87,3 +87,19 @@ gpios = <&gpio0 17 0>; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-dnskw.dtsi +16 -0
@@ -217,3 +217,19 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 8 { + device_type = "ethernet-phy"; + reg = <8>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-dockstar.dts +17 -0
@@ -91,3 +91,20 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + compatible = "marvell,88e1116"; + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-dreamplug.dts +28 -0
@@ -99,3 +99,31 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; + + ethphy1: ethernet-phy at 1 { + device_type = "ethernet-phy"; + reg = <1>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +}; + +ð1 { + status = "okay"; + ethernet1-port at 0 { + phy-handle = <ðphy1>; + }; +};
arch/arm/boot/dts/kirkwood-goflexnet.dts +16 -0
@@ -170,3 +170,19 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts +30 -0
@@ -96,3 +96,33 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + compatible = "marvell,88e1121"; + reg = <0>; + }; + + ethphy1: ethernet-phy at 1 { + device_type = "ethernet-phy"; + compatible = "marvell,88e1121"; + reg = <1>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +}; + +ð1 { + status = "okay"; + ethernet1-port at 0 { + phy-handle = <ðphy1>; + }; +};
arch/arm/boot/dts/kirkwood-ib62x0.dts +16 -0
@@ -119,3 +119,19 @@ }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 8 { + device_type = "ethernet-phy"; + reg = <8>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-iconnect.dts +16 -0
@@ -168,3 +168,19 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 11 { + device_type = "ethernet-phy"; + reg = <11>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts +24 -0
@@ -191,3 +191,27 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy1: ethernet-phy at 11 { + device_type = "ethernet-phy"; + reg = <11>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + speed = <1000>; + duplex = <1>; + }; +}; + +ð1 { + status = "okay"; + ethernet1-port at 0 { + phy-handle = <ðphy1>; + }; +};
arch/arm/boot/dts/kirkwood-is2.dts +2 -0
@@ -28,3 +28,5 @@ }; }; }; + +ðphy0 { reg = <8>; };
arch/arm/boot/dts/kirkwood-km_kirkwood.dts +16 -0
@@ -43,3 +43,19 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-lsxl.dtsi +28 -0
@@ -201,3 +201,31 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; + + ethphy1: ethernet-phy at 8 { + device_type = "ethernet-phy"; + reg = <8>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +}; + +ð1 { + status = "okay"; + ethernet1-port at 0 { + phy-handle = <ðphy1>; + }; +};
arch/arm/boot/dts/kirkwood-mplcec4.dts +27 -0
@@ -182,3 +182,30 @@ }; }; +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 1 { + device_type = "ethernet-phy"; + reg = <1>; + }; + + ethphy1: ethernet-phy at 2 { + device_type = "ethernet-phy"; + reg = <2>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +}; + +ð1 { + status = "okay"; + ethernet1-port at 0 { + phy-handle = <ðphy1>; + }; +};
arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts +16 -0
@@ -178,3 +178,19 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-ns2-common.dtsi +16 -0
@@ -82,3 +82,19 @@ }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy { + device_type = "ethernet-phy"; + /* overwrite reg property in board file */ + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-ns2.dts +2 -0
@@ -28,3 +28,5 @@ }; }; }; + +ðphy0 { reg = <8>; };
arch/arm/boot/dts/kirkwood-ns2lite.dts +2 -0
@@ -28,3 +28,5 @@ }; }; }; + +ðphy0 { reg = <0>; };
arch/arm/boot/dts/kirkwood-ns2max.dts +2 -0
@@ -47,3 +47,5 @@ }; }; }; + +ðphy0 { reg = <8>; };
arch/arm/boot/dts/kirkwood-ns2mini.dts +2 -0
@@ -48,3 +48,5 @@ }; }; }; + +ðphy0 { reg = <0>; };
arch/arm/boot/dts/kirkwood-openblocks_a6.dts +16 -0
@@ -210,3 +210,19 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-topkick.dts +16 -0
@@ -201,3 +201,19 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy at 0 { + device_type = "ethernet-phy"; + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood-ts219-6281.dts +3 -1
@@ -49,4 +49,6 @@ gpios = <&gpio0 16 1>; }; }; -}; +}; + +ðphy0 { reg = <8>; };
arch/arm/boot/dts/kirkwood-ts219-6282.dts +3 -1
@@ -49,4 +49,6 @@ gpios = <&gpio1 5 1>; }; }; -}; +}; + +ðphy0 { reg = <0>; };
arch/arm/boot/dts/kirkwood-ts219.dtsi +16 -0
@@ -76,3 +76,19 @@ }; }; }; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy { + device_type = "ethernet-phy"; + /* overwrite reg property in board file */ + }; +}; + +ð0 { + status = "okay"; + ethernet0-port at 0 { + phy-handle = <ðphy0>; + }; +};
arch/arm/boot/dts/kirkwood.dtsi +52 -0
57 lines not on this page · raw message
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH v5 9/13 ARM: orion5x: add gigabit ethernet and mvmdio device tree nodes
In reply to Sebastian HesselbarthThis patch adds mv643xx_eth and mvmdio device tree nodes for DT enabled Orion5x boards. Phy nodes are also added with reg property set on a per-board basis.
---
Changelog:v3->v4:
- convert to new device tree binding
--- .../dts/orion5x-lacie-ethernet-disk-mini-v2.dts | 17 ++++++++++++ arch/arm/boot/dts/orion5x.dtsi | 29 ++++++++++++++++++++ 2 files changed, 46 insertions(+)
arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts +17 -0
@@ -53,3 +53,20 @@ }; }; }; + +&mdio { + status = "okay"; + + ðphy: ethernet-phy { + device-type = "ethernet-phy"; + reg = <8>; + }; +}; + +ð { + status = "okay"; + + ethernet-port at 0 { + phy-handle = <ðphy>; + }; +};
arch/arm/boot/dts/orion5x.dtsi +29 -0
@@ -132,5 +132,34 @@ interrupts = <28>; status = "okay"; }; + + mdio: mdio-bus at 72004 { + compatible = "marvell,orion-mdio"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x72004 0x84>; + interrupts = <22>; + status = "disabled"; + + /* add phy nodes in board file */ + }; + + eth: ethernet-controller at 72000 { + compatible = "marvell,orion-eth"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x72000 0x4000>; + marvell,tx-checksum-limit = <1600>; + status = "disabled"; + + ethernet-port at 0 { + device_type = "network"; + compatible = "marvell,orion-eth-port"; + reg = <0>; + /* overwrite MAC address in bootloader */ + local-mac-address = [00 00 00 00 00 00]; + /* set phy-handle property in board file */ + }; + }; }; };
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH v5 10/13 ARM: dove: remove legacy mv643xx_eth setup
In reply to Sebastian HesselbarthWith DT support for mv643xx_eth we do not need legacy platform_data based setup for DT enabled boards anymore.
---
Cc: David Miller <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: netdev at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-kernel at vger.kernel.org
--- arch/arm/mach-dove/board-dt.c | 9 --------- 1 file changed, 9 deletions(-)
arch/arm/mach-dove/board-dt.c +0 -9
@@ -34,10 +34,6 @@ static void __init dove_legacy_clk_init(void) clkspec.np = np; clkspec.args_count =1 ; - clkspec.args[0 ] =CLOCK_GATING_BIT_GBE ; -orion_clkdev_add (NULL ,"mv643xx_eth_port.0" , -of_clk_get_from_provider (&clkspec)); - clkspec.args[0 ] =CLOCK_GATING_BIT_PCIE0 ;orion_clkdev_add ("0" ,"pcie" ,of_clk_get_from_provider (&clkspec));
@@ -53,10 +49,6 @@ static void __init dove_of_clk_init(void)dove_legacy_clk_init (); } -static struct mv643xx_eth_platform_data dove_dt_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR_DEFAULT , -}; -static void __init dove_dt_init (void ) {pr_info ("Dove 88AP510 SoC\n" );
@@ -70,7 +62,6 @@ static void __init dove_dt_init(void)dove_of_clk_init ();/* Internal devices not ported to DT yet */ -dove_ge00_init (&dove_dt_ge00_data);dove_pcie_init (1 ,1 );of_platform_populate (NULL , of_default_bus_match_table,NULL ,NULL );
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH v5 11/13 ARM: kirkwood: remove legacy clk alias for mv643xx_eth
In reply to Sebastian HesselbarthWith all boards converted to DT enabled mv643xx_eth we can now remove the clock alias for gbe clocks.
---
Cc: David Miller <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: netdev at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-kernel at vger.kernel.org
--- arch/arm/mach-kirkwood/board-dt.c | 2 -- 1 file changed, 2 deletions(-)
arch/arm/mach-kirkwood/board-dt.c +0 -2
@@ -66,12 +66,10 @@ static void __init kirkwood_legacy_clk_init(void)*/ clkspec.args[0 ] =CGC_BIT_GE0 ; clk =of_clk_get_from_provider (&clkspec); -orion_clkdev_add (NULL ,"mv643xx_eth_port.0" , clk);clk_prepare_enable (clk); clkspec.args[0 ] =CGC_BIT_GE1 ; clk =of_clk_get_from_provider (&clkspec); -orion_clkdev_add (NULL ,"mv643xx_eth_port.1" , clk);clk_prepare_enable (clk); }
Signature · 1 line
1.7.10.4
Sebastian Hesselbarth
maintainerPATCH v5 12/13 ARM: kirkwood: remove redundant DT board files
In reply to Sebastian HesselbarthWith DT support for mv643xx_eth board specific init for some boards now is unneccessary. Remove those board files, Kconfig entries, and corresponding entries in kirkwood_defconfig.
---
Note: board-km_kirkwood.c is also removed, as Valentin Longchamp confirmed the lock-up is not caused by accessing clock gating registers but rather non-existent device registers. This will be addressed by dtsi separation for kirkwood and bobcat SoC variants.
Changelog:v3->v4:
- remove more boards that don't require board specific setup
--- arch/arm/configs/kirkwood_defconfig | 16 ---- arch/arm/mach-kirkwood/Kconfig | 117 ------------------------- arch/arm/mach-kirkwood/Makefile | 16 ---- arch/arm/mach-kirkwood/board-dnskw.c | 7 -- arch/arm/mach-kirkwood/board-dockstar.c | 32 ------- arch/arm/mach-kirkwood/board-dreamplug.c | 35 -------- arch/arm/mach-kirkwood/board-dt.c | 62 +------------ arch/arm/mach-kirkwood/board-goflexnet.c | 34 ------- arch/arm/mach-kirkwood/board-guruplug.c | 33 ------- arch/arm/mach-kirkwood/board-ib62x0.c | 29 ------ arch/arm/mach-kirkwood/board-iconnect.c | 10 --- arch/arm/mach-kirkwood/board-iomega_ix2_200.c | 34 ------- arch/arm/mach-kirkwood/board-km_kirkwood.c | 44 ---------- arch/arm/mach-kirkwood/board-lsxl.c | 16 ---- arch/arm/mach-kirkwood/board-mplcec4.c | 14 --- arch/arm/mach-kirkwood/board-ns2.c | 35 -------- arch/arm/mach-kirkwood/board-openblocks_a6.c | 26 ------ arch/arm/mach-kirkwood/board-readynas.c | 6 -- arch/arm/mach-kirkwood/board-ts219.c | 13 --- arch/arm/mach-kirkwood/board-usi_topkick.c | 29 ------ 20 files changed, 1 insertion(+), 607 deletions(-) delete mode 100644 arch/arm/mach-kirkwood/board-dockstar.c delete mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c delete mode 100644 arch/arm/mach-kirkwood/board-goflexnet.c delete mode 100644 arch/arm/mach-kirkwood/board-guruplug.c delete mode 100644 arch/arm/mach-kirkwood/board-ib62x0.c delete mode 100644 arch/arm/mach-kirkwood/board-iomega_ix2_200.c delete mode 100644 arch/arm/mach-kirkwood/board-km_kirkwood.c delete mode 100644 arch/arm/mach-kirkwood/board-ns2.c delete mode 100644 arch/arm/mach-kirkwood/board-openblocks_a6.c delete mode 100644 arch/arm/mach-kirkwood/board-usi_topkick.c
arch/arm/configs/kirkwood_defconfig +0 -16
@@ -30,27 +30,11 @@ CONFIG_MACH_SHEEVAPLUG=y CONFIG_MACH_T5325=y CONFIG_MACH_TS219=y CONFIG_MACH_TS41X=y -CONFIG_MACH_CLOUDBOX_DT=y CONFIG_MACH_DLINK_KIRKWOOD_DT=y -CONFIG_MACH_DOCKSTAR_DT=y -CONFIG_MACH_DREAMPLUG_DT=y -CONFIG_MACH_GOFLEXNET_DT=y -CONFIG_MACH_GURUPLUG_DT=y -CONFIG_MACH_IB62X0_DT=y -CONFIG_MACH_ICONNECT_DT=y -CONFIG_MACH_INETSPACE_V2_DT=y -CONFIG_MACH_IOMEGA_IX2_200_DT=y -CONFIG_MACH_KM_KIRKWOOD_DT=y CONFIG_MACH_LSXL_DT=y CONFIG_MACH_MPLCEC4_DT=y -CONFIG_MACH_NETSPACE_LITE_V2_DT=y -CONFIG_MACH_NETSPACE_MAX_V2_DT=y -CONFIG_MACH_NETSPACE_MINI_V2_DT=y -CONFIG_MACH_NETSPACE_V2_DT=y CONFIG_MACH_NSA310_DT=y -CONFIG_MACH_OPENBLOCKS_A6_DT=y CONFIG_MACH_READYNAS_DT=y -CONFIG_MACH_TOPKICK_DT=y CONFIG_MACH_TS219_DT=y # CONFIG_CPU_FEROCEON_OLD_ID is not set CONFIG_PREEMPT=y
arch/arm/mach-kirkwood/Kconfig +0 -117
147 lines not on this page · raw message
arch/arm/mach-kirkwood/Makefile +0 -16
@@ -20,25 +20,9 @@ obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o -obj-$(CONFIG_MACH_CLOUDBOX_DT) += board-ns2.o obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += board-dnskw.o -obj-$(CONFIG_MACH_DOCKSTAR_DT) += board-dockstar.o -obj-$(CONFIG_MACH_DREAMPLUG_DT) += board-dreamplug.o -obj-$(CONFIG_MACH_GOFLEXNET_DT) += board-goflexnet.o -obj-$(CONFIG_MACH_GURUPLUG_DT) += board-guruplug.o -obj-$(CONFIG_MACH_IB62X0_DT) += board-ib62x0.o -obj-$(CONFIG_MACH_ICONNECT_DT) += board-iconnect.o -obj-$(CONFIG_MACH_INETSPACE_V2_DT) += board-ns2.o -obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT) += board-iomega_ix2_200.o -obj-$(CONFIG_MACH_KM_KIRKWOOD_DT) += board-km_kirkwood.o obj-$(CONFIG_MACH_LSXL_DT) += board-lsxl.o obj-$(CONFIG_MACH_MPLCEC4_DT) += board-mplcec4.o -obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT) += board-ns2.o -obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT) += board-ns2.o -obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT) += board-ns2.o -obj-$(CONFIG_MACH_NETSPACE_V2_DT) += board-ns2.o obj-$(CONFIG_MACH_NSA310_DT) += board-nsa310.o -obj-$(CONFIG_MACH_OPENBLOCKS_A6_DT) += board-openblocks_a6.o obj-$(CONFIG_MACH_READYNAS_DT) += board-readynas.o -obj-$(CONFIG_MACH_TOPKICK_DT) += board-usi_topkick.o obj-$(CONFIG_MACH_TS219_DT) += board-ts219.o tsx1x-common.o
arch/arm/mach-kirkwood/board-dnskw.c +0 -7
@@ -14,14 +14,9 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> -#include <linux/mv643xx_eth.h> #include <linux/gpio.h> #include "common.h" -static struct mv643xx_eth_platform_data dnskw_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (8 ), -}; -/* Register any GPIO for output and set the value */ static void __init dnskw_gpio_register (unsigned gpio,char *name,int def) {
@@ -36,8 +31,6 @@ static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)void __init dnskw_init (void ) { -kirkwood_ge00_init (&dnskw_ge00_data); -/* Set NAS to turn back on after a power failure */ dnskw_gpio_register (37 ,"dnskw:power:recover" ,1 ); }
arch/arm/mach-kirkwood/board-dockstar.c deleted +0 -32
@@ -1,32 +0,0 @@ -/* -* arch/arm/mach-kirkwood/board-dockstar.c -* -* Seagate FreeAgent Dockstar Board Init for drivers not converted to -* flattened device tree yet. -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -* -* Copied and modified for Seagate GoFlex Net support by -* Joshua Coombs <[email protected]> based on ArchLinux ARM's -* GoFlex kernel patches. -* -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/mv643xx_eth.h> -#include "common.h" - -static struct mv643xx_eth_platform_data dockstar_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; - -void __init dockstar_dt_init (void ) -{ -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&dockstar_ge00_data); -}
arch/arm/mach-kirkwood/board-dreamplug.c deleted +0 -35
@@ -1,35 +0,0 @@ -/* -* Copyright 2012 (C), Jason Cooper <[email protected]> -* -* arch/arm/mach-kirkwood/board-dreamplug.c -* -* Marvell DreamPlug Reference Board Init for drivers not converted to -* flattened device tree yet. -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/mv643xx_eth.h> -#include <linux/gpio.h> -#include "common.h" - -static struct mv643xx_eth_platform_data dreamplug_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; - -static struct mv643xx_eth_platform_data dreamplug_ge01_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (1 ), -}; - -void __init dreamplug_init (void ) -{ -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&dreamplug_ge00_data); -kirkwood_ge01_init (&dreamplug_ge01_data); -}
arch/arm/mach-kirkwood/board-dt.c +1 -61
87 lines not on this page · raw message
arch/arm/mach-kirkwood/board-goflexnet.c deleted +0 -34
@@ -1,34 +0,0 @@ -/* -* Copyright 2012 (C), Jason Cooper <[email protected]> -* -* arch/arm/mach-kirkwood/board-goflexnet.c -* -* Seagate GoFlext Net Board Init for drivers not converted to -* flattened device tree yet. -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -* -* Copied and modified for Seagate GoFlex Net support by -* Joshua Coombs <[email protected]> based on ArchLinux ARM's -* GoFlex kernel patches. -* -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/mv643xx_eth.h> -#include "common.h" - -static struct mv643xx_eth_platform_data goflexnet_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; - -void __init goflexnet_init (void ) -{ -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&goflexnet_ge00_data); -}
arch/arm/mach-kirkwood/board-guruplug.c deleted +0 -33
@@ -1,33 +0,0 @@ -/* -* arch/arm/mach-kirkwood/board-guruplug.c -* -* Marvell Guruplug Reference Board Init for drivers not converted to -* flattened device tree yet. -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/mv643xx_eth.h> -#include <linux/gpio.h> -#include "common.h" - -static struct mv643xx_eth_platform_data guruplug_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; - -static struct mv643xx_eth_platform_data guruplug_ge01_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (1 ), -}; - -void __init guruplug_dt_init (void ) -{ -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&guruplug_ge00_data); -kirkwood_ge01_init (&guruplug_ge01_data); -}
arch/arm/mach-kirkwood/board-ib62x0.c deleted +0 -29
@@ -1,29 +0,0 @@ -/* -* Copyright 2012 (C), Simon Baatz <[email protected]> -* -* arch/arm/mach-kirkwood/board-ib62x0.c -* -* RaidSonic ICY BOX IB-NAS6210 & IB-NAS6220 init for drivers not -* converted to flattened device tree yet. -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/mv643xx_eth.h> -#include "common.h" - -static struct mv643xx_eth_platform_data ib62x0_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (8 ), -}; - -void __init ib62x0_init (void ) -{ -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&ib62x0_ge00_data); -}
arch/arm/mach-kirkwood/board-iconnect.c +0 -10
@@ -11,18 +11,8 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/of.h> -#include <linux/mv643xx_eth.h> #include "common.h" -static struct mv643xx_eth_platform_data iconnect_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (11 ), -}; - -void __init iconnect_init (void ) -{ -kirkwood_ge00_init (&iconnect_ge00_data); -} -static int __init iconnect_pci_init (void ) {if (of_machine_is_compatible ("iom,iconnect" ))
arch/arm/mach-kirkwood/board-iomega_ix2_200.c deleted +0 -34
@@ -1,34 +0,0 @@ -/* -* arch/arm/mach-kirkwood/board-iomega_ix2_200.c -* -* Iomega StorCenter ix2-200 -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/mv643xx_eth.h> -#include <linux/ethtool.h> -#include "common.h" - -static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_NONE , - .speed =SPEED_1000 , - .duplex =DUPLEX_FULL , -}; - -static struct mv643xx_eth_platform_data iomega_ix2_200_ge01_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (11 ), -}; - -void __init iomega_ix2_200_init (void ) -{ -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&iomega_ix2_200_ge00_data); -kirkwood_ge01_init (&iomega_ix2_200_ge01_data); -}
arch/arm/mach-kirkwood/board-km_kirkwood.c deleted +0 -44
44 lines not on this page · raw message
arch/arm/mach-kirkwood/board-lsxl.c +0 -16
@@ -14,17 +14,8 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> -#include <linux/mv643xx_eth.h> #include "common.h" -static struct mv643xx_eth_platform_data lsxl_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; - -static struct mv643xx_eth_platform_data lsxl_ge01_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (8 ), -}; -/* * On the LS-XHL/LS-CHLv2, the shutdown process is following: * - Userland monitors key events until the power switch goes to off position
@@ -40,13 +31,6 @@ static void lsxl_power_off(void)void __init lsxl_init (void ) { -/* -* Basic setup. Needs to be called early. -*/ - -kirkwood_ge00_init (&lsxl_ge00_data); -kirkwood_ge01_init (&lsxl_ge01_data); -/* register power-off method */ pm_power_off = lsxl_power_off; }
arch/arm/mach-kirkwood/board-mplcec4.c +0 -14
@@ -11,24 +11,10 @@#include <linux/kernel.h> #include <linux/init.h> -#include <linux/mv643xx_eth.h> #include "common.h" -static struct mv643xx_eth_platform_data mplcec4_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (1 ), -}; - -static struct mv643xx_eth_platform_data mplcec4_ge01_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (2 ), -}; -void __init mplcec4_init (void ) { -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&mplcec4_ge00_data); -kirkwood_ge01_init (&mplcec4_ge01_data);kirkwood_pcie_init (KW_PCIE0 ); }
arch/arm/mach-kirkwood/board-ns2.c deleted +0 -35
@@ -1,35 +0,0 @@ -/* -* Copyright 2012 (C), Simon Guinot <[email protected]> -* -* arch/arm/mach-kirkwood/board-ns2.c -* -* LaCie Network Space v2 board (and parents) initialization for drivers -* not converted to flattened device tree yet. -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/platform_device.h> -#include <linux/mv643xx_eth.h> -#include <linux/of.h> -#include "common.h" - -static struct mv643xx_eth_platform_data ns2_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (8 ), -}; - -void __init ns2_init (void ) -{ -/* -* Basic setup. Needs to be called early. -*/ -if (of_machine_is_compatible ("lacie,cloudbox" ) || -of_machine_is_compatible ("lacie,netspace_lite_v2" ) || -of_machine_is_compatible ("lacie,netspace_mini_v2" )) - ns2_ge00_data.phy_addr =MV643XX_ETH_PHY_ADDR (0 ); -kirkwood_ge00_init (&ns2_ge00_data); -}
arch/arm/mach-kirkwood/board-openblocks_a6.c deleted +0 -26
@@ -1,26 +0,0 @@ -/* -* Copyright 2012 Nobuhiro Iwamatsu <[email protected]> -* -* arch/arm/mach-kirkwood/board-openblocks_a6.c -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/mv643xx_eth.h> -#include "common.h" - -static struct mv643xx_eth_platform_data openblocks_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; - -void __init openblocks_a6_init (void ) -{ -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&openblocks_ge00_data); -}
arch/arm/mach-kirkwood/board-readynas.c +0 -6
@@ -13,16 +13,10 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> -#include <linux/mv643xx_eth.h> #include <mach/kirkwood.h> #include "common.h" -static struct mv643xx_eth_platform_data netgear_readynas_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; -void __init netgear_readynas_init (void ) { -kirkwood_ge00_init (&netgear_readynas_ge00_data);kirkwood_pcie_init (KW_PCIE0 ); }
arch/arm/mach-kirkwood/board-ts219.c +0 -13
@@ -18,27 +18,14 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> -#include <linux/mv643xx_eth.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <mach/kirkwood.h> #include "common.h" #include "tsx1x-common.h" -static struct mv643xx_eth_platform_data qnap_ts219_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (8 ), -}; -void __init qnap_dt_ts219_init (void ) { -u32 dev, rev; - -kirkwood_pcie_id (&dev, &rev); -if (dev ==MV88F6282_DEV_ID ) - qnap_ts219_ge00_data.phy_addr =MV643XX_ETH_PHY_ADDR (0 ); - -kirkwood_ge00_init (&qnap_ts219_ge00_data); - pm_power_off = qnap_tsx1x_power_off; }
arch/arm/mach-kirkwood/board-usi_topkick.c deleted +0 -29
@@ -1,29 +0,0 @@ -/* -* Copyright 2012 (C), Jason Cooper <[email protected]> -* -* arch/arm/mach-kirkwood/board-usi_topkick.c -* -* USI Topkick Init for drivers not converted to flattened device tree yet. -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/mv643xx_eth.h> -#include <linux/gpio.h> -#include "common.h" - -static struct mv643xx_eth_platform_data topkick_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), -}; - -void __init usi_topkick_init (void ) -{ -/* -* Basic setup. Needs to be called early. -*/ -kirkwood_ge00_init (&topkick_ge00_data); -}
Signature · 1 line
1.7.10.4
Re: [PATCH v5 12/13] ARM: kirkwood: remove redundant DT board files
Hi Jason and Sebastian,
Quoted 35 lines · Sebastian Hesselbarth
With DT support for
mv643xx_ethboard specific init for some boards now is unneccessary. Remove those board files,Kconfigentries, and corresponding entries inkirkwood_defconfig.Signed-off-by Sebastian Hesselbarth <[email protected]>---
Note:board-km_kirkwood.cis also removed, as Valentin Longchamp confirmed the lock-up is not caused by accessing clock gating registers but rather non-existent device registers. This will be addressed by dtsi separation for kirkwood and bobcat SoC variants.Changelog:
v3->v4:
- remove more boards that don't require board specific setupCc David Miller <[email protected]>Cc Lennert Buytenhek <[email protected]>Cc Jason Cooper <[email protected]>Cc Andrew Lunn <[email protected]>Cc Benjamin Herrenschmidt <[email protected]>Cc netdev at vger.kernel.orgCc linux-arm-kernel at lists.infradead.orgCc linuxppc-dev at lists.ozlabs.orgCc linux-kernel at vger.kernel.org--- arch/arm/configs/kirkwood_defconfig | 16 ---- arch/arm/mach-kirkwood/Kconfig | 117 ------------------------- arch/arm/mach-kirkwood/Makefile | 16 ---- arch/arm/mach-kirkwood/board-dnskw.c | 7 -- arch/arm/mach-kirkwood/board-dockstar.c | 32 ------- arch/arm/mach-kirkwood/board-dreamplug.c | 35 -------- arch/arm/mach-kirkwood/board-dt.c | 62 +------------ arch/arm/mach-kirkwood/board-goflexnet.c | 34 ------- arch/arm/mach-kirkwood/board-guruplug.c | 33 ------- arch/arm/mach-kirkwood/board-ib62x0.c | 29 ------
Quoted 8 lines
arch/arm/mach-kirkwood/board-iconnect.c | 10 --- arch/arm/mach-kirkwood/board-iomega_ix2_200.c | 34 ------- arch/arm/mach-kirkwood/board-km_kirkwood.c | 44 ---------- arch/arm/mach-kirkwood/board-lsxl.c | 16 ---- arch/arm/mach-kirkwood/board-mplcec4.c | 14 --- arch/arm/mach-kirkwood/board-ns2.c | 35 -------- arch/arm/mach-kirkwood/board-openblocks_a6.c | 26 ------ arch/arm/mach-kirkwood/board-readynas.c | 6 --
Just a stupid note: With Thomas ongoing work to get mvebu-pcie driver in place and enabled for kirkwood, some boards setup files will also lose their pcie init routines, which may allow you to kill those additonal files soon.
For instance 6bd98481ab34 (arm: kirkwood: NETGEAR ReadyNAS Duo v2 init PCIe via DT) currently sitting in jcooper/mvebu/pcie_kirkwood removes the PCIE init routine in board-readynas.c, and yours remove ge00 init. With both applied, the whole file can go away.
AFAICT, this may be the case soon for:
arch/arm/mach-kirkwood/board-iconnect.c (36e5722089) arch/arm/mach-kirkwood/board-mplcec4.c (9470fbfb8d) arch/arm/mach-kirkwood/board-nsa310.c (40fa8e5da2) arch/arm/mach-kirkwood/board-readynas.c (6bd98481ab) arch/arm/mach-kirkwood/board-ts219.c (259e234608)
Anyway, thanks for this work Sebastian.
Cheers,
a+
Sebastian Hesselbarth
maintainerRe: [PATCH v5 12/13] ARM: kirkwood: remove redundant DT board files
Quoted 6 lines · Arnaud Ebalard
Quoted 5 lines · Sebastian Hesselbarth
With DT support for
mv643xx_ethboard specific init for some boards now is unneccessary. Remove those board files,Kconfigentries, and corresponding entries inkirkwood_defconfig.Signed-off-by Sebastian Hesselbarth <[email protected]>
...
Quoted 12 lines
Just a stupid note: With Thomas ongoing work to get mvebu-pcie driver in place and enabled for kirkwood, some boards setup files will also lose their pcie init routines, which may allow you to kill those additonal files soon.
For instance
6bd98481ab34(arm: kirkwood: NETGEAR ReadyNAS Duo v2 init PCIe via DT) currently sitting in jcooper/mvebu/pcie_kirkwood removes the PCIE init routine inboard-readynas.c, and yours remove ge00 init. With both applied, the whole file can go away.AFAICT, this may be the case soon for:
Quoted 7 lines
arch/arm/mach-kirkwood/board-iconnect.c (36e5722089) arch/arm/mach-kirkwood/board-mplcec4.c (9470fbfb8d) arch/arm/mach-kirkwood/board-nsa310.c (40fa8e5da2) arch/arm/mach-kirkwood/board-readynas.c (6bd98481ab) arch/arm/mach-kirkwood/board-ts219.c (259e234608)Anyway, thanks for this work Sebastian.
Arnaud,
I already realized this when merging Jason's recent PRs and put mv643xx_eth patches on top. I am aware of it but as ARM part of mv643xx_eth will be delayed until net part surfaces, we have plenty of time to react on current updates to mach-kirkwood boards.
Sebastian
Re: [PATCH v5 12/13] ARM: kirkwood: remove redundant DT board files
In reply to Arnaud EbalardQuoted 48 lines · Arnaud Ebalard
Hi Jason and Sebastian,
Quoted 35 lines · Sebastian Hesselbarth
With DT support for
mv643xx_ethboard specific init for some boards now is unneccessary. Remove those board files,Kconfigentries, and corresponding entries inkirkwood_defconfig.Signed-off-by Sebastian Hesselbarth <[email protected]>---
Note:board-km_kirkwood.cis also removed, as Valentin Longchamp confirmed the lock-up is not caused by accessing clock gating registers but rather non-existent device registers. This will be addressed by dtsi separation for kirkwood and bobcat SoC variants.Changelog:
v3->v4:
- remove more boards that don't require board specific setupCc David Miller <[email protected]>Cc Lennert Buytenhek <[email protected]>Cc Jason Cooper <[email protected]>Cc Andrew Lunn <[email protected]>Cc Benjamin Herrenschmidt <[email protected]>Cc netdev at vger.kernel.orgCc linux-arm-kernel at lists.infradead.orgCc linuxppc-dev at lists.ozlabs.orgCc linux-kernel at vger.kernel.org--- arch/arm/configs/kirkwood_defconfig | 16 ---- arch/arm/mach-kirkwood/Kconfig | 117 ------------------------- arch/arm/mach-kirkwood/Makefile | 16 ---- arch/arm/mach-kirkwood/board-dnskw.c | 7 -- arch/arm/mach-kirkwood/board-dockstar.c | 32 ------- arch/arm/mach-kirkwood/board-dreamplug.c | 35 -------- arch/arm/mach-kirkwood/board-dt.c | 62 +------------ arch/arm/mach-kirkwood/board-goflexnet.c | 34 ------- arch/arm/mach-kirkwood/board-guruplug.c | 33 ------- arch/arm/mach-kirkwood/board-ib62x0.c | 29 ------Quoted 8 lines
arch/arm/mach-kirkwood/board-iconnect.c | 10 --- arch/arm/mach-kirkwood/board-iomega_ix2_200.c | 34 ------- arch/arm/mach-kirkwood/board-km_kirkwood.c | 44 ---------- arch/arm/mach-kirkwood/board-lsxl.c | 16 ---- arch/arm/mach-kirkwood/board-mplcec4.c | 14 --- arch/arm/mach-kirkwood/board-ns2.c | 35 -------- arch/arm/mach-kirkwood/board-openblocks_a6.c | 26 ------ arch/arm/mach-kirkwood/board-readynas.c | 6 --
Quoted 4 lines
Just a stupid note: With Thomas ongoing work to get mvebu-pcie driver in place and enabled for kirkwood, some boards setup files will also lose their pcie init routines, which may allow you to kill those additonal files soon.
Yes, we're very excited about this ;-)
Quoted 5 lines
For instance
6bd98481ab34(arm: kirkwood: NETGEAR ReadyNAS Duo v2 init PCIe via DT) currently sitting in jcooper/mvebu/pcie_kirkwood removes the PCIE init routine inboard-readynas.c, and yours remove ge00 init. With both applied, the whole file can go away.
Quoted 7 lines
AFAICT, this may be the case soon for:
arch/arm/mach-kirkwood/board-iconnect.c (36e5722089) arch/arm/mach-kirkwood/board-mplcec4.c (9470fbfb8d) arch/arm/mach-kirkwood/board-nsa310.c (40fa8e5da2) arch/arm/mach-kirkwood/board-readynas.c (6bd98481ab) arch/arm/mach-kirkwood/board-ts219.c (259e234608)
Would you mind putting a patch together (for after v3.10 drops) to do this? If you applied Sebastian's series on top of mvebu/pcie_kirkwood, that should get you almost there. The last half of his series is going in after v3.10...
You may want to try merging in mvebu/boards and mvebu/soc. Those have the changes to use dt for the restart and power-off drivers. That'll allow us to empty out a few more board files. mvebu/dt also has a patch from Valentin allowing us to remove the keymile board as well.
thx,
Jason.
Re: [PATCH v5 12/13] ARM: kirkwood: remove redundant DT board files
Hi,
Quoted 13 lines · Jason Cooper
Quoted 5 lines
For instance
6bd98481ab34(arm: kirkwood: NETGEAR ReadyNAS Duo v2 init PCIe via DT) currently sitting in jcooper/mvebu/pcie_kirkwood removes the PCIE init routine inboard-readynas.c, and yours remove ge00 init. With both applied, the whole file can go away.Quoted 7 lines
AFAICT, this may be the case soon for:
arch/arm/mach-kirkwood/board-iconnect.c (36e5722089) arch/arm/mach-kirkwood/board-mplcec4.c (9470fbfb8d) arch/arm/mach-kirkwood/board-nsa310.c (40fa8e5da2) arch/arm/mach-kirkwood/board-readynas.c (6bd98481ab) arch/arm/mach-kirkwood/board-ts219.c (259e234608)
Quoted 4 lines
Would you mind putting a patch together (for after v3.10 drops) to do this? If you applied Sebastian's series on top of mvebu/pcie_kirkwood, that should get you almost there. The last half of his series is going in after v3.10...
Something like the quick quilt-generated patch at the end of this email (done after a dummy merge of Sebastian's set in mvebu/pcie_kirkwood)? I will take a look at what remains after Sebastian's set hit one of your branch but I guess he will have included most of what is in the patch to help you with the merge.
Anyway, at the end here is what DT board files would remain:
$ ls -1 arch/arm/mach-kirkwood/board-*.c arch/arm/mach-kirkwood/board-dnskw.c arch/arm/mach-kirkwood/board-dt.c arch/arm/mach-kirkwood/board-lsxl.c arch/arm/mach-kirkwood/board-ts219.c
Just one question though: the removal of MACH_*_DT in Kconfig removes the automatic selection of useful board specific options like ARM_APPENDED_DTB, ARM_ATAG_DTB_COMPAT, POWER_RESET_RESTART, POWER_RESET_QNAP. Is that expected?
Quoted 4 lines
You may want to try merging in mvebu/boards and mvebu/soc. Those have the changes to use dt for the restart and power-off drivers. That'll allow us to empty out a few more board files. mvebu/dt also has a patch from Valentin allowing us to remove the keymile board as well.
yes. After a merge w/ mvebu/boards to get restart and poweroff would allow to get rid of board-ts219.c and board-lsxl.c, leaving mainly board-dnskw.c.
Cheers,
a+
arch/arm/mach-kirkwood/board-iconnect.c deleted +0 -15
@@ -1,15 +0,0 @@ -/* -* arch/arm/mach-kirkwood/board-iconnect.c -* -* Iomega i-connect Board Setup -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/of.h> -#include "common.h" -
arch/arm/mach-kirkwood/Makefile +0 -3
@@ -19,9 +19,6 @@ obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o -obj-$(CONFIG_MACH_DB88F628X_BP_DT) += board-db88f628x-bp.o obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += board-dnskw.o obj-$(CONFIG_MACH_LSXL_DT) += board-lsxl.o -obj-$(CONFIG_MACH_MPLCEC4_DT) += board-mplcec4.o -obj-$(CONFIG_MACH_READYNAS_DT) += board-readynas.o obj-$(CONFIG_MACH_TS219_DT) += board-ts219.o tsx1x-common.o
arch/arm/mach-kirkwood/board-db88f628x-bp.c deleted +0 -24
@@ -1,24 +0,0 @@ -/* -* Saeed Bishara <[email protected]> -* -* Marvell DB-88F628{1,2}-BP Development Board Setup -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/of.h> -#include <linux/mv643xx_eth.h> -#include "common.h" - -static struct mv643xx_eth_platform_data db88f628x_ge00_data = { - .phy_addr =MV643XX_ETH_PHY_ADDR (8 ), -}; - -void __init db88f628x_init (void ) -{ -kirkwood_ge00_init (&db88f628x_ge00_data); -}
arch/arm/mach-kirkwood/board-mplcec4.c deleted +0 -21
@@ -1,21 +0,0 @@ -/* -* Copyright (C) 2012 MPL AG, Switzerland -* Stefan Peter <[email protected]> -* -* arch/arm/mach-kirkwood/board-mplcec4.c -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include "common.h" - -void __init mplcec4_init (void ) -{ -} - - -
arch/arm/mach-kirkwood/board-readynas.c deleted +0 -21
@@ -1,21 +0,0 @@ -/* -* NETGEAR ReadyNAS Duo v2 Board setup for drivers not already -* converted to DT. -* -* Copyright (C) 2013, Arnaud EBALARD <[email protected]> -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version -* 2 of the License, or (at your option) any later version. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/platform_device.h> -#include <mach/kirkwood.h> -#include "common.h" - -void __init netgear_readynas_init (void ) -{ -}
arch/arm/mach-kirkwood/common.h +0 -92
110 lines not on this page · raw message
arch/arm/mach-kirkwood/Kconfig +0 -23
@@ -140,13 +140,6 @@ Say 'Y' here if you want your kernel to support the Marvell Kirkwood using flattened device tree. -config MACH_DB88F628X_BP_DT - bool "Marvell DB-88F628x-BP Development Board (Flattened Device Tree)" - help - Say 'Y' here if you want your kernel to support the Marvell - DB-88F6281-BP and DB-88F6282-BP Development Board (Flattened - Device Tree). - config MACH_DLINK_KIRKWOOD_DT bool "D-Link Kirkwood-based NAS (Flattened Device Tree)" select ARCH_KIRKWOOD_DT
@@ -163,22 +156,6 @@ Buffalo Linkstation LS-XHL & LS-CHLv2 devices, using Flattened Device Tree. -config MACH_MPLCEC4_DT - bool "MPL CEC4 (Flattened Device Tree)" - select ARCH_KIRKWOOD_DT - help - Say 'Y' here if you want your kernel to support the - MPL CEC4 (Flattened Device Tree). - -config MACH_READYNAS_DT - bool "NETGEAR ReadyNAS Duo v2 (Flattened Device Tree)" - select ARCH_KIRKWOOD_DT - select ARM_APPENDED_DTB - select ARM_ATAG_DTB_COMPAT - help - Say 'Y' here if you want your kernel to support the - NETGEAR ReadyNAS Duo v2 using Fattened Device Tree. - config MACH_TS219_DT bool "Device Tree for QNAP TS-11X, TS-21X NAS" select ARCH_KIRKWOOD_DT
arch/arm/configs/kirkwood_defconfig +0 -3
@@ -32,9 +32,6 @@ CONFIG_MACH_TS41X=y CONFIG_MACH_DLINK_KIRKWOOD_DT=y CONFIG_MACH_LSXL_DT=y -CONFIG_MACH_MPLCEC4_DT=y -CONFIG_MACH_NSA310_DT=y -CONFIG_MACH_READYNAS_DT=y CONFIG_MACH_TS219_DT=y # CONFIG_CPU_FEROCEON_OLD_ID is not set CONFIG_PREEMPT=y
arch/arm/mach-kirkwood/board-dt.c +0 -10
@@ -113,16 +113,6 @@if (of_machine_is_compatible ("buffalo,lsxl" ))lsxl_init (); -if (of_machine_is_compatible ("marvell,db-88f6281-bp" ) || -of_machine_is_compatible ("marvell,db-88f6282-bp" )) -db88f628x_init (); - -if (of_machine_is_compatible ("mpl,cec4" )) -mplcec4_init (); - -if (of_machine_is_compatible ("netgear,readynas-duo-v2" )) -netgear_readynas_init (); -of_platform_populate (NULL , kirkwood_dt_match_table,NULL ,NULL ); }
Re: [PATCH v5 12/13] ARM: kirkwood: remove redundant DT board files
Arnaud,
Quoted 17 lines · Arnaud Ebalard
Hi,
Quoted 13 lines · Jason Cooper
Quoted 12 lines
For instance
6bd98481ab34(arm: kirkwood: NETGEAR ReadyNAS Duo v2 init PCIe via DT) currently sitting in jcooper/mvebu/pcie_kirkwood removes the PCIE init routine inboard-readynas.c, and yours remove ge00 init. With both applied, the whole file can go away.AFAICT, this may be the case soon for:
arch/arm/mach-kirkwood/board-iconnect.c (36e5722089) arch/arm/mach-kirkwood/board-mplcec4.c (9470fbfb8d) arch/arm/mach-kirkwood/board-nsa310.c (40fa8e5da2) arch/arm/mach-kirkwood/board-readynas.c (6bd98481ab) arch/arm/mach-kirkwood/board-ts219.c (259e234608)
Quoted 7 lines
Quoted 4 lines
Would you mind putting a patch together (for after v3.10 drops) to do this? If you applied Sebastian's series on top of mvebu/pcie_kirkwood, that should get you almost there. The last half of his series is going in after v3.10...
Something like the quick quilt-generated patch at the end of this email (done after a dummy merge of Sebastian's set in mvebu/pcie_kirkwood)?
yep.
Quoted 8 lines
I will take a look at what remains after Sebastian's set hit one of your branch but I guess he will have included most of what is in the patch to help you with the merge.
Anyway, at the end here is what DT board files would remain:
$ ls -1 arch/arm/mach-kirkwood/board-*.c arch/arm/mach-kirkwood/board-dnskw.c
This one seems to just be setting a gpio to enable reboot after power failure. Should be simple to move to DT.
Quoted 1 line
arch/arm/mach-kirkwood/board-dt.c
We obviously need this one. ;-)
Quoted 1 line
arch/arm/mach-kirkwood/board-lsxl.c
This is taken care of in mvebu/boards
391a16c ARM: Kirkwood: Convert LSXL to restart-poweroff driver.
Quoted 1 line
arch/arm/mach-kirkwood/board-ts219.c
Also in mvebu/boards
4350a47 ARM: Kirkwood: Make use of the QNAP Power off driver.
Quoted 4 lines
Just one question though: the removal of MACH_*_DT in
Kconfigremoves the automatic selection of useful board specific options likeARM_APPENDED_DTB,ARM_ATAG_DTB_COMPAT,POWER_RESET_RESTART,POWER_RESET_QNAP. Is that expected?
I would select POWER_RESET_QNAP and POWER_RESET_RESTART in Kconfig for ARCH_KIRKWOOD_DT, and put ARM_APPENDED_DTB and ARM_ATAG_DTB_COMPAT into the defconfig.
thx,
Jason.
Sebastian Hesselbarth
maintainerPATCH v5 13/13 ARM: orion5x: remove legacy mv643xx_eth board setup
In reply to Sebastian HesselbarthWith DT support for mv643xx_eth we do not need legacy platform_data based setup for DT enabled boards. This patch removes eth setup for all orion5x DT board files.
---
Cc: David Miller <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: netdev at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-kernel at vger.kernel.org
--- arch/arm/mach-orion5x/edmini_v2-setup.c | 10 ---------- 1 file changed, 10 deletions(-)
arch/arm/mach-orion5x/edmini_v2-setup.c +0 -10
@@ -24,7 +24,6 @@#include <linux/pci.h> #include <linux/irq.h> #include <linux/mtd/physmap.h> -#include <linux/mv643xx_eth.h> #include <linux/leds.h> #include <linux/gpio_keys.h> #include <linux/input.h>
@@ -96,14 +95,6 @@ static struct platform_device edmini_v2_nor_flash = { };/***************************************************************************** -* Ethernet -****************************************************************************/ - -static struct mv643xx_eth_platform_data edmini_v2_eth_data = { - .phy_addr =8 , -}; - -/***************************************************************************** * RTC 5C372a on I2C bus ****************************************************************************/
@@ -152,7 +143,6 @@ void __init edmini_v2_init(void)* Configure peripherals. */ orion5x_ehci0_init (); -orion5x_eth_init (&edmini_v2_eth_data);mvebu_mbus_add_window ("devbus-boot" ,EDMINI_V2_NOR_BOOT_BASE ,EDMINI_V2_NOR_BOOT_SIZE );
Signature · 1 line
1.7.10.4
David Miller
maintainerRe: [PATCH v5 00/13] net: mv643xx_eth DT support and fixes
In reply to Sebastian HesselbarthFrom: Sebastian Hesselbarth <[email protected]>
Date: Wed, 29 May 2013 21:32:42 +0200
Quoted 4 lines
For the patches above I suggest to take Patches 1-6 through David Miller's branch, and Patches 7-12 through Jason Cooper's when the former have appeared on mainline linux. The patch set has been based on v3.10-rc3.
Patches 1-6 applied to net-next, and patch #1 queued up for -stable.
Thanks!
Sebastian Hesselbarth
maintainerRe: [PATCH v5 00/13] net: mv643xx_eth DT support and fixes
Quoted 9 lines · David Miller
From: Sebastian Hesselbarth<[email protected]>
Date: Wed, 29 May 2013 21:32:42 +0200Quoted 4 lines
For the patches above I suggest to take Patches 1-6 through David Miller's branch, and Patches 7-12 through Jason Cooper's when the former have appeared on mainline linux. The patch set has been based on v3.10-rc3.
Patches 1-6 applied to net-next, and patch #1 queued up for -stable.
David,
thanks for pulling these in. I finally found how to check if a patch already went into -stable. As Jason already said, the mdio patch that #1 fixes did not yet went into -stable. Can you unqueue it? Sorry for the confusion.
Sebastian
David Miller
maintainerRe: [PATCH v5 00/13] net: mv643xx_eth DT support and fixes
From: Sebastian Hesselbarth <[email protected]>
Date: Fri, 31 May 2013 08:28:58 +0200
Quoted 4 lines
thanks for pulling these in. I finally found how to check if a patch already went into -stable. As Jason already said, the mdio patch that #1 fixes did not yet went into -stable. Can you unqueue it? Sorry for the confusion.
I'll unqueue it, thanks.