OSDN Git Service

net: dsa: add support for ksz9897 ethernet switch
authorLad, Prabhakar <prabhakar.csengg@gmail.com>
Wed, 15 Aug 2018 15:51:23 +0000 (16:51 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Aug 2018 19:24:55 +0000 (12:24 -0700)
ksz9477 is superset of ksz9xx series, driver just works
out of the box for ksz9897 chip with this patch.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/devicetree/bindings/net/dsa/ksz.txt
drivers/net/dsa/microchip/ksz_common.c
drivers/net/dsa/microchip/ksz_spi.c

index a700943..ac145b8 100644 (file)
@@ -4,7 +4,9 @@ Microchip KSZ Series Ethernet switches
 Required properties:
 
 - compatible: For external switch chips, compatible string must be exactly one
-  of: "microchip,ksz9477"
+  of the following:
+  - "microchip,ksz9477"
+  - "microchip,ksz9897"
 
 See Documentation/devicetree/bindings/net/dsa/dsa.txt for a list of additional
 required and optional properties.
index 7210c49..54e0ca6 100644 (file)
@@ -1102,6 +1102,15 @@ static const struct ksz_chip_data ksz_switch_chips[] = {
                .cpu_ports = 0x7F,      /* can be configured as cpu port */
                .port_cnt = 7,          /* total physical port count */
        },
+       {
+               .chip_id = 0x00989700,
+               .dev_name = "KSZ9897",
+               .num_vlans = 4096,
+               .num_alus = 4096,
+               .num_statics = 16,
+               .cpu_ports = 0x7F,      /* can be configured as cpu port */
+               .port_cnt = 7,          /* total physical port count */
+       },
 };
 
 static int ksz_switch_init(struct ksz_device *dev)
index c519469..8c1778b 100644 (file)
@@ -195,6 +195,7 @@ static int ksz_spi_remove(struct spi_device *spi)
 
 static const struct of_device_id ksz_dt_ids[] = {
        { .compatible = "microchip,ksz9477" },
+       { .compatible = "microchip,ksz9897" },
        {},
 };
 MODULE_DEVICE_TABLE(of, ksz_dt_ids);