diff options
author | Guenter Roeck <linux@roeck-us.net> | 2014-10-29 13:45:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-30 14:54:11 -0400 |
commit | 6793abb4e8491b1d673ccfd09e1a73d1ff8b9386 (patch) | |
tree | c6a2a1c1a626016fe80f212969cf6f62063c346d /net/dsa/dsa.c | |
parent | 87e5f66b3723b2d912b565bf7100e5121f302cbf (diff) |
net: dsa: Add support for switch EEPROM access
On some chips it is possible to access the switch eeprom.
Add infrastructure support for it.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/dsa.c')
-rw-r--r-- | net/dsa/dsa.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index 5edbbca89f1f..b51ef592f0a2 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c | |||
@@ -575,6 +575,7 @@ static int dsa_of_probe(struct platform_device *pdev) | |||
575 | const char *port_name; | 575 | const char *port_name; |
576 | int chip_index, port_index; | 576 | int chip_index, port_index; |
577 | const unsigned int *sw_addr, *port_reg; | 577 | const unsigned int *sw_addr, *port_reg; |
578 | u32 eeprom_len; | ||
578 | int ret; | 579 | int ret; |
579 | 580 | ||
580 | mdio = of_parse_phandle(np, "dsa,mii-bus", 0); | 581 | mdio = of_parse_phandle(np, "dsa,mii-bus", 0); |
@@ -626,6 +627,9 @@ static int dsa_of_probe(struct platform_device *pdev) | |||
626 | if (cd->sw_addr > PHY_MAX_ADDR) | 627 | if (cd->sw_addr > PHY_MAX_ADDR) |
627 | continue; | 628 | continue; |
628 | 629 | ||
630 | if (!of_property_read_u32(np, "eeprom-length", &eeprom_len)) | ||
631 | cd->eeprom_len = eeprom_len; | ||
632 | |||
629 | for_each_available_child_of_node(child, port) { | 633 | for_each_available_child_of_node(child, port) { |
630 | port_reg = of_get_property(port, "reg", NULL); | 634 | port_reg = of_get_property(port, "reg", NULL); |
631 | if (!port_reg) | 635 | if (!port_reg) |