Skip to contentSkip to conversation

dt-bindings: net: dsa: Add KSZ8567 switch support

PATCH Superseded Philippe Schenker 2 participants 3 messages Jan 25, 2024 – Jan 30, 2024

Subsystems (5)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 dt-bindings: net: dsa: Add KSZ8567 switch support

From: Philippe Schenker <[email protected]>

This commit adds the dt-binding for KSZ8567, a robust 7-port Ethernet switch. The KSZ8567 features two RGMII/MII/RMII interfaces, each capable of gigabit speeds, complemented by five 10/100 Mbps MAC/PHYs.

This binding is necessary to set specific capabilities for this switch chip that are necessary due to the ksz dsa driver only accepting specific chip ids.
The KSZ8567 is very similar to KSZ9567 however only containing 100 Mbps phys on its downstream ports.

---

Changes in v2:
- Describe in commit message why this is necessary

 Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml +1 -0
index c963dc09e8e1..52acc15ebcbf 100644
@@ -31,6 +31,7 @@ properties:
       - microchip,ksz9893
       - microchip,ksz9563
       - microchip,ksz8563
+      - microchip,ksz8567
 
   reset-gpios:
     description:
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 2/2 net: dsa: Add KSZ8567 switch support

From: Philippe Schenker <[email protected]>

This commit introduces support for the KSZ8567, a robust 7-port Ethernet switch. The KSZ8567 features two RGMII/MII/RMII interfaces, each capable of gigabit speeds, complemented by five 10/100 Mbps MAC/PHYs.

---

Changes in v2:
- Move the definition of KSZ8567 next to similar KSZ9567

 drivers/net/dsa/microchip/ksz9477_i2c.c     |  4 ++
 drivers/net/dsa/microchip/ksz_common.c      | 42 ++++++++++++++++++++-
 drivers/net/dsa/microchip/ksz_common.h      |  1 +
 drivers/net/dsa/microchip/ksz_spi.c         |  5 +++
 include/linux/platform_data/microchip-ksz.h |  1 +
 5 files changed, 52 insertions(+), 1 deletion(-)
drivers/net/dsa/microchip/ksz9477_i2c.c +4 -0
index cac4a607e54a..82bebee4615c 100644
@@ -103,6 +103,10 @@ static const struct of_device_id ksz9477_dt_ids[] = {
 		.compatible = "microchip,ksz8563",
 		.data = &ksz_switch_chips[KSZ8563]
 	},
+	{
+		.compatible = "microchip,ksz8567",
+		.data = &ksz_switch_chips[KSZ8567]
+	},
 	{
 		.compatible = "microchip,ksz9567",
 		.data = &ksz_switch_chips[KSZ9567]
drivers/net/dsa/microchip/ksz_common.c +41 -1

96 lines not on this page · raw message

drivers/net/dsa/microchip/ksz_common.h +1 -0
index 15612101a155..060c5de9aa05 100644
@@ -187,6 +187,7 @@ struct ksz_device {
 /* List of supported models */
 enum ksz_model {
 	KSZ8563,
+	KSZ8567,
 	KSZ8795,
 	KSZ8794,
 	KSZ8765,
drivers/net/dsa/microchip/ksz_spi.c +5 -0
index 6f6d878e742c..c8166fb440ab 100644
@@ -164,6 +164,10 @@ static const struct of_device_id ksz_dt_ids[] = {
 		.compatible = "microchip,ksz8563",
 		.data = &ksz_switch_chips[KSZ8563]
 	},
+	{
+		.compatible = "microchip,ksz8567",
+		.data = &ksz_switch_chips[KSZ8567]
+	},
 	{
 		.compatible = "microchip,ksz9567",
 		.data = &ksz_switch_chips[KSZ9567]
@@ -204,6 +208,7 @@ static const struct spi_device_id ksz_spi_ids[] = {
 	{ "ksz9893" },
 	{ "ksz9563" },
 	{ "ksz8563" },
+	{ "ksz8567" },
 	{ "ksz9567" },
 	{ "lan9370" },
 	{ "lan9371" },
include/linux/platform_data/microchip-ksz.h +1 -0
index f177416635a2..c4466e56d9d7 100644
@@ -24,6 +24,7 @@
 
 enum ksz_chip_id {
 	KSZ8563_CHIP_ID = 0x8563,
+	KSZ8567_CHIP_ID = 0x00856700,
 	KSZ8795_CHIP_ID = 0x8795,
 	KSZ8794_CHIP_ID = 0x8794,
 	KSZ8765_CHIP_ID = 0x8765,
Signature · 1 line
2.34.1
Acked-by on v2 2/2
#2 lore raw

Re: [PATCH net-next v2 2/2] net: dsa: Add KSZ8567 switch support

Hi Philippe,

Quoted 7 lines · Philippe Schenker
include/linux/platform_data/microchip-ksz.h +0 -0
index f177416635a2..c4466e56d9d7 100644

include/linux/platform_data/microchip-ksz.h line 30

Quoted 7 lines
include/linux/platform_data/microchip-ksz.h +1 -0
@@ -24,6 +24,7 @@
 
 enum ksz_chip_id {
        KSZ8563_CHIP_ID = 0x8563,
+       KSZ8567_CHIP_ID = 0x00856700,
        KSZ8795_CHIP_ID = 0x8795,
        KSZ8794_CHIP_ID = 0x8794,
        KSZ8765_CHIP_ID = 0x8765,

nitpick: can you move KSZ8567 adjacent to KSZ9567. Since first KSZ8x chips have chipid of 16 bits length. Others have 32 bits length.

otherwise it looks good to me.

Quoted 3 lines

--
2.34.1