* [PATCH net-next v4 0/2] net: dsa: microchip: Add KSZ8895/KSZ8864 switch support
@ 2024-08-15 2:20 Tristram.Ha
2024-08-15 2:20 ` [PATCH net-next v4 1/2] dt-bindings: " Tristram.Ha
2024-08-15 2:20 ` [PATCH net-next v4 2/2] " Tristram.Ha
0 siblings, 2 replies; 8+ messages in thread
From: Tristram.Ha @ 2024-08-15 2:20 UTC (permalink / raw)
To: Woojung Huh, UNGLinuxDriver, devicetree, Andrew Lunn,
Florian Fainelli, Vladimir Oltean, Rob Herring
Cc: Oleksij Rempel, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Krzysztof Kozlowski, Conor Dooley, Marek Vasut,
netdev, linux-kernel, Tristram Ha
From: Tristram Ha <tristram.ha@microchip.com>
This series of patches is to add KSZ8895/KSZ8864 switch support to the
KSZ DSA driver.
v4
- Update with Paolo's suggestion
- Sort KSZ8864 and KSZ8895 behind KSZ8863
v3
- Correct microchip,ksz.yaml to pass yamllint check
v2
- Add maintainers for devicetree
Tristram Ha (2):
dt-bindings: net: dsa: microchip: Add KSZ8895/KSZ8864 switch support
net: dsa: microchip: Add KSZ8895/KSZ8864 switch support
.../bindings/net/dsa/microchip,ksz.yaml | 2 +
drivers/net/dsa/microchip/ksz8795.c | 16 ++-
drivers/net/dsa/microchip/ksz_common.c | 130 +++++++++++++++++-
drivers/net/dsa/microchip/ksz_common.h | 20 ++-
drivers/net/dsa/microchip/ksz_spi.c | 15 +-
include/linux/platform_data/microchip-ksz.h | 2 +
6 files changed, 172 insertions(+), 13 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next v4 1/2] dt-bindings: net: dsa: microchip: Add KSZ8895/KSZ8864 switch support
2024-08-15 2:20 [PATCH net-next v4 0/2] net: dsa: microchip: Add KSZ8895/KSZ8864 switch support Tristram.Ha
@ 2024-08-15 2:20 ` Tristram.Ha
2024-08-15 2:20 ` [PATCH net-next v4 2/2] " Tristram.Ha
1 sibling, 0 replies; 8+ messages in thread
From: Tristram.Ha @ 2024-08-15 2:20 UTC (permalink / raw)
To: Woojung Huh, UNGLinuxDriver, devicetree, Andrew Lunn,
Florian Fainelli, Vladimir Oltean, Rob Herring
Cc: Oleksij Rempel, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Krzysztof Kozlowski, Conor Dooley, Marek Vasut,
netdev, linux-kernel, Tristram Ha, Krzysztof Kozlowski
From: Tristram Ha <tristram.ha@microchip.com>
KSZ8895/KSZ8864 is a switch family developed before KSZ8795 and after
KSZ8863, so it shares some registers and functions in those switches.
KSZ8895 has 5 ports and so is more similar to KSZ8795.
KSZ8864 is a 4-port version of KSZ8895. The first port is removed
while port 5 remains as a host port.
Signed-off-by: Tristram Ha <tristram.ha@microchip.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
index 52acc15ebcbf..26a7da0cc0ce 100644
--- a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
@@ -22,7 +22,9 @@ properties:
- microchip,ksz8794
- microchip,ksz8795
- microchip,ksz8863
+ - microchip,ksz8864 # 4-port version of KSZ8895 family switch
- microchip,ksz8873
+ - microchip,ksz8895 # 5-port version of KSZ8895 family switch
- microchip,ksz9477
- microchip,ksz9897
- microchip,ksz9896
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next v4 2/2] net: dsa: microchip: Add KSZ8895/KSZ8864 switch support
2024-08-15 2:20 [PATCH net-next v4 0/2] net: dsa: microchip: Add KSZ8895/KSZ8864 switch support Tristram.Ha
2024-08-15 2:20 ` [PATCH net-next v4 1/2] dt-bindings: " Tristram.Ha
@ 2024-08-15 2:20 ` Tristram.Ha
2024-08-20 10:08 ` Paolo Abeni
1 sibling, 1 reply; 8+ messages in thread
From: Tristram.Ha @ 2024-08-15 2:20 UTC (permalink / raw)
To: Woojung Huh, UNGLinuxDriver, devicetree, Andrew Lunn,
Florian Fainelli, Vladimir Oltean, Rob Herring
Cc: Oleksij Rempel, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Krzysztof Kozlowski, Conor Dooley, Marek Vasut,
netdev, linux-kernel, Tristram Ha
From: Tristram Ha <tristram.ha@microchip.com>
KSZ8895/KSZ8864 is a switch family between KSZ8863/73 and KSZ8795, so it
shares some registers and functions in those switches already
implemented in the KSZ DSA driver.
Signed-off-by: Tristram Ha <tristram.ha@microchip.com>
---
drivers/net/dsa/microchip/ksz8795.c | 16 ++-
drivers/net/dsa/microchip/ksz_common.c | 130 +++++++++++++++++++-
drivers/net/dsa/microchip/ksz_common.h | 20 ++-
drivers/net/dsa/microchip/ksz_spi.c | 15 ++-
include/linux/platform_data/microchip-ksz.h | 2 +
5 files changed, 170 insertions(+), 13 deletions(-)
diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c
index d27b9c36d73f..c4b59e628945 100644
--- a/drivers/net/dsa/microchip/ksz8795.c
+++ b/drivers/net/dsa/microchip/ksz8795.c
@@ -121,6 +121,8 @@ int ksz8_change_mtu(struct ksz_device *dev, int port, int mtu)
case KSZ8765_CHIP_ID:
return ksz8795_change_mtu(dev, frame_size);
case KSZ8830_CHIP_ID:
+ case KSZ8864_CHIP_ID:
+ case KSZ8895_CHIP_ID:
return ksz8863_change_mtu(dev, frame_size);
}
@@ -317,7 +319,7 @@ static void ksz8863_r_mib_pkt(struct ksz_device *dev, int port, u16 addr,
void ksz8_r_mib_pkt(struct ksz_device *dev, int port, u16 addr,
u64 *dropped, u64 *cnt)
{
- if (ksz_is_ksz88x3(dev))
+ if (ksz_is_ksz88x3(dev) || ksz_is_8895_family(dev))
ksz8863_r_mib_pkt(dev, port, addr, dropped, cnt);
else
ksz8795_r_mib_pkt(dev, port, addr, dropped, cnt);
@@ -325,7 +327,7 @@ void ksz8_r_mib_pkt(struct ksz_device *dev, int port, u16 addr,
void ksz8_freeze_mib(struct ksz_device *dev, int port, bool freeze)
{
- if (ksz_is_ksz88x3(dev))
+ if (ksz_is_ksz88x3(dev) || ksz_is_8895_family(dev))
return;
/* enable the port for flush/freeze function */
@@ -343,7 +345,8 @@ void ksz8_port_init_cnt(struct ksz_device *dev, int port)
struct ksz_port_mib *mib = &dev->ports[port].mib;
u64 *dropped;
- if (!ksz_is_ksz88x3(dev)) {
+ /* For KSZ8795 family. */
+ if (ksz_is_ksz87xx(dev)) {
/* flush all enabled port MIB counters */
ksz_cfg(dev, REG_SW_CTRL_6, BIT(port), true);
ksz_cfg(dev, REG_SW_CTRL_6, SW_MIB_COUNTER_FLUSH, true);
@@ -542,11 +545,11 @@ static int ksz8_r_sta_mac_table(struct ksz_device *dev, u16 addr,
shifts[STATIC_MAC_FWD_PORTS];
alu->is_override = (data_hi & masks[STATIC_MAC_TABLE_OVERRIDE]) ? 1 : 0;
- /* KSZ8795 family switches have STATIC_MAC_TABLE_USE_FID and
+ /* KSZ8795/KSZ8895 family switches have STATIC_MAC_TABLE_USE_FID and
* STATIC_MAC_TABLE_FID definitions off by 1 when doing read on the
* static MAC table compared to doing write.
*/
- if (ksz_is_ksz87xx(dev))
+ if (ksz_is_ksz87xx(dev) || ksz_is_8895_family(dev))
data_hi >>= 1;
alu->is_static = true;
alu->is_use_fid = (data_hi & masks[STATIC_MAC_TABLE_USE_FID]) ? 1 : 0;
@@ -1617,7 +1620,8 @@ void ksz8_config_cpu_port(struct dsa_switch *ds)
for (i = 0; i < dev->phy_port_cnt; i++) {
p = &dev->ports[i];
- if (!ksz_is_ksz88x3(dev)) {
+ /* For KSZ8795 family. */
+ if (ksz_is_ksz87xx(dev)) {
ksz_pread8(dev, i, regs[P_REMOTE_STATUS], &remote);
if (remote & KSZ8_PORT_FIBER_MODE)
p->fiber = 1;
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index 1491099528be..8ea5eeb477c7 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -2,7 +2,7 @@
/*
* Microchip switch driver main logic
*
- * Copyright (C) 2017-2019 Microchip Technology Inc.
+ * Copyright (C) 2017-2024 Microchip Technology Inc.
*/
#include <linux/delay.h>
@@ -477,6 +477,61 @@ static const u8 ksz8795_shifts[] = {
[DYNAMIC_MAC_SRC_PORT] = 24,
};
+static const u16 ksz8895_regs[] = {
+ [REG_SW_MAC_ADDR] = 0x68,
+ [REG_IND_CTRL_0] = 0x6E,
+ [REG_IND_DATA_8] = 0x70,
+ [REG_IND_DATA_CHECK] = 0x72,
+ [REG_IND_DATA_HI] = 0x71,
+ [REG_IND_DATA_LO] = 0x75,
+ [REG_IND_MIB_CHECK] = 0x75,
+ [P_FORCE_CTRL] = 0x0C,
+ [P_LINK_STATUS] = 0x0E,
+ [P_LOCAL_CTRL] = 0x0C,
+ [P_NEG_RESTART_CTRL] = 0x0D,
+ [P_REMOTE_STATUS] = 0x0E,
+ [P_SPEED_STATUS] = 0x09,
+ [S_TAIL_TAG_CTRL] = 0x0C,
+ [P_STP_CTRL] = 0x02,
+ [S_START_CTRL] = 0x01,
+ [S_BROADCAST_CTRL] = 0x06,
+ [S_MULTICAST_CTRL] = 0x04,
+};
+
+static const u32 ksz8895_masks[] = {
+ [PORT_802_1P_REMAPPING] = BIT(7),
+ [SW_TAIL_TAG_ENABLE] = BIT(1),
+ [MIB_COUNTER_OVERFLOW] = BIT(7),
+ [MIB_COUNTER_VALID] = BIT(6),
+ [VLAN_TABLE_FID] = GENMASK(6, 0),
+ [VLAN_TABLE_MEMBERSHIP] = GENMASK(11, 7),
+ [VLAN_TABLE_VALID] = BIT(12),
+ [STATIC_MAC_TABLE_VALID] = BIT(21),
+ [STATIC_MAC_TABLE_USE_FID] = BIT(23),
+ [STATIC_MAC_TABLE_FID] = GENMASK(30, 24),
+ [STATIC_MAC_TABLE_OVERRIDE] = BIT(22),
+ [STATIC_MAC_TABLE_FWD_PORTS] = GENMASK(20, 16),
+ [DYNAMIC_MAC_TABLE_ENTRIES_H] = GENMASK(6, 0),
+ [DYNAMIC_MAC_TABLE_MAC_EMPTY] = BIT(7),
+ [DYNAMIC_MAC_TABLE_NOT_READY] = BIT(7),
+ [DYNAMIC_MAC_TABLE_ENTRIES] = GENMASK(31, 29),
+ [DYNAMIC_MAC_TABLE_FID] = GENMASK(22, 16),
+ [DYNAMIC_MAC_TABLE_SRC_PORT] = GENMASK(26, 24),
+ [DYNAMIC_MAC_TABLE_TIMESTAMP] = GENMASK(28, 27),
+};
+
+static const u8 ksz8895_shifts[] = {
+ [VLAN_TABLE_MEMBERSHIP_S] = 7,
+ [VLAN_TABLE] = 13,
+ [STATIC_MAC_FWD_PORTS] = 16,
+ [STATIC_MAC_FID] = 24,
+ [DYNAMIC_MAC_ENTRIES_H] = 3,
+ [DYNAMIC_MAC_ENTRIES] = 29,
+ [DYNAMIC_MAC_FID] = 16,
+ [DYNAMIC_MAC_TIMESTAMP] = 27,
+ [DYNAMIC_MAC_SRC_PORT] = 24,
+};
+
static const u16 ksz8863_regs[] = {
[REG_SW_MAC_ADDR] = 0x70,
[REG_IND_CTRL_0] = 0x79,
@@ -1368,6 +1423,61 @@ const struct ksz_chip_data ksz_switch_chips[] = {
.rd_table = &ksz8873_register_set,
},
+ [KSZ8864] = {
+ /* WARNING
+ * =======
+ * KSZ8864 is similar to KSZ8895, except the first port
+ * does not exist.
+ * external cpu
+ * KSZ8864 1,2,3 4
+ * KSZ8895 0,1,2,3 4
+ * port_cnt is configured as 5, even though it is 4
+ */
+ .chip_id = KSZ8864_CHIP_ID,
+ .dev_name = "KSZ8864",
+ .num_vlans = 4096,
+ .num_alus = 0,
+ .num_statics = 32,
+ .cpu_ports = 0x10, /* can be configured as cpu port */
+ .port_cnt = 5, /* total cpu and user ports */
+ .num_tx_queues = 4,
+ .num_ipms = 4,
+ .ops = &ksz8_dev_ops,
+ .phylink_mac_ops = &ksz8_phylink_mac_ops,
+ .mib_names = ksz88xx_mib_names,
+ .mib_cnt = ARRAY_SIZE(ksz88xx_mib_names),
+ .reg_mib_cnt = MIB_COUNTER_NUM,
+ .regs = ksz8895_regs,
+ .masks = ksz8895_masks,
+ .shifts = ksz8895_shifts,
+ .supports_mii = {false, false, false, false, true},
+ .supports_rmii = {false, false, false, false, true},
+ .internal_phy = {false, true, true, true, false},
+ },
+
+ [KSZ8895] = {
+ .chip_id = KSZ8895_CHIP_ID,
+ .dev_name = "KSZ8895",
+ .num_vlans = 4096,
+ .num_alus = 0,
+ .num_statics = 32,
+ .cpu_ports = 0x10, /* can be configured as cpu port */
+ .port_cnt = 5, /* total cpu and user ports */
+ .num_tx_queues = 4,
+ .num_ipms = 4,
+ .ops = &ksz8_dev_ops,
+ .phylink_mac_ops = &ksz8_phylink_mac_ops,
+ .mib_names = ksz88xx_mib_names,
+ .mib_cnt = ARRAY_SIZE(ksz88xx_mib_names),
+ .reg_mib_cnt = MIB_COUNTER_NUM,
+ .regs = ksz8895_regs,
+ .masks = ksz8895_masks,
+ .shifts = ksz8895_shifts,
+ .supports_mii = {false, false, false, false, true},
+ .supports_rmii = {false, false, false, false, true},
+ .internal_phy = {true, true, true, true, false},
+ },
+
[KSZ9477] = {
.chip_id = KSZ9477_CHIP_ID,
.dev_name = "KSZ9477",
@@ -2893,9 +3003,7 @@ static enum dsa_tag_protocol ksz_get_tag_protocol(struct dsa_switch *ds,
struct ksz_device *dev = ds->priv;
enum dsa_tag_protocol proto = DSA_TAG_PROTO_NONE;
- if (dev->chip_id == KSZ8795_CHIP_ID ||
- dev->chip_id == KSZ8794_CHIP_ID ||
- dev->chip_id == KSZ8765_CHIP_ID)
+ if (ksz_is_ksz87xx(dev) || ksz_is_8895_family(dev))
proto = DSA_TAG_PROTO_KSZ8795;
if (dev->chip_id == KSZ8830_CHIP_ID ||
@@ -3011,6 +3119,8 @@ static int ksz_max_mtu(struct dsa_switch *ds, int port)
case KSZ8765_CHIP_ID:
return KSZ8795_HUGE_PACKET_SIZE - VLAN_ETH_HLEN - ETH_FCS_LEN;
case KSZ8830_CHIP_ID:
+ case KSZ8864_CHIP_ID:
+ case KSZ8895_CHIP_ID:
return KSZ8863_HUGE_PACKET_SIZE - VLAN_ETH_HLEN - ETH_FCS_LEN;
case KSZ8563_CHIP_ID:
case KSZ8567_CHIP_ID:
@@ -3368,6 +3478,18 @@ static int ksz_switch_detect(struct ksz_device *dev)
else
return -ENODEV;
break;
+ case KSZ8895_FAMILY_ID:
+ if (id2 == KSZ8895_CHIP_ID_95 ||
+ id2 == KSZ8895_CHIP_ID_95R)
+ dev->chip_id = KSZ8895_CHIP_ID;
+ else
+ return -ENODEV;
+ ret = ksz_read8(dev, REG_KSZ8864_CHIP_ID, &id4);
+ if (ret)
+ return ret;
+ if (id4 & SW_KSZ8864)
+ dev->chip_id = KSZ8864_CHIP_ID;
+ break;
default:
ret = ksz_read32(dev, REG_CHIP_ID0, &id32);
if (ret)
diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h
index 5f0a628b9849..313d2a64cdd4 100644
--- a/drivers/net/dsa/microchip/ksz_common.h
+++ b/drivers/net/dsa/microchip/ksz_common.h
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 */
/* Microchip switch driver common header
*
- * Copyright (C) 2017-2019 Microchip Technology Inc.
+ * Copyright (C) 2017-2024 Microchip Technology Inc.
*/
#ifndef __KSZ_COMMON_H
@@ -200,6 +200,8 @@ enum ksz_model {
KSZ8794,
KSZ8765,
KSZ8830,
+ KSZ8864,
+ KSZ8895,
KSZ9477,
KSZ9896,
KSZ9897,
@@ -624,9 +626,16 @@ static inline bool ksz_is_ksz88x3(struct ksz_device *dev)
return dev->chip_id == KSZ8830_CHIP_ID;
}
+static inline bool ksz_is_8895_family(struct ksz_device *dev)
+{
+ return dev->chip_id == KSZ8895_CHIP_ID ||
+ dev->chip_id == KSZ8864_CHIP_ID;
+}
+
static inline bool is_ksz8(struct ksz_device *dev)
{
- return ksz_is_ksz87xx(dev) || ksz_is_ksz88x3(dev);
+ return ksz_is_ksz87xx(dev) || ksz_is_ksz88x3(dev) ||
+ ksz_is_8895_family(dev);
}
static inline int is_lan937x(struct ksz_device *dev)
@@ -655,6 +664,7 @@ static inline bool is_lan937x_tx_phy(struct ksz_device *dev, int port)
#define SW_FAMILY_ID_M GENMASK(15, 8)
#define KSZ87_FAMILY_ID 0x87
#define KSZ88_FAMILY_ID 0x88
+#define KSZ8895_FAMILY_ID 0x95
#define KSZ8_PORT_STATUS_0 0x08
#define KSZ8_PORT_FIBER_MODE BIT(7)
@@ -663,6 +673,12 @@ static inline bool is_lan937x_tx_phy(struct ksz_device *dev, int port)
#define KSZ87_CHIP_ID_94 0x6
#define KSZ87_CHIP_ID_95 0x9
#define KSZ88_CHIP_ID_63 0x3
+#define KSZ8895_CHIP_ID_95 0x4
+#define KSZ8895_CHIP_ID_95R 0x6
+
+/* KSZ8895 specific register */
+#define REG_KSZ8864_CHIP_ID 0xFE
+#define SW_KSZ8864 BIT(7)
#define SW_REV_ID_M GENMASK(7, 4)
diff --git a/drivers/net/dsa/microchip/ksz_spi.c b/drivers/net/dsa/microchip/ksz_spi.c
index 8e8d83213b04..f4287310e89f 100644
--- a/drivers/net/dsa/microchip/ksz_spi.c
+++ b/drivers/net/dsa/microchip/ksz_spi.c
@@ -2,7 +2,7 @@
/*
* Microchip ksz series register access through SPI
*
- * Copyright (C) 2017 Microchip Technology Inc.
+ * Copyright (C) 2017-2024 Microchip Technology Inc.
* Tristram Ha <Tristram.Ha@microchip.com>
*/
@@ -60,6 +60,9 @@ static int ksz_spi_probe(struct spi_device *spi)
chip->chip_id == KSZ8794_CHIP_ID ||
chip->chip_id == KSZ8765_CHIP_ID)
regmap_config = ksz8795_regmap_config;
+ else if (chip->chip_id == KSZ8895_CHIP_ID ||
+ chip->chip_id == KSZ8864_CHIP_ID)
+ regmap_config = ksz8863_regmap_config;
else
regmap_config = ksz9477_regmap_config;
@@ -136,10 +139,18 @@ static const struct of_device_id ksz_dt_ids[] = {
.compatible = "microchip,ksz8863",
.data = &ksz_switch_chips[KSZ8830]
},
+ {
+ .compatible = "microchip,ksz8864",
+ .data = &ksz_switch_chips[KSZ8864]
+ },
{
.compatible = "microchip,ksz8873",
.data = &ksz_switch_chips[KSZ8830]
},
+ {
+ .compatible = "microchip,ksz8895",
+ .data = &ksz_switch_chips[KSZ8895]
+ },
{
.compatible = "microchip,ksz9477",
.data = &ksz_switch_chips[KSZ9477]
@@ -201,7 +212,9 @@ static const struct spi_device_id ksz_spi_ids[] = {
{ "ksz8794" },
{ "ksz8795" },
{ "ksz8863" },
+ { "ksz8864" },
{ "ksz8873" },
+ { "ksz8895" },
{ "ksz9477" },
{ "ksz9896" },
{ "ksz9897" },
diff --git a/include/linux/platform_data/microchip-ksz.h b/include/linux/platform_data/microchip-ksz.h
index 8c659db4da6b..d074019474f5 100644
--- a/include/linux/platform_data/microchip-ksz.h
+++ b/include/linux/platform_data/microchip-ksz.h
@@ -28,6 +28,8 @@ enum ksz_chip_id {
KSZ8794_CHIP_ID = 0x8794,
KSZ8765_CHIP_ID = 0x8765,
KSZ8830_CHIP_ID = 0x8830,
+ KSZ8864_CHIP_ID = 0x8864,
+ KSZ8895_CHIP_ID = 0x8895,
KSZ9477_CHIP_ID = 0x00947700,
KSZ9896_CHIP_ID = 0x00989600,
KSZ9897_CHIP_ID = 0x00989700,
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v4 2/2] net: dsa: microchip: Add KSZ8895/KSZ8864 switch support
2024-08-15 2:20 ` [PATCH net-next v4 2/2] " Tristram.Ha
@ 2024-08-20 10:08 ` Paolo Abeni
2024-08-20 10:15 ` Paolo Abeni
0 siblings, 1 reply; 8+ messages in thread
From: Paolo Abeni @ 2024-08-20 10:08 UTC (permalink / raw)
To: Tristram.Ha, Woojung Huh, UNGLinuxDriver, devicetree, Andrew Lunn,
Florian Fainelli, Vladimir Oltean, Rob Herring
Cc: Oleksij Rempel, David S. Miller, Eric Dumazet, Jakub Kicinski,
Krzysztof Kozlowski, Conor Dooley, Marek Vasut, netdev,
linux-kernel
On 8/15/24 04:20, Tristram.Ha@microchip.com wrote:
> From: Tristram Ha <tristram.ha@microchip.com>
>
> KSZ8895/KSZ8864 is a switch family between KSZ8863/73 and KSZ8795, so it
> shares some registers and functions in those switches already
> implemented in the KSZ DSA driver.
>
> Signed-off-by: Tristram Ha <tristram.ha@microchip.com>
I usually wait for an explicit ack from the DSA crew on this kind of
patches, but this one and it really looks really unlikely to indroduce
any regression for the already supported chips and it's lingering since
a bit, so I'm applying it now.
Thanks,
Paolo
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v4 2/2] net: dsa: microchip: Add KSZ8895/KSZ8864 switch support
2024-08-20 10:08 ` Paolo Abeni
@ 2024-08-20 10:15 ` Paolo Abeni
2024-08-21 11:02 ` vtpieter
2024-08-22 23:33 ` Tristram.Ha
0 siblings, 2 replies; 8+ messages in thread
From: Paolo Abeni @ 2024-08-20 10:15 UTC (permalink / raw)
To: Tristram.Ha, Woojung Huh, UNGLinuxDriver, devicetree, Andrew Lunn,
Florian Fainelli, Vladimir Oltean, Rob Herring
Cc: Oleksij Rempel, David S. Miller, Eric Dumazet, Jakub Kicinski,
Krzysztof Kozlowski, Conor Dooley, Marek Vasut, netdev,
linux-kernel
On 8/20/24 12:08, Paolo Abeni wrote:
> On 8/15/24 04:20, Tristram.Ha@microchip.com wrote:
>> From: Tristram Ha <tristram.ha@microchip.com>
>>
>> KSZ8895/KSZ8864 is a switch family between KSZ8863/73 and KSZ8795, so it
>> shares some registers and functions in those switches already
>> implemented in the KSZ DSA driver.
>>
>> Signed-off-by: Tristram Ha <tristram.ha@microchip.com>
>
> I usually wait for an explicit ack from the DSA crew on this kind of
> patches, but this one and it really looks really unlikely to indroduce
> any regression for the already supported chips and it's lingering since
> a bit, so I'm applying it now.
Unfortunatelly does not apply cleanly anymore since commit
fd250fed1f8856c37caa7b9a5e6015ad6f5011e5.
Please rebase and re-send.
Thanks,
Paolo
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next v4 2/2] net: dsa: microchip: Add KSZ8895/KSZ8864 switch support
2024-08-20 10:15 ` Paolo Abeni
@ 2024-08-21 11:02 ` vtpieter
2024-08-22 23:30 ` Tristram.Ha
2024-08-22 23:33 ` Tristram.Ha
1 sibling, 1 reply; 8+ messages in thread
From: vtpieter @ 2024-08-21 11:02 UTC (permalink / raw)
To: pabeni
Cc: Tristram.Ha, UNGLinuxDriver, andrew, conor+dt, davem, devicetree,
edumazet, f.fainelli, krzk+dt, kuba, linux-kernel, marex, netdev,
o.rempel, olteanv, robh, woojung.huh
Hi Tristram,
> @@ -325,7 +327,7 @@ void ksz8_r_mib_pkt(struct ksz_device *dev, int port, u16 addr,
>
> void ksz8_freeze_mib(struct ksz_device *dev, int port, bool freeze)
> {
> - if (ksz_is_ksz88x3(dev))
> + if (ksz_is_ksz88x3(dev) || ksz_is_8895_family(dev))
Small comment, would it not be more clear and consistent to introduce
a new ksz_is_ksz88xx function in ksz_common.h, being ksz_is_ksz88x3 ||
ksz_is_8895_family?
That would help with the renamed ksz88x3_dev_ops that you will
encounter when rebasing. In fact, seeing your additions here, I would
propose to rename this struct to ksz88xx_dev_ops.
Cheers, Pieter
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH net-next v4 2/2] net: dsa: microchip: Add KSZ8895/KSZ8864 switch support
2024-08-21 11:02 ` vtpieter
@ 2024-08-22 23:30 ` Tristram.Ha
0 siblings, 0 replies; 8+ messages in thread
From: Tristram.Ha @ 2024-08-22 23:30 UTC (permalink / raw)
To: vtpieter, pabeni
Cc: UNGLinuxDriver, andrew, conor+dt, davem, devicetree, edumazet,
f.fainelli, krzk+dt, kuba, linux-kernel, marex, netdev, o.rempel,
olteanv, robh, Woojung.Huh
> Subject: [PATCH net-next v4 2/2] net: dsa: microchip: Add KSZ8895/KSZ8864 switch
> support
>
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content
> is safe
>
> Hi Tristram,
>
> > @@ -325,7 +327,7 @@ void ksz8_r_mib_pkt(struct ksz_device *dev, int port, u16
> addr,
> >
> > void ksz8_freeze_mib(struct ksz_device *dev, int port, bool freeze)
> > {
> > - if (ksz_is_ksz88x3(dev))
> > + if (ksz_is_ksz88x3(dev) || ksz_is_8895_family(dev))
>
> Small comment, would it not be more clear and consistent to introduce
> a new ksz_is_ksz88xx function in ksz_common.h, being ksz_is_ksz88x3 ||
> ksz_is_8895_family?
>
> That would help with the renamed ksz88x3_dev_ops that you will
> encounter when rebasing. In fact, seeing your additions here, I would
> propose to rename this struct to ksz88xx_dev_ops.
Will update and re-submit patches after testing with new code.
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH net-next v4 2/2] net: dsa: microchip: Add KSZ8895/KSZ8864 switch support
2024-08-20 10:15 ` Paolo Abeni
2024-08-21 11:02 ` vtpieter
@ 2024-08-22 23:33 ` Tristram.Ha
1 sibling, 0 replies; 8+ messages in thread
From: Tristram.Ha @ 2024-08-22 23:33 UTC (permalink / raw)
To: pabeni
Cc: o.rempel, davem, edumazet, kuba, Woojung.Huh, krzk+dt, conor+dt,
marex, netdev, linux-kernel, UNGLinuxDriver, devicetree, andrew,
f.fainelli, olteanv, robh
> Subject: Re: [PATCH net-next v4 2/2] net: dsa: microchip: Add KSZ8895/KSZ8864
> switch support
>
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content
> is safe
>
> On 8/20/24 12:08, Paolo Abeni wrote:
> > On 8/15/24 04:20, Tristram.Ha@microchip.com wrote:
> >> From: Tristram Ha <tristram.ha@microchip.com>
> >>
> >> KSZ8895/KSZ8864 is a switch family between KSZ8863/73 and KSZ8795, so it
> >> shares some registers and functions in those switches already
> >> implemented in the KSZ DSA driver.
> >>
> >> Signed-off-by: Tristram Ha <tristram.ha@microchip.com>
> >
> > I usually wait for an explicit ack from the DSA crew on this kind of
> > patches, but this one and it really looks really unlikely to indroduce
> > any regression for the already supported chips and it's lingering since
> > a bit, so I'm applying it now.
>
> Unfortunatelly does not apply cleanly anymore since commit
> fd250fed1f8856c37caa7b9a5e6015ad6f5011e5.
>
> Please rebase and re-send.
Will update and re-submit patches after testing with new code.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-08-22 23:33 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-15 2:20 [PATCH net-next v4 0/2] net: dsa: microchip: Add KSZ8895/KSZ8864 switch support Tristram.Ha
2024-08-15 2:20 ` [PATCH net-next v4 1/2] dt-bindings: " Tristram.Ha
2024-08-15 2:20 ` [PATCH net-next v4 2/2] " Tristram.Ha
2024-08-20 10:08 ` Paolo Abeni
2024-08-20 10:15 ` Paolo Abeni
2024-08-21 11:02 ` vtpieter
2024-08-22 23:30 ` Tristram.Ha
2024-08-22 23:33 ` Tristram.Ha
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).