All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys
@ 2023-01-27 19:35 Colin Foster
  2023-01-27 19:35 ` [PATCH v5 net-next 01/13] net: mscc: ocelot: expose ocelot wm functions Colin Foster
                   ` (14 more replies)
  0 siblings, 15 replies; 34+ messages in thread
From: Colin Foster @ 2023-01-27 19:35 UTC (permalink / raw)
  To: netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Florian Fainelli, Andrew Lunn,
	UNGLinuxDriver, Alexandre Belloni, Claudiu Manoil,
	Vladimir Oltean, Paolo Abeni, Jakub Kicinski, Eric Dumazet,
	David S. Miller, Krzysztof Kozlowski, Rob Herring, Lee Jones

This patch series is a continuation to add support for the VSC7512:
https://patchwork.kernel.org/project/netdevbpf/list/?series=674168&state=*

That series added the framework and initial functionality for the
VSC7512 chip. Several of these patches grew during the initial
development of the framework, which is why v1 will include changelogs.
It was during v9 of that original MFD patch set that these were dropped.

With that out of the way, the VSC7512 is mainly a subset of the VSC7514
chip. The 7512 lacks an internal MIPS processor, but otherwise many of
the register definitions are identical. That is why several of these
patches are simply to expose common resources from
drivers/net/ethernet/mscc/*.

This patch only adds support for the first four ports (swp0-swp3). The
remaining ports require more significant changes to the felix driver,
and will be handled in the future.


***
Note on V5: This driver triggers a bug in phy_device.c. A fix has been
sent to 'net': https://lkml.org/lkml/2023/1/27/1105
***

v5
    * Documentation overhauled to use
      /schemas/net/mscc,vsc7514-switch.yaml instead of
      /schemas/net/dsa/mscc,ocelot.yaml
    * Two patches were applied elsewhere, so have been dropped:
      "net: dsa: felix: populate mac_capabilities for all ports" and
      "dt-bindings: mfd: ocelot: remove spi-max-frequency from required
       properties"
    * stats_layout changes are no longer necessary, so the patch
      "net: mscc: ocelot: expose stats layout definition to be used by
       other drivers" has been dropped
    * Common naming macros has been dropped:
      "mfd: ocelot: add shared resource names for switch functionality".
      This changed patches 12-13 slightly.
    * Patch 12 had some small changes due to the rebase - more info there

v4
    * Update documentation to include all ports / modes (patch 15)
    * Fix dt_bindings_check warnings (patch 13, 14, 15)
    * Utilize new "resource_names" reference (patch 9, 12, 16)
    * Drop unnecessary #undef REG patch in pinctl: ocelot
    * Utilize standard MFD resource addition (patch 17)
    * Utilize shared vsc7514_regmap (new patch 6)
    * Allow forward-compatibility on fully-defined device trees
      (patch 10,14)

v3
    * Fix allmodconfig build (patch 8)
    * Change documentation wording (patch 12)
    * Import module namespace (patch 13)
    * Fix array initializer (patch 13)

v2
    * Utilize common ocelot_reset routine (new patch 5, modified patch 13)
    * Change init_regmap() routine to be string-based (new patch 8)
    * Split patches where necessary (patches 9 and 14)
    * Add documentation (patch 12) and MAINTAINERS (patch 13)
    * Upgrade to PATCH status

v1 (from RFC v8 suggested above):
    * Utilize the MFD framework for creating regmaps, as well as
      dev_get_regmap() (patches 7 and 8 of this series)


Colin Foster (13):
  net: mscc: ocelot: expose ocelot wm functions
  net: mscc: ocelot: expose regfield definition to be used by other
    drivers
  net: mscc: ocelot: expose vcap_props structure
  net: mscc: ocelot: expose ocelot_reset routine
  net: mscc: ocelot: expose vsc7514_regmap definition
  net: dsa: felix: add configurable device quirks
  net: dsa: felix: add support for MFD configurations
  net: dsa: felix: add functionality when not all ports are supported
  mfd: ocelot: prepend resource size macros to be 32-bit
  dt-bindings: net: mscc,vsc7514-switch: add dsa binding for the vsc7512
  dt-bindings: mfd: ocelot: add ethernet-switch hardware support
  net: dsa: ocelot: add external ocelot switch control
  mfd: ocelot: add external ocelot switch control

 .../devicetree/bindings/mfd/mscc,ocelot.yaml  |   9 +
 .../bindings/net/mscc,vsc7514-switch.yaml     | 113 ++++++++---
 MAINTAINERS                                   |   1 +
 drivers/mfd/ocelot-core.c                     |  68 ++++++-
 drivers/net/dsa/ocelot/Kconfig                |  20 ++
 drivers/net/dsa/ocelot/Makefile               |   2 +
 drivers/net/dsa/ocelot/felix.c                |  25 ++-
 drivers/net/dsa/ocelot/felix.h                |   2 +
 drivers/net/dsa/ocelot/felix_vsc9959.c        |   1 +
 drivers/net/dsa/ocelot/ocelot_ext.c           | 163 +++++++++++++++
 drivers/net/dsa/ocelot/seville_vsc9953.c      |   1 +
 drivers/net/ethernet/mscc/ocelot.c            |  48 ++++-
 drivers/net/ethernet/mscc/ocelot_devlink.c    |  31 +++
 drivers/net/ethernet/mscc/ocelot_vsc7514.c    | 190 +-----------------
 drivers/net/ethernet/mscc/vsc7514_regs.c      | 117 +++++++++++
 include/soc/mscc/ocelot.h                     |   6 +
 include/soc/mscc/vsc7514_regs.h               |   6 +
 17 files changed, 582 insertions(+), 221 deletions(-)
 create mode 100644 drivers/net/dsa/ocelot/ocelot_ext.c

-- 
2.25.1


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v5 net-next 01/13] net: mscc: ocelot: expose ocelot wm functions
  2023-01-27 19:35 [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys Colin Foster
@ 2023-01-27 19:35 ` Colin Foster
  2023-01-27 19:37   ` Florian Fainelli
  2023-01-27 19:35 ` [PATCH v5 net-next 02/13] net: mscc: ocelot: expose regfield definition to be used by other drivers Colin Foster
                   ` (13 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Colin Foster @ 2023-01-27 19:35 UTC (permalink / raw)
  To: netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Florian Fainelli, Andrew Lunn,
	UNGLinuxDriver, Alexandre Belloni, Claudiu Manoil,
	Vladimir Oltean, Paolo Abeni, Jakub Kicinski, Eric Dumazet,
	David S. Miller, Krzysztof Kozlowski, Rob Herring, Lee Jones

Expose ocelot_wm functions so they can be shared with other drivers.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---

v1 - v5:
    * No changes since previous RFC

---
 drivers/net/ethernet/mscc/ocelot_devlink.c | 31 ++++++++++++++++++++++
 drivers/net/ethernet/mscc/ocelot_vsc7514.c | 28 -------------------
 include/soc/mscc/ocelot.h                  |  5 ++++
 3 files changed, 36 insertions(+), 28 deletions(-)

diff --git a/drivers/net/ethernet/mscc/ocelot_devlink.c b/drivers/net/ethernet/mscc/ocelot_devlink.c
index b8737efd2a85..d9ea75a14f2f 100644
--- a/drivers/net/ethernet/mscc/ocelot_devlink.c
+++ b/drivers/net/ethernet/mscc/ocelot_devlink.c
@@ -487,6 +487,37 @@ static void ocelot_watermark_init(struct ocelot *ocelot)
 	ocelot_setup_sharing_watermarks(ocelot);
 }
 
+/* Watermark encode
+ * Bit 8:   Unit; 0:1, 1:16
+ * Bit 7-0: Value to be multiplied with unit
+ */
+u16 ocelot_wm_enc(u16 value)
+{
+	WARN_ON(value >= 16 * BIT(8));
+
+	if (value >= BIT(8))
+		return BIT(8) | (value / 16);
+
+	return value;
+}
+EXPORT_SYMBOL(ocelot_wm_enc);
+
+u16 ocelot_wm_dec(u16 wm)
+{
+	if (wm & BIT(8))
+		return (wm & GENMASK(7, 0)) * 16;
+
+	return wm;
+}
+EXPORT_SYMBOL(ocelot_wm_dec);
+
+void ocelot_wm_stat(u32 val, u32 *inuse, u32 *maxuse)
+{
+	*inuse = (val & GENMASK(23, 12)) >> 12;
+	*maxuse = val & GENMASK(11, 0);
+}
+EXPORT_SYMBOL(ocelot_wm_stat);
+
 /* Pool size and type are fixed up at runtime. Keeping this structure to
  * look up the cell size multipliers.
  */
diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
index b097fd4a4061..a3a36de063e5 100644
--- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c
+++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
@@ -229,34 +229,6 @@ static int ocelot_reset(struct ocelot *ocelot)
 	return regmap_field_write(ocelot->regfields[SYS_RESET_CFG_CORE_ENA], 1);
 }
 
-/* Watermark encode
- * Bit 8:   Unit; 0:1, 1:16
- * Bit 7-0: Value to be multiplied with unit
- */
-static u16 ocelot_wm_enc(u16 value)
-{
-	WARN_ON(value >= 16 * BIT(8));
-
-	if (value >= BIT(8))
-		return BIT(8) | (value / 16);
-
-	return value;
-}
-
-static u16 ocelot_wm_dec(u16 wm)
-{
-	if (wm & BIT(8))
-		return (wm & GENMASK(7, 0)) * 16;
-
-	return wm;
-}
-
-static void ocelot_wm_stat(u32 val, u32 *inuse, u32 *maxuse)
-{
-	*inuse = (val & GENMASK(23, 12)) >> 12;
-	*maxuse = val & GENMASK(11, 0);
-}
-
 static const struct ocelot_ops ocelot_ops = {
 	.reset			= ocelot_reset,
 	.wm_enc			= ocelot_wm_enc,
diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h
index afb11680a793..0edb16b6087f 100644
--- a/include/soc/mscc/ocelot.h
+++ b/include/soc/mscc/ocelot.h
@@ -978,6 +978,11 @@ void ocelot_port_assign_dsa_8021q_cpu(struct ocelot *ocelot, int port, int cpu);
 void ocelot_port_unassign_dsa_8021q_cpu(struct ocelot *ocelot, int port);
 u32 ocelot_port_assigned_dsa_8021q_cpu_mask(struct ocelot *ocelot, int port);
 
+/* Watermark interface */
+u16 ocelot_wm_enc(u16 value);
+u16 ocelot_wm_dec(u16 wm);
+void ocelot_wm_stat(u32 val, u32 *inuse, u32 *maxuse);
+
 /* DSA callbacks */
 void ocelot_get_strings(struct ocelot *ocelot, int port, u32 sset, u8 *data);
 void ocelot_get_ethtool_stats(struct ocelot *ocelot, int port, u64 *data);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v5 net-next 02/13] net: mscc: ocelot: expose regfield definition to be used by other drivers
  2023-01-27 19:35 [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys Colin Foster
  2023-01-27 19:35 ` [PATCH v5 net-next 01/13] net: mscc: ocelot: expose ocelot wm functions Colin Foster
@ 2023-01-27 19:35 ` Colin Foster
  2023-01-27 19:38   ` Florian Fainelli
  2023-01-27 19:35 ` [PATCH v5 net-next 03/13] net: mscc: ocelot: expose vcap_props structure Colin Foster
                   ` (12 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Colin Foster @ 2023-01-27 19:35 UTC (permalink / raw)
  To: netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Florian Fainelli, Andrew Lunn,
	UNGLinuxDriver, Alexandre Belloni, Claudiu Manoil,
	Vladimir Oltean, Paolo Abeni, Jakub Kicinski, Eric Dumazet,
	David S. Miller, Krzysztof Kozlowski, Rob Herring, Lee Jones

The ocelot_regfields struct is common between several different chips, some
of which can only be controlled externally. Export this structure so it
doesn't have to be duplicated in these other drivers.

Rename the structure as well, to follow the conventions of other shared
resources.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---

v3-v5
    * No changes

v2
    * Add Reviewed tag

v1 from previous RFC:
    * Remove GCB_SOFT_RST_SWC_RST entry from the regfields struct - it
      isn't used.
    * Export the vsc7514_regfields symbol so it can be used as a module.

---
 drivers/net/ethernet/mscc/ocelot_vsc7514.c | 60 +---------------------
 drivers/net/ethernet/mscc/vsc7514_regs.c   | 59 +++++++++++++++++++++
 include/soc/mscc/vsc7514_regs.h            |  2 +
 3 files changed, 62 insertions(+), 59 deletions(-)

diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
index a3a36de063e5..8a90b5e8c8fa 100644
--- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c
+++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
@@ -42,64 +42,6 @@ static const u32 *ocelot_regmap[TARGET_MAX] = {
 	[DEV_GMII] = vsc7514_dev_gmii_regmap,
 };
 
-static const struct reg_field ocelot_regfields[REGFIELD_MAX] = {
-	[ANA_ADVLEARN_VLAN_CHK] = REG_FIELD(ANA_ADVLEARN, 11, 11),
-	[ANA_ADVLEARN_LEARN_MIRROR] = REG_FIELD(ANA_ADVLEARN, 0, 10),
-	[ANA_ANEVENTS_MSTI_DROP] = REG_FIELD(ANA_ANEVENTS, 27, 27),
-	[ANA_ANEVENTS_ACLKILL] = REG_FIELD(ANA_ANEVENTS, 26, 26),
-	[ANA_ANEVENTS_ACLUSED] = REG_FIELD(ANA_ANEVENTS, 25, 25),
-	[ANA_ANEVENTS_AUTOAGE] = REG_FIELD(ANA_ANEVENTS, 24, 24),
-	[ANA_ANEVENTS_VS2TTL1] = REG_FIELD(ANA_ANEVENTS, 23, 23),
-	[ANA_ANEVENTS_STORM_DROP] = REG_FIELD(ANA_ANEVENTS, 22, 22),
-	[ANA_ANEVENTS_LEARN_DROP] = REG_FIELD(ANA_ANEVENTS, 21, 21),
-	[ANA_ANEVENTS_AGED_ENTRY] = REG_FIELD(ANA_ANEVENTS, 20, 20),
-	[ANA_ANEVENTS_CPU_LEARN_FAILED] = REG_FIELD(ANA_ANEVENTS, 19, 19),
-	[ANA_ANEVENTS_AUTO_LEARN_FAILED] = REG_FIELD(ANA_ANEVENTS, 18, 18),
-	[ANA_ANEVENTS_LEARN_REMOVE] = REG_FIELD(ANA_ANEVENTS, 17, 17),
-	[ANA_ANEVENTS_AUTO_LEARNED] = REG_FIELD(ANA_ANEVENTS, 16, 16),
-	[ANA_ANEVENTS_AUTO_MOVED] = REG_FIELD(ANA_ANEVENTS, 15, 15),
-	[ANA_ANEVENTS_DROPPED] = REG_FIELD(ANA_ANEVENTS, 14, 14),
-	[ANA_ANEVENTS_CLASSIFIED_DROP] = REG_FIELD(ANA_ANEVENTS, 13, 13),
-	[ANA_ANEVENTS_CLASSIFIED_COPY] = REG_FIELD(ANA_ANEVENTS, 12, 12),
-	[ANA_ANEVENTS_VLAN_DISCARD] = REG_FIELD(ANA_ANEVENTS, 11, 11),
-	[ANA_ANEVENTS_FWD_DISCARD] = REG_FIELD(ANA_ANEVENTS, 10, 10),
-	[ANA_ANEVENTS_MULTICAST_FLOOD] = REG_FIELD(ANA_ANEVENTS, 9, 9),
-	[ANA_ANEVENTS_UNICAST_FLOOD] = REG_FIELD(ANA_ANEVENTS, 8, 8),
-	[ANA_ANEVENTS_DEST_KNOWN] = REG_FIELD(ANA_ANEVENTS, 7, 7),
-	[ANA_ANEVENTS_BUCKET3_MATCH] = REG_FIELD(ANA_ANEVENTS, 6, 6),
-	[ANA_ANEVENTS_BUCKET2_MATCH] = REG_FIELD(ANA_ANEVENTS, 5, 5),
-	[ANA_ANEVENTS_BUCKET1_MATCH] = REG_FIELD(ANA_ANEVENTS, 4, 4),
-	[ANA_ANEVENTS_BUCKET0_MATCH] = REG_FIELD(ANA_ANEVENTS, 3, 3),
-	[ANA_ANEVENTS_CPU_OPERATION] = REG_FIELD(ANA_ANEVENTS, 2, 2),
-	[ANA_ANEVENTS_DMAC_LOOKUP] = REG_FIELD(ANA_ANEVENTS, 1, 1),
-	[ANA_ANEVENTS_SMAC_LOOKUP] = REG_FIELD(ANA_ANEVENTS, 0, 0),
-	[ANA_TABLES_MACACCESS_B_DOM] = REG_FIELD(ANA_TABLES_MACACCESS, 18, 18),
-	[ANA_TABLES_MACTINDX_BUCKET] = REG_FIELD(ANA_TABLES_MACTINDX, 10, 11),
-	[ANA_TABLES_MACTINDX_M_INDEX] = REG_FIELD(ANA_TABLES_MACTINDX, 0, 9),
-	[QSYS_TIMED_FRAME_ENTRY_TFRM_VLD] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 20, 20),
-	[QSYS_TIMED_FRAME_ENTRY_TFRM_FP] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 8, 19),
-	[QSYS_TIMED_FRAME_ENTRY_TFRM_PORTNO] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 4, 7),
-	[QSYS_TIMED_FRAME_ENTRY_TFRM_TM_SEL] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 1, 3),
-	[QSYS_TIMED_FRAME_ENTRY_TFRM_TM_T] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 0, 0),
-	[SYS_RESET_CFG_CORE_ENA] = REG_FIELD(SYS_RESET_CFG, 2, 2),
-	[SYS_RESET_CFG_MEM_ENA] = REG_FIELD(SYS_RESET_CFG, 1, 1),
-	[SYS_RESET_CFG_MEM_INIT] = REG_FIELD(SYS_RESET_CFG, 0, 0),
-	/* Replicated per number of ports (12), register size 4 per port */
-	[QSYS_SWITCH_PORT_MODE_PORT_ENA] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 14, 14, 12, 4),
-	[QSYS_SWITCH_PORT_MODE_SCH_NEXT_CFG] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 11, 13, 12, 4),
-	[QSYS_SWITCH_PORT_MODE_YEL_RSRVD] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 10, 10, 12, 4),
-	[QSYS_SWITCH_PORT_MODE_INGRESS_DROP_MODE] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 9, 9, 12, 4),
-	[QSYS_SWITCH_PORT_MODE_TX_PFC_ENA] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 1, 8, 12, 4),
-	[QSYS_SWITCH_PORT_MODE_TX_PFC_MODE] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 0, 0, 12, 4),
-	[SYS_PORT_MODE_DATA_WO_TS] = REG_FIELD_ID(SYS_PORT_MODE, 5, 6, 12, 4),
-	[SYS_PORT_MODE_INCL_INJ_HDR] = REG_FIELD_ID(SYS_PORT_MODE, 3, 4, 12, 4),
-	[SYS_PORT_MODE_INCL_XTR_HDR] = REG_FIELD_ID(SYS_PORT_MODE, 1, 2, 12, 4),
-	[SYS_PORT_MODE_INCL_HDR_ERR] = REG_FIELD_ID(SYS_PORT_MODE, 0, 0, 12, 4),
-	[SYS_PAUSE_CFG_PAUSE_START] = REG_FIELD_ID(SYS_PAUSE_CFG, 10, 18, 12, 4),
-	[SYS_PAUSE_CFG_PAUSE_STOP] = REG_FIELD_ID(SYS_PAUSE_CFG, 1, 9, 12, 4),
-	[SYS_PAUSE_CFG_PAUSE_ENA] = REG_FIELD_ID(SYS_PAUSE_CFG, 0, 1, 12, 4),
-};
-
 static void ocelot_pll5_init(struct ocelot *ocelot)
 {
 	/* Configure PLL5. This will need a proper CCF driver
@@ -137,7 +79,7 @@ static int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops)
 	ocelot->num_mact_rows = 1024;
 	ocelot->ops = ops;
 
-	ret = ocelot_regfields_init(ocelot, ocelot_regfields);
+	ret = ocelot_regfields_init(ocelot, vsc7514_regfields);
 	if (ret)
 		return ret;
 
diff --git a/drivers/net/ethernet/mscc/vsc7514_regs.c b/drivers/net/ethernet/mscc/vsc7514_regs.c
index 9d2d3e13cacf..123175618251 100644
--- a/drivers/net/ethernet/mscc/vsc7514_regs.c
+++ b/drivers/net/ethernet/mscc/vsc7514_regs.c
@@ -9,6 +9,65 @@
 #include <soc/mscc/vsc7514_regs.h>
 #include "ocelot.h"
 
+const struct reg_field vsc7514_regfields[REGFIELD_MAX] = {
+	[ANA_ADVLEARN_VLAN_CHK] = REG_FIELD(ANA_ADVLEARN, 11, 11),
+	[ANA_ADVLEARN_LEARN_MIRROR] = REG_FIELD(ANA_ADVLEARN, 0, 10),
+	[ANA_ANEVENTS_MSTI_DROP] = REG_FIELD(ANA_ANEVENTS, 27, 27),
+	[ANA_ANEVENTS_ACLKILL] = REG_FIELD(ANA_ANEVENTS, 26, 26),
+	[ANA_ANEVENTS_ACLUSED] = REG_FIELD(ANA_ANEVENTS, 25, 25),
+	[ANA_ANEVENTS_AUTOAGE] = REG_FIELD(ANA_ANEVENTS, 24, 24),
+	[ANA_ANEVENTS_VS2TTL1] = REG_FIELD(ANA_ANEVENTS, 23, 23),
+	[ANA_ANEVENTS_STORM_DROP] = REG_FIELD(ANA_ANEVENTS, 22, 22),
+	[ANA_ANEVENTS_LEARN_DROP] = REG_FIELD(ANA_ANEVENTS, 21, 21),
+	[ANA_ANEVENTS_AGED_ENTRY] = REG_FIELD(ANA_ANEVENTS, 20, 20),
+	[ANA_ANEVENTS_CPU_LEARN_FAILED] = REG_FIELD(ANA_ANEVENTS, 19, 19),
+	[ANA_ANEVENTS_AUTO_LEARN_FAILED] = REG_FIELD(ANA_ANEVENTS, 18, 18),
+	[ANA_ANEVENTS_LEARN_REMOVE] = REG_FIELD(ANA_ANEVENTS, 17, 17),
+	[ANA_ANEVENTS_AUTO_LEARNED] = REG_FIELD(ANA_ANEVENTS, 16, 16),
+	[ANA_ANEVENTS_AUTO_MOVED] = REG_FIELD(ANA_ANEVENTS, 15, 15),
+	[ANA_ANEVENTS_DROPPED] = REG_FIELD(ANA_ANEVENTS, 14, 14),
+	[ANA_ANEVENTS_CLASSIFIED_DROP] = REG_FIELD(ANA_ANEVENTS, 13, 13),
+	[ANA_ANEVENTS_CLASSIFIED_COPY] = REG_FIELD(ANA_ANEVENTS, 12, 12),
+	[ANA_ANEVENTS_VLAN_DISCARD] = REG_FIELD(ANA_ANEVENTS, 11, 11),
+	[ANA_ANEVENTS_FWD_DISCARD] = REG_FIELD(ANA_ANEVENTS, 10, 10),
+	[ANA_ANEVENTS_MULTICAST_FLOOD] = REG_FIELD(ANA_ANEVENTS, 9, 9),
+	[ANA_ANEVENTS_UNICAST_FLOOD] = REG_FIELD(ANA_ANEVENTS, 8, 8),
+	[ANA_ANEVENTS_DEST_KNOWN] = REG_FIELD(ANA_ANEVENTS, 7, 7),
+	[ANA_ANEVENTS_BUCKET3_MATCH] = REG_FIELD(ANA_ANEVENTS, 6, 6),
+	[ANA_ANEVENTS_BUCKET2_MATCH] = REG_FIELD(ANA_ANEVENTS, 5, 5),
+	[ANA_ANEVENTS_BUCKET1_MATCH] = REG_FIELD(ANA_ANEVENTS, 4, 4),
+	[ANA_ANEVENTS_BUCKET0_MATCH] = REG_FIELD(ANA_ANEVENTS, 3, 3),
+	[ANA_ANEVENTS_CPU_OPERATION] = REG_FIELD(ANA_ANEVENTS, 2, 2),
+	[ANA_ANEVENTS_DMAC_LOOKUP] = REG_FIELD(ANA_ANEVENTS, 1, 1),
+	[ANA_ANEVENTS_SMAC_LOOKUP] = REG_FIELD(ANA_ANEVENTS, 0, 0),
+	[ANA_TABLES_MACACCESS_B_DOM] = REG_FIELD(ANA_TABLES_MACACCESS, 18, 18),
+	[ANA_TABLES_MACTINDX_BUCKET] = REG_FIELD(ANA_TABLES_MACTINDX, 10, 11),
+	[ANA_TABLES_MACTINDX_M_INDEX] = REG_FIELD(ANA_TABLES_MACTINDX, 0, 9),
+	[QSYS_TIMED_FRAME_ENTRY_TFRM_VLD] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 20, 20),
+	[QSYS_TIMED_FRAME_ENTRY_TFRM_FP] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 8, 19),
+	[QSYS_TIMED_FRAME_ENTRY_TFRM_PORTNO] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 4, 7),
+	[QSYS_TIMED_FRAME_ENTRY_TFRM_TM_SEL] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 1, 3),
+	[QSYS_TIMED_FRAME_ENTRY_TFRM_TM_T] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 0, 0),
+	[SYS_RESET_CFG_CORE_ENA] = REG_FIELD(SYS_RESET_CFG, 2, 2),
+	[SYS_RESET_CFG_MEM_ENA] = REG_FIELD(SYS_RESET_CFG, 1, 1),
+	[SYS_RESET_CFG_MEM_INIT] = REG_FIELD(SYS_RESET_CFG, 0, 0),
+	/* Replicated per number of ports (12), register size 4 per port */
+	[QSYS_SWITCH_PORT_MODE_PORT_ENA] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 14, 14, 12, 4),
+	[QSYS_SWITCH_PORT_MODE_SCH_NEXT_CFG] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 11, 13, 12, 4),
+	[QSYS_SWITCH_PORT_MODE_YEL_RSRVD] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 10, 10, 12, 4),
+	[QSYS_SWITCH_PORT_MODE_INGRESS_DROP_MODE] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 9, 9, 12, 4),
+	[QSYS_SWITCH_PORT_MODE_TX_PFC_ENA] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 1, 8, 12, 4),
+	[QSYS_SWITCH_PORT_MODE_TX_PFC_MODE] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 0, 0, 12, 4),
+	[SYS_PORT_MODE_DATA_WO_TS] = REG_FIELD_ID(SYS_PORT_MODE, 5, 6, 12, 4),
+	[SYS_PORT_MODE_INCL_INJ_HDR] = REG_FIELD_ID(SYS_PORT_MODE, 3, 4, 12, 4),
+	[SYS_PORT_MODE_INCL_XTR_HDR] = REG_FIELD_ID(SYS_PORT_MODE, 1, 2, 12, 4),
+	[SYS_PORT_MODE_INCL_HDR_ERR] = REG_FIELD_ID(SYS_PORT_MODE, 0, 0, 12, 4),
+	[SYS_PAUSE_CFG_PAUSE_START] = REG_FIELD_ID(SYS_PAUSE_CFG, 10, 18, 12, 4),
+	[SYS_PAUSE_CFG_PAUSE_STOP] = REG_FIELD_ID(SYS_PAUSE_CFG, 1, 9, 12, 4),
+	[SYS_PAUSE_CFG_PAUSE_ENA] = REG_FIELD_ID(SYS_PAUSE_CFG, 0, 1, 12, 4),
+};
+EXPORT_SYMBOL(vsc7514_regfields);
+
 const u32 vsc7514_ana_regmap[] = {
 	REG(ANA_ADVLEARN,				0x009000),
 	REG(ANA_VLANMASK,				0x009004),
diff --git a/include/soc/mscc/vsc7514_regs.h b/include/soc/mscc/vsc7514_regs.h
index ceee26c96959..9b40e7d00ec5 100644
--- a/include/soc/mscc/vsc7514_regs.h
+++ b/include/soc/mscc/vsc7514_regs.h
@@ -10,6 +10,8 @@
 
 #include <soc/mscc/ocelot_vcap.h>
 
+extern const struct reg_field vsc7514_regfields[REGFIELD_MAX];
+
 extern const u32 vsc7514_ana_regmap[];
 extern const u32 vsc7514_qs_regmap[];
 extern const u32 vsc7514_qsys_regmap[];
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v5 net-next 03/13] net: mscc: ocelot: expose vcap_props structure
  2023-01-27 19:35 [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys Colin Foster
  2023-01-27 19:35 ` [PATCH v5 net-next 01/13] net: mscc: ocelot: expose ocelot wm functions Colin Foster
  2023-01-27 19:35 ` [PATCH v5 net-next 02/13] net: mscc: ocelot: expose regfield definition to be used by other drivers Colin Foster
@ 2023-01-27 19:35 ` Colin Foster
  2023-01-27 19:38   ` Florian Fainelli
  2023-01-27 19:35 ` [PATCH v5 net-next 04/13] net: mscc: ocelot: expose ocelot_reset routine Colin Foster
                   ` (11 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Colin Foster @ 2023-01-27 19:35 UTC (permalink / raw)
  To: netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Florian Fainelli, Andrew Lunn,
	UNGLinuxDriver, Alexandre Belloni, Claudiu Manoil,
	Vladimir Oltean, Paolo Abeni, Jakub Kicinski, Eric Dumazet,
	David S. Miller, Krzysztof Kozlowski, Rob Herring, Lee Jones

The vcap_props structure is common to other devices, specifically the
VSC7512 chip that can only be controlled externally. Export this structure
so it doesn't need to be recreated.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
---

v1 - v5 from previous RFC:
    * No changes

---
 drivers/net/ethernet/mscc/ocelot_vsc7514.c | 43 ---------------------
 drivers/net/ethernet/mscc/vsc7514_regs.c   | 44 ++++++++++++++++++++++
 include/soc/mscc/vsc7514_regs.h            |  2 +
 3 files changed, 46 insertions(+), 43 deletions(-)

diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
index 8a90b5e8c8fa..381d099f41b1 100644
--- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c
+++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
@@ -180,49 +180,6 @@ static const struct ocelot_ops ocelot_ops = {
 	.netdev_to_port		= ocelot_netdev_to_port,
 };
 
-static struct vcap_props vsc7514_vcap_props[] = {
-	[VCAP_ES0] = {
-		.action_type_width = 0,
-		.action_table = {
-			[ES0_ACTION_TYPE_NORMAL] = {
-				.width = 73, /* HIT_STICKY not included */
-				.count = 1,
-			},
-		},
-		.target = S0,
-		.keys = vsc7514_vcap_es0_keys,
-		.actions = vsc7514_vcap_es0_actions,
-	},
-	[VCAP_IS1] = {
-		.action_type_width = 0,
-		.action_table = {
-			[IS1_ACTION_TYPE_NORMAL] = {
-				.width = 78, /* HIT_STICKY not included */
-				.count = 4,
-			},
-		},
-		.target = S1,
-		.keys = vsc7514_vcap_is1_keys,
-		.actions = vsc7514_vcap_is1_actions,
-	},
-	[VCAP_IS2] = {
-		.action_type_width = 1,
-		.action_table = {
-			[IS2_ACTION_TYPE_NORMAL] = {
-				.width = 49,
-				.count = 2
-			},
-			[IS2_ACTION_TYPE_SMAC_SIP] = {
-				.width = 6,
-				.count = 4
-			},
-		},
-		.target = S2,
-		.keys = vsc7514_vcap_is2_keys,
-		.actions = vsc7514_vcap_is2_actions,
-	},
-};
-
 static struct ptp_clock_info ocelot_ptp_clock_info = {
 	.owner		= THIS_MODULE,
 	.name		= "ocelot ptp",
diff --git a/drivers/net/ethernet/mscc/vsc7514_regs.c b/drivers/net/ethernet/mscc/vsc7514_regs.c
index 123175618251..c3ad01722829 100644
--- a/drivers/net/ethernet/mscc/vsc7514_regs.c
+++ b/drivers/net/ethernet/mscc/vsc7514_regs.c
@@ -639,3 +639,47 @@ const struct vcap_field vsc7514_vcap_is2_actions[] = {
 	[VCAP_IS2_ACT_HIT_CNT]			= { 49, 32 },
 };
 EXPORT_SYMBOL(vsc7514_vcap_is2_actions);
+
+struct vcap_props vsc7514_vcap_props[] = {
+	[VCAP_ES0] = {
+		.action_type_width = 0,
+		.action_table = {
+			[ES0_ACTION_TYPE_NORMAL] = {
+				.width = 73, /* HIT_STICKY not included */
+				.count = 1,
+			},
+		},
+		.target = S0,
+		.keys = vsc7514_vcap_es0_keys,
+		.actions = vsc7514_vcap_es0_actions,
+	},
+	[VCAP_IS1] = {
+		.action_type_width = 0,
+		.action_table = {
+			[IS1_ACTION_TYPE_NORMAL] = {
+				.width = 78, /* HIT_STICKY not included */
+				.count = 4,
+			},
+		},
+		.target = S1,
+		.keys = vsc7514_vcap_is1_keys,
+		.actions = vsc7514_vcap_is1_actions,
+	},
+	[VCAP_IS2] = {
+		.action_type_width = 1,
+		.action_table = {
+			[IS2_ACTION_TYPE_NORMAL] = {
+				.width = 49,
+				.count = 2
+			},
+			[IS2_ACTION_TYPE_SMAC_SIP] = {
+				.width = 6,
+				.count = 4
+			},
+		},
+		.target = S2,
+		.keys = vsc7514_vcap_is2_keys,
+		.actions = vsc7514_vcap_is2_actions,
+	},
+};
+EXPORT_SYMBOL(vsc7514_vcap_props);
diff --git a/include/soc/mscc/vsc7514_regs.h b/include/soc/mscc/vsc7514_regs.h
index 9b40e7d00ec5..8cfbc7ec07f8 100644
--- a/include/soc/mscc/vsc7514_regs.h
+++ b/include/soc/mscc/vsc7514_regs.h
@@ -10,6 +10,8 @@
 
 #include <soc/mscc/ocelot_vcap.h>
 
+extern struct vcap_props vsc7514_vcap_props[];
+
 extern const struct reg_field vsc7514_regfields[REGFIELD_MAX];
 
 extern const u32 vsc7514_ana_regmap[];
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v5 net-next 04/13] net: mscc: ocelot: expose ocelot_reset routine
  2023-01-27 19:35 [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys Colin Foster
                   ` (2 preceding siblings ...)
  2023-01-27 19:35 ` [PATCH v5 net-next 03/13] net: mscc: ocelot: expose vcap_props structure Colin Foster
@ 2023-01-27 19:35 ` Colin Foster
  2023-01-27 19:38   ` Florian Fainelli
  2023-01-27 19:35 ` [PATCH v5 net-next 05/13] net: mscc: ocelot: expose vsc7514_regmap definition Colin Foster
                   ` (10 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Colin Foster @ 2023-01-27 19:35 UTC (permalink / raw)
  To: netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Florian Fainelli, Andrew Lunn,
	UNGLinuxDriver, Alexandre Belloni, Claudiu Manoil,
	Vladimir Oltean, Paolo Abeni, Jakub Kicinski, Eric Dumazet,
	David S. Miller, Krzysztof Kozlowski, Rob Herring, Lee Jones

Resetting the switch core is the same whether it is done internally or
externally. Move this routine to the ocelot library so it can be used by
other drivers.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
---

v3-v5
    * No changes

v2
    * New patch

---
 drivers/net/ethernet/mscc/ocelot.c         | 48 +++++++++++++++++++++-
 drivers/net/ethernet/mscc/ocelot_vsc7514.c | 44 +-------------------
 include/soc/mscc/ocelot.h                  |  1 +
 3 files changed, 48 insertions(+), 45 deletions(-)

diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c
index c060b03f7e27..08acb7b89086 100644
--- a/drivers/net/ethernet/mscc/ocelot.c
+++ b/drivers/net/ethernet/mscc/ocelot.c
@@ -6,12 +6,16 @@
  */
 #include <linux/dsa/ocelot.h>
 #include <linux/if_bridge.h>
+#include <linux/iopoll.h>
 #include <soc/mscc/ocelot_vcap.h>
 #include "ocelot.h"
 #include "ocelot_vcap.h"
 
-#define TABLE_UPDATE_SLEEP_US 10
-#define TABLE_UPDATE_TIMEOUT_US 100000
+#define TABLE_UPDATE_SLEEP_US	10
+#define TABLE_UPDATE_TIMEOUT_US	100000
+#define MEM_INIT_SLEEP_US	1000
+#define MEM_INIT_TIMEOUT_US	100000
+
 #define OCELOT_RSV_VLAN_RANGE_START 4000
 
 struct ocelot_mact_entry {
@@ -2713,6 +2717,46 @@ static void ocelot_detect_features(struct ocelot *ocelot)
 	ocelot->num_frame_refs = QSYS_MMGT_EQ_CTRL_FP_FREE_CNT(eq_ctrl);
 }
 
+static int ocelot_mem_init_status(struct ocelot *ocelot)
+{
+	unsigned int val;
+	int err;
+
+	err = regmap_field_read(ocelot->regfields[SYS_RESET_CFG_MEM_INIT],
+				&val);
+
+	return err ?: val;
+}
+
+int ocelot_reset(struct ocelot *ocelot)
+{
+	int err;
+	u32 val;
+
+	err = regmap_field_write(ocelot->regfields[SYS_RESET_CFG_MEM_INIT], 1);
+	if (err)
+		return err;
+
+	err = regmap_field_write(ocelot->regfields[SYS_RESET_CFG_MEM_ENA], 1);
+	if (err)
+		return err;
+
+	/* MEM_INIT is a self-clearing bit. Wait for it to be cleared (should be
+	 * 100us) before enabling the switch core.
+	 */
+	err = readx_poll_timeout(ocelot_mem_init_status, ocelot, val, !val,
+				 MEM_INIT_SLEEP_US, MEM_INIT_TIMEOUT_US);
+	if (err)
+		return err;
+
+	err = regmap_field_write(ocelot->regfields[SYS_RESET_CFG_MEM_ENA], 1);
+	if (err)
+		return err;
+
+	return regmap_field_write(ocelot->regfields[SYS_RESET_CFG_CORE_ENA], 1);
+}
+EXPORT_SYMBOL(ocelot_reset);
+
 int ocelot_init(struct ocelot *ocelot)
 {
 	int i, ret;
diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
index 381d099f41b1..1e94108ab8bc 100644
--- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c
+++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
@@ -6,7 +6,6 @@
  */
 #include <linux/dsa/ocelot.h>
 #include <linux/interrupt.h>
-#include <linux/iopoll.h>
 #include <linux/module.h>
 #include <linux/of_net.h>
 #include <linux/netdevice.h>
@@ -17,6 +16,7 @@
 #include <linux/skbuff.h>
 #include <net/switchdev.h>
 
+#include <soc/mscc/ocelot.h>
 #include <soc/mscc/ocelot_vcap.h>
 #include <soc/mscc/ocelot_hsio.h>
 #include <soc/mscc/vsc7514_regs.h>
@@ -26,9 +26,6 @@
 #define VSC7514_VCAP_POLICER_BASE			128
 #define VSC7514_VCAP_POLICER_MAX			191
 
-#define MEM_INIT_SLEEP_US				1000
-#define MEM_INIT_TIMEOUT_US				100000
-
 static const u32 *ocelot_regmap[TARGET_MAX] = {
 	[ANA] = vsc7514_ana_regmap,
 	[QS] = vsc7514_qs_regmap,
@@ -132,45 +129,6 @@ static const struct of_device_id mscc_ocelot_match[] = {
 };
 MODULE_DEVICE_TABLE(of, mscc_ocelot_match);
 
-static int ocelot_mem_init_status(struct ocelot *ocelot)
-{
-	unsigned int val;
-	int err;
-
-	err = regmap_field_read(ocelot->regfields[SYS_RESET_CFG_MEM_INIT],
-				&val);
-
-	return err ?: val;
-}
-
-static int ocelot_reset(struct ocelot *ocelot)
-{
-	int err;
-	u32 val;
-
-	err = regmap_field_write(ocelot->regfields[SYS_RESET_CFG_MEM_INIT], 1);
-	if (err)
-		return err;
-
-	err = regmap_field_write(ocelot->regfields[SYS_RESET_CFG_MEM_ENA], 1);
-	if (err)
-		return err;
-
-	/* MEM_INIT is a self-clearing bit. Wait for it to be cleared (should be
-	 * 100us) before enabling the switch core.
-	 */
-	err = readx_poll_timeout(ocelot_mem_init_status, ocelot, val, !val,
-				 MEM_INIT_SLEEP_US, MEM_INIT_TIMEOUT_US);
-	if (err)
-		return err;
-
-	err = regmap_field_write(ocelot->regfields[SYS_RESET_CFG_MEM_ENA], 1);
-	if (err)
-		return err;
-
-	return regmap_field_write(ocelot->regfields[SYS_RESET_CFG_CORE_ENA], 1);
-}
-
 static const struct ocelot_ops ocelot_ops = {
 	.reset			= ocelot_reset,
 	.wm_enc			= ocelot_wm_enc,
diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h
index 0edb16b6087f..2080879e4134 100644
--- a/include/soc/mscc/ocelot.h
+++ b/include/soc/mscc/ocelot.h
@@ -967,6 +967,7 @@ void ocelot_ptp_rx_timestamp(struct ocelot *ocelot, struct sk_buff *skb,
 int ocelot_regfields_init(struct ocelot *ocelot,
 			  const struct reg_field *const regfields);
 struct regmap *ocelot_regmap_init(struct ocelot *ocelot, struct resource *res);
+int ocelot_reset(struct ocelot *ocelot);
 int ocelot_init(struct ocelot *ocelot);
 void ocelot_deinit(struct ocelot *ocelot);
 void ocelot_init_port(struct ocelot *ocelot, int port);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v5 net-next 05/13] net: mscc: ocelot: expose vsc7514_regmap definition
  2023-01-27 19:35 [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys Colin Foster
                   ` (3 preceding siblings ...)
  2023-01-27 19:35 ` [PATCH v5 net-next 04/13] net: mscc: ocelot: expose ocelot_reset routine Colin Foster
@ 2023-01-27 19:35 ` Colin Foster
  2023-01-27 19:39   ` Florian Fainelli
  2023-01-27 19:35 ` [PATCH v5 net-next 06/13] net: dsa: felix: add configurable device quirks Colin Foster
                   ` (9 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Colin Foster @ 2023-01-27 19:35 UTC (permalink / raw)
  To: netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Florian Fainelli, Andrew Lunn,
	UNGLinuxDriver, Alexandre Belloni, Claudiu Manoil,
	Vladimir Oltean, Paolo Abeni, Jakub Kicinski, Eric Dumazet,
	David S. Miller, Krzysztof Kozlowski, Rob Herring, Lee Jones

The VSC7514 target regmap is identical for ones shared with similar
hardware, specifically the VSC7512. Share this resource, and change the
name to match the pattern of other exported resources.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
---

v5
    * No change

v4
    * New patch

---
 drivers/net/ethernet/mscc/ocelot_vsc7514.c | 15 +--------------
 drivers/net/ethernet/mscc/vsc7514_regs.c   | 14 ++++++++++++++
 include/soc/mscc/vsc7514_regs.h            |  2 ++
 3 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
index 1e94108ab8bc..7388c3b0535c 100644
--- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c
+++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
@@ -26,19 +26,6 @@
 #define VSC7514_VCAP_POLICER_BASE			128
 #define VSC7514_VCAP_POLICER_MAX			191
 
-static const u32 *ocelot_regmap[TARGET_MAX] = {
-	[ANA] = vsc7514_ana_regmap,
-	[QS] = vsc7514_qs_regmap,
-	[QSYS] = vsc7514_qsys_regmap,
-	[REW] = vsc7514_rew_regmap,
-	[SYS] = vsc7514_sys_regmap,
-	[S0] = vsc7514_vcap_regmap,
-	[S1] = vsc7514_vcap_regmap,
-	[S2] = vsc7514_vcap_regmap,
-	[PTP] = vsc7514_ptp_regmap,
-	[DEV_GMII] = vsc7514_dev_gmii_regmap,
-};
-
 static void ocelot_pll5_init(struct ocelot *ocelot)
 {
 	/* Configure PLL5. This will need a proper CCF driver
@@ -72,7 +59,7 @@ static int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops)
 {
 	int ret;
 
-	ocelot->map = ocelot_regmap;
+	ocelot->map = vsc7514_regmap;
 	ocelot->num_mact_rows = 1024;
 	ocelot->ops = ops;
 
diff --git a/drivers/net/ethernet/mscc/vsc7514_regs.c b/drivers/net/ethernet/mscc/vsc7514_regs.c
index c3ad01722829..da0c0dcc8f81 100644
--- a/drivers/net/ethernet/mscc/vsc7514_regs.c
+++ b/drivers/net/ethernet/mscc/vsc7514_regs.c
@@ -429,6 +429,20 @@ const u32 vsc7514_dev_gmii_regmap[] = {
 };
 EXPORT_SYMBOL(vsc7514_dev_gmii_regmap);
 
+const u32 *vsc7514_regmap[TARGET_MAX] = {
+	[ANA] = vsc7514_ana_regmap,
+	[QS] = vsc7514_qs_regmap,
+	[QSYS] = vsc7514_qsys_regmap,
+	[REW] = vsc7514_rew_regmap,
+	[SYS] = vsc7514_sys_regmap,
+	[S0] = vsc7514_vcap_regmap,
+	[S1] = vsc7514_vcap_regmap,
+	[S2] = vsc7514_vcap_regmap,
+	[PTP] = vsc7514_ptp_regmap,
+	[DEV_GMII] = vsc7514_dev_gmii_regmap,
+};
+EXPORT_SYMBOL(vsc7514_regmap);
+
 const struct vcap_field vsc7514_vcap_es0_keys[] = {
 	[VCAP_ES0_EGR_PORT]			= { 0,   4 },
 	[VCAP_ES0_IGR_PORT]			= { 4,   4 },
diff --git a/include/soc/mscc/vsc7514_regs.h b/include/soc/mscc/vsc7514_regs.h
index 8cfbc7ec07f8..dfb91629c8bd 100644
--- a/include/soc/mscc/vsc7514_regs.h
+++ b/include/soc/mscc/vsc7514_regs.h
@@ -23,6 +23,8 @@ extern const u32 vsc7514_vcap_regmap[];
 extern const u32 vsc7514_ptp_regmap[];
 extern const u32 vsc7514_dev_gmii_regmap[];
 
+extern const u32 *vsc7514_regmap[TARGET_MAX];
+
 extern const struct vcap_field vsc7514_vcap_es0_keys[];
 extern const struct vcap_field vsc7514_vcap_es0_actions[];
 extern const struct vcap_field vsc7514_vcap_is1_keys[];
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v5 net-next 06/13] net: dsa: felix: add configurable device quirks
  2023-01-27 19:35 [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys Colin Foster
                   ` (4 preceding siblings ...)
  2023-01-27 19:35 ` [PATCH v5 net-next 05/13] net: mscc: ocelot: expose vsc7514_regmap definition Colin Foster
@ 2023-01-27 19:35 ` Colin Foster
  2023-01-27 19:39   ` Florian Fainelli
  2023-01-27 19:35 ` [PATCH v5 net-next 07/13] net: dsa: felix: add support for MFD configurations Colin Foster
                   ` (8 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Colin Foster @ 2023-01-27 19:35 UTC (permalink / raw)
  To: netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Florian Fainelli, Andrew Lunn,
	UNGLinuxDriver, Alexandre Belloni, Claudiu Manoil,
	Vladimir Oltean, Paolo Abeni, Jakub Kicinski, Eric Dumazet,
	David S. Miller, Krzysztof Kozlowski, Rob Herring, Lee Jones

The define FELIX_MAC_QUIRKS was used directly in the felix.c shared driver.
Other devices (VSC7512 for example) don't require the same quirks, so they
need to be configured on a per-device basis.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---

v2-v5
    * No changes

v1 from previous RFC:
    * No changes

---
 drivers/net/dsa/ocelot/felix.c           | 7 +++++--
 drivers/net/dsa/ocelot/felix.h           | 1 +
 drivers/net/dsa/ocelot/felix_vsc9959.c   | 1 +
 drivers/net/dsa/ocelot/seville_vsc9953.c | 1 +
 4 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
index f57b4095b793..462a1a683996 100644
--- a/drivers/net/dsa/ocelot/felix.c
+++ b/drivers/net/dsa/ocelot/felix.c
@@ -1075,9 +1075,12 @@ static void felix_phylink_mac_link_down(struct dsa_switch *ds, int port,
 					phy_interface_t interface)
 {
 	struct ocelot *ocelot = ds->priv;
+	struct felix *felix;
+
+	felix = ocelot_to_felix(ocelot);
 
 	ocelot_phylink_mac_link_down(ocelot, port, link_an_mode, interface,
-				     FELIX_MAC_QUIRKS);
+				     felix->info->quirks);
 }
 
 static void felix_phylink_mac_link_up(struct dsa_switch *ds, int port,
@@ -1092,7 +1095,7 @@ static void felix_phylink_mac_link_up(struct dsa_switch *ds, int port,
 
 	ocelot_phylink_mac_link_up(ocelot, port, phydev, link_an_mode,
 				   interface, speed, duplex, tx_pause, rx_pause,
-				   FELIX_MAC_QUIRKS);
+				   felix->info->quirks);
 
 	if (felix->info->port_sched_speed_set)
 		felix->info->port_sched_speed_set(ocelot, port, speed);
diff --git a/drivers/net/dsa/ocelot/felix.h b/drivers/net/dsa/ocelot/felix.h
index be22d6ccd7c8..9e1ae1dde0d9 100644
--- a/drivers/net/dsa/ocelot/felix.h
+++ b/drivers/net/dsa/ocelot/felix.h
@@ -36,6 +36,7 @@ struct felix_info {
 	u16				vcap_pol_base2;
 	u16				vcap_pol_max2;
 	const struct ptp_clock_info	*ptp_caps;
+	unsigned long			quirks;
 
 	/* Some Ocelot switches are integrated into the SoC without the
 	 * extraction IRQ line connected to the ARM GIC. By enabling this
diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c
index 43dc8ed4854d..354aa3dbfde7 100644
--- a/drivers/net/dsa/ocelot/felix_vsc9959.c
+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
@@ -2593,6 +2593,7 @@ static const struct felix_info felix_info_vsc9959 = {
 	.num_mact_rows		= 2048,
 	.num_ports		= VSC9959_NUM_PORTS,
 	.num_tx_queues		= OCELOT_NUM_TC,
+	.quirks			= FELIX_MAC_QUIRKS,
 	.quirk_no_xtr_irq	= true,
 	.ptp_caps		= &vsc9959_ptp_caps,
 	.mdio_bus_alloc		= vsc9959_mdio_bus_alloc,
diff --git a/drivers/net/dsa/ocelot/seville_vsc9953.c b/drivers/net/dsa/ocelot/seville_vsc9953.c
index 88ed3a2e487a..287b64b788db 100644
--- a/drivers/net/dsa/ocelot/seville_vsc9953.c
+++ b/drivers/net/dsa/ocelot/seville_vsc9953.c
@@ -971,6 +971,7 @@ static const struct felix_info seville_info_vsc9953 = {
 	.vcap_pol_max		= VSC9953_VCAP_POLICER_MAX,
 	.vcap_pol_base2		= VSC9953_VCAP_POLICER_BASE2,
 	.vcap_pol_max2		= VSC9953_VCAP_POLICER_MAX2,
+	.quirks			= FELIX_MAC_QUIRKS,
 	.num_mact_rows		= 2048,
 	.num_ports		= VSC9953_NUM_PORTS,
 	.num_tx_queues		= OCELOT_NUM_TC,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v5 net-next 07/13] net: dsa: felix: add support for MFD configurations
  2023-01-27 19:35 [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys Colin Foster
                   ` (5 preceding siblings ...)
  2023-01-27 19:35 ` [PATCH v5 net-next 06/13] net: dsa: felix: add configurable device quirks Colin Foster
@ 2023-01-27 19:35 ` Colin Foster
  2023-01-27 19:40   ` Florian Fainelli
  2023-01-27 19:35 ` [PATCH v5 net-next 08/13] net: dsa: felix: add functionality when not all ports are supported Colin Foster
                   ` (7 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Colin Foster @ 2023-01-27 19:35 UTC (permalink / raw)
  To: netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Florian Fainelli, Andrew Lunn,
	UNGLinuxDriver, Alexandre Belloni, Claudiu Manoil,
	Vladimir Oltean, Paolo Abeni, Jakub Kicinski, Eric Dumazet,
	David S. Miller, Krzysztof Kozlowski, Rob Herring, Lee Jones

The architecture around the VSC7512 differs from existing felix drivers. In
order to add support for all the chip's features (pinctrl, MDIO, gpio) the
device had to be laid out as a multi-function device (MFD).

One difference between an MFD and a standard platform device is that the
regmaps are allocated to the parent device before the child devices are
probed. As such, there is no need for felix to initialize new regmaps in
these configurations, they can simply be requested from the parent device.

Add support for MFD configurations by performing this request from the
parent device.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
---

v5
    * No changes

v4
    * New patch

---
 drivers/net/dsa/ocelot/felix.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
index 462a1a683996..d3ff6e8a82e9 100644
--- a/drivers/net/dsa/ocelot/felix.c
+++ b/drivers/net/dsa/ocelot/felix.c
@@ -1315,6 +1315,13 @@ static struct regmap *felix_request_regmap_by_name(struct felix *felix,
 	struct resource res;
 	int i;
 
+	/* In an MFD configuration, regmaps are registered directly to the
+	 * parent device before the child devices are probed, so there is no
+	 * need to initialize a new one.
+	 */
+	if (!felix->info->resources)
+		return dev_get_regmap(ocelot->dev->parent, resource_name);
+
 	for (i = 0; i < felix->info->num_resources; i++) {
 		if (strcmp(resource_name, felix->info->resources[i].name))
 			continue;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v5 net-next 08/13] net: dsa: felix: add functionality when not all ports are supported
  2023-01-27 19:35 [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys Colin Foster
                   ` (6 preceding siblings ...)
  2023-01-27 19:35 ` [PATCH v5 net-next 07/13] net: dsa: felix: add support for MFD configurations Colin Foster
@ 2023-01-27 19:35 ` Colin Foster
  2023-01-27 19:41   ` Florian Fainelli
  2023-01-27 19:35 ` [PATCH v5 net-next 09/13] mfd: ocelot: prepend resource size macros to be 32-bit Colin Foster
                   ` (6 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Colin Foster @ 2023-01-27 19:35 UTC (permalink / raw)
  To: netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Florian Fainelli, Andrew Lunn,
	UNGLinuxDriver, Alexandre Belloni, Claudiu Manoil,
	Vladimir Oltean, Paolo Abeni, Jakub Kicinski, Eric Dumazet,
	David S. Miller, Krzysztof Kozlowski, Rob Herring, Lee Jones

When the Felix driver would probe the ports and verify functionality, it
would fail if it hit single port mode that wasn't supported by the driver.

The initial case for the VSC7512 driver will have physical ports that
exist, but aren't supported by the driver implementation. Add the
OCELOT_PORT_MODE_NONE macro to handle this scenario, and allow the Felix
driver to continue with all the ports that are currently functional.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
---

v5
    * No changes

v4
    * New patch

---
 drivers/net/dsa/ocelot/felix.c | 11 ++++++++---
 drivers/net/dsa/ocelot/felix.h |  1 +
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
index d3ff6e8a82e9..d4cc9e60f369 100644
--- a/drivers/net/dsa/ocelot/felix.c
+++ b/drivers/net/dsa/ocelot/felix.c
@@ -1273,10 +1273,15 @@ static int felix_parse_ports_node(struct felix *felix,
 
 		err = felix_validate_phy_mode(felix, port, phy_mode);
 		if (err < 0) {
-			dev_err(dev, "Unsupported PHY mode %s on port %d\n",
-				phy_modes(phy_mode), port);
+			dev_info(dev, "Unsupported PHY mode %s on port %d\n",
+				 phy_modes(phy_mode), port);
 			of_node_put(child);
-			return err;
+
+			/* Leave port_phy_modes[port] = 0, which is also
+			 * PHY_INTERFACE_MODE_NA. This will perform a
+			 * best-effort to bring up as many ports as possible.
+			 */
+			continue;
 		}
 
 		port_phy_modes[port] = phy_mode;
diff --git a/drivers/net/dsa/ocelot/felix.h b/drivers/net/dsa/ocelot/felix.h
index 9e1ae1dde0d9..d5d0b30c0b75 100644
--- a/drivers/net/dsa/ocelot/felix.h
+++ b/drivers/net/dsa/ocelot/felix.h
@@ -7,6 +7,7 @@
 #define ocelot_to_felix(o)		container_of((o), struct felix, ocelot)
 #define FELIX_MAC_QUIRKS		OCELOT_QUIRK_PCS_PERFORMS_RATE_ADAPTATION
 
+#define OCELOT_PORT_MODE_NONE		0
 #define OCELOT_PORT_MODE_INTERNAL	BIT(0)
 #define OCELOT_PORT_MODE_SGMII		BIT(1)
 #define OCELOT_PORT_MODE_QSGMII		BIT(2)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v5 net-next 09/13] mfd: ocelot: prepend resource size macros to be 32-bit
  2023-01-27 19:35 [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys Colin Foster
                   ` (7 preceding siblings ...)
  2023-01-27 19:35 ` [PATCH v5 net-next 08/13] net: dsa: felix: add functionality when not all ports are supported Colin Foster
@ 2023-01-27 19:35 ` Colin Foster
  2023-01-27 19:41   ` Florian Fainelli
  2023-01-27 19:35 ` [PATCH v5 net-next 10/13] dt-bindings: net: mscc,vsc7514-switch: add dsa binding for the vsc7512 Colin Foster
                   ` (5 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Colin Foster @ 2023-01-27 19:35 UTC (permalink / raw)
  To: netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Florian Fainelli, Andrew Lunn,
	UNGLinuxDriver, Alexandre Belloni, Claudiu Manoil,
	Vladimir Oltean, Paolo Abeni, Jakub Kicinski, Eric Dumazet,
	David S. Miller, Krzysztof Kozlowski, Rob Herring, Lee Jones

The *_RES_SIZE macros are initally <= 0x100. Future resource sizes will be
upwards of 0x200000 in size.

To keep things clean, fully align the RES_SIZE macros to 32-bit to do
nothing more than make the code more consistent.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
Acked-for-MFD-by: Lee Jones <lee@kernel.org>
---

v5
    * Add Lee's Acked-for-MFD tag

v3-v4
    * No change

v2
    * New patch - broken out from a different one

---
 drivers/mfd/ocelot-core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/ocelot-core.c b/drivers/mfd/ocelot-core.c
index 1816d52c65c5..013e83173062 100644
--- a/drivers/mfd/ocelot-core.c
+++ b/drivers/mfd/ocelot-core.c
@@ -34,16 +34,16 @@
 
 #define VSC7512_MIIM0_RES_START		0x7107009c
 #define VSC7512_MIIM1_RES_START		0x710700c0
-#define VSC7512_MIIM_RES_SIZE		0x024
+#define VSC7512_MIIM_RES_SIZE		0x00000024
 
 #define VSC7512_PHY_RES_START		0x710700f0
-#define VSC7512_PHY_RES_SIZE		0x004
+#define VSC7512_PHY_RES_SIZE		0x00000004
 
 #define VSC7512_GPIO_RES_START		0x71070034
-#define VSC7512_GPIO_RES_SIZE		0x06c
+#define VSC7512_GPIO_RES_SIZE		0x0000006c
 
 #define VSC7512_SIO_CTRL_RES_START	0x710700f8
-#define VSC7512_SIO_CTRL_RES_SIZE	0x100
+#define VSC7512_SIO_CTRL_RES_SIZE	0x00000100
 
 #define VSC7512_GCB_RST_SLEEP_US	100
 #define VSC7512_GCB_RST_TIMEOUT_US	100000
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v5 net-next 10/13] dt-bindings: net: mscc,vsc7514-switch: add dsa binding for the vsc7512
  2023-01-27 19:35 [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys Colin Foster
                   ` (8 preceding siblings ...)
  2023-01-27 19:35 ` [PATCH v5 net-next 09/13] mfd: ocelot: prepend resource size macros to be 32-bit Colin Foster
@ 2023-01-27 19:35 ` Colin Foster
  2023-01-30 21:10   ` Rob Herring
  2023-01-27 19:35 ` [PATCH v5 net-next 11/13] dt-bindings: mfd: ocelot: add ethernet-switch hardware support Colin Foster
                   ` (4 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Colin Foster @ 2023-01-27 19:35 UTC (permalink / raw)
  To: netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Florian Fainelli, Andrew Lunn,
	UNGLinuxDriver, Alexandre Belloni, Claudiu Manoil,
	Vladimir Oltean, Paolo Abeni, Jakub Kicinski, Eric Dumazet,
	David S. Miller, Krzysztof Kozlowski, Rob Herring, Lee Jones

The VSC7511, VSC7512, VSC7513 and VSC7514 all have the ability to be
controlled either internally by a memory-mapped CPU, or externally via
interfaces like SPI and PCIe. The internal CPU of the VSC7511 and 7512
don't have the resources to run Linux, so must be controlled via these
external interfaces in a DSA configuration.

Add mscc,vsc7512-switch compatible string to indicate that the chips are
being controlled externally in a DSA configuration.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
---

v5
    * New patch after a documentation overhaul series

---
 .../bindings/net/mscc,vsc7514-switch.yaml     | 113 ++++++++++++++----
 1 file changed, 90 insertions(+), 23 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml b/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml
index 5ffe831e59e4..8ee2c7d7ff42 100644
--- a/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml
+++ b/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml
@@ -18,13 +18,52 @@ description: |
   packets using CPU. Additionally, PTP is supported as well as FDMA for faster
   packet extraction/injection.
 
-$ref: ethernet-switch.yaml#
+allOf:
+  - if:
+      properties:
+        compatible:
+          const: mscc,vsc7514-switch
+    then:
+      $ref: ethernet-switch.yaml#
+      required:
+        - interrupts
+        - interrupt-names
+      properties:
+        reg:
+          minItems: 21
+        reg-names:
+          minItems: 21
+        ethernet-ports:
+          patternProperties:
+            "^port@[0-9a-f]+$":
+              $ref: ethernet-switch-port.yaml#
+              unevaluatedProperties: false
+
+  - if:
+      properties:
+        compatible:
+          const: mscc,vsc7512-switch
+    then:
+      $ref: /schemas/net/dsa/dsa.yaml#
+      properties:
+        reg:
+          maxItems: 20
+        reg-names:
+          maxItems: 20
+        ethernet-ports:
+          patternProperties:
+            "^port@[0-9a-f]+$":
+              $ref: /schemas/net/dsa/dsa-port.yaml#
+              unevaluatedProperties: false
 
 properties:
   compatible:
-    const: mscc,vsc7514-switch
+    enum:
+      - mscc,vsc7512-switch
+      - mscc,vsc7514-switch
 
   reg:
+    minItems: 20
     items:
       - description: system target
       - description: rewriter target
@@ -49,6 +88,7 @@ properties:
       - description: fdma target
 
   reg-names:
+    minItems: 20
     items:
       - const: sys
       - const: rew
@@ -86,35 +126,16 @@ properties:
       - const: xtr
       - const: fdma
 
-  ethernet-ports:
-    type: object
-
-    properties:
-      '#address-cells':
-        const: 1
-      '#size-cells':
-        const: 0
-
-    additionalProperties: false
-
-    patternProperties:
-      "^port@[0-9a-f]+$":
-
-        $ref: ethernet-switch-port.yaml#
-
-        unevaluatedProperties: false
-
 required:
   - compatible
   - reg
   - reg-names
-  - interrupts
-  - interrupt-names
   - ethernet-ports
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
+  # VSC7514 (Switchdev)
   - |
     switch@1010000 {
       compatible = "mscc,vsc7514-switch";
@@ -162,5 +183,51 @@ examples:
         };
       };
     };
+  # VSC7512 (DSA)
+  - |
+    ethernet-switch@1{
+      compatible = "mscc,vsc7512-switch";
+      reg = <0x71010000 0x10000>,
+            <0x71030000 0x10000>,
+            <0x71080000 0x100>,
+            <0x710e0000 0x10000>,
+            <0x711e0000 0x100>,
+            <0x711f0000 0x100>,
+            <0x71200000 0x100>,
+            <0x71210000 0x100>,
+            <0x71220000 0x100>,
+            <0x71230000 0x100>,
+            <0x71240000 0x100>,
+            <0x71250000 0x100>,
+            <0x71260000 0x100>,
+            <0x71270000 0x100>,
+            <0x71280000 0x100>,
+            <0x71800000 0x80000>,
+            <0x71880000 0x10000>,
+            <0x71040000 0x10000>,
+            <0x71050000 0x10000>,
+            <0x71060000 0x10000>;
+            reg-names = "sys", "rew", "qs", "ptp", "port0", "port1",
+            "port2", "port3", "port4", "port5", "port6",
+            "port7", "port8", "port9", "port10", "qsys",
+            "ana", "s0", "s1", "s2";
+
+            ethernet-ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+           port@0 {
+            reg = <0>;
+            ethernet = <&mac_sw>;
+            phy-handle = <&phy0>;
+            phy-mode = "internal";
+          };
+          port@1 {
+            reg = <1>;
+            phy-handle = <&phy1>;
+            phy-mode = "internal";
+          };
+        };
+      };
 
 ...
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v5 net-next 11/13] dt-bindings: mfd: ocelot: add ethernet-switch hardware support
  2023-01-27 19:35 [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys Colin Foster
                   ` (9 preceding siblings ...)
  2023-01-27 19:35 ` [PATCH v5 net-next 10/13] dt-bindings: net: mscc,vsc7514-switch: add dsa binding for the vsc7512 Colin Foster
@ 2023-01-27 19:35 ` Colin Foster
  2023-01-30 21:10   ` Rob Herring
  2023-01-27 19:35 ` [PATCH v5 net-next 12/13] net: dsa: ocelot: add external ocelot switch control Colin Foster
                   ` (3 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Colin Foster @ 2023-01-27 19:35 UTC (permalink / raw)
  To: netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Florian Fainelli, Andrew Lunn,
	UNGLinuxDriver, Alexandre Belloni, Claudiu Manoil,
	Vladimir Oltean, Paolo Abeni, Jakub Kicinski, Eric Dumazet,
	David S. Miller, Krzysztof Kozlowski, Rob Herring, Lee Jones

The main purpose of the Ocelot chips are the Ethernet switching
functionalities. Document the support for these features.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
---

v5
    * Update ref to mscc,vsc7514-switch.yaml instead of
      mscc.ocelot.yaml
    * Add unevaluatedProperties: false

v4
    * New patch

---
 Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml b/Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml
index 1d1fee1a16c1..8bd1abfc44d9 100644
--- a/Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml
+++ b/Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml
@@ -57,6 +57,15 @@ patternProperties:
         enum:
           - mscc,ocelot-miim
 
+  "^ethernet-switch@[0-9a-f]+$":
+    type: object
+    $ref: /schemas/net/mscc,vsc7514-switch.yaml
+    unevaluatedProperties: false
+    properties:
+      compatible:
+        enum:
+          - mscc,vsc7512-switch
+
 required:
   - compatible
   - reg
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v5 net-next 12/13] net: dsa: ocelot: add external ocelot switch control
  2023-01-27 19:35 [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys Colin Foster
                   ` (10 preceding siblings ...)
  2023-01-27 19:35 ` [PATCH v5 net-next 11/13] dt-bindings: mfd: ocelot: add ethernet-switch hardware support Colin Foster
@ 2023-01-27 19:35 ` Colin Foster
  2023-01-27 19:53   ` Florian Fainelli
  2023-01-27 19:35 ` [PATCH v5 net-next 13/13] mfd: " Colin Foster
                   ` (2 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Colin Foster @ 2023-01-27 19:35 UTC (permalink / raw)
  To: netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Florian Fainelli, Andrew Lunn,
	UNGLinuxDriver, Alexandre Belloni, Claudiu Manoil,
	Vladimir Oltean, Paolo Abeni, Jakub Kicinski, Eric Dumazet,
	David S. Miller, Krzysztof Kozlowski, Rob Herring, Lee Jones

Add control of an external VSC7512 chip.

Currently the four copper phy ports are fully functional. Communication to
external phys is also functional, but the SGMII / QSGMII interfaces are
currently non-functional.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
---

v5
    * Rebase to use NET_DSA_MSCC_FELIX_DSA_LIB
    * Remove ocelot_ext_phylink_validate as part of the rebase
    * Remove stats_layout reference as part of the rebase
    * Remove OCELOT_RES_NAME_* macros

v4
    * Add forward-compatibility for device trees that have ports 4-7
      defined by saying they are OCELOT_PORT_MODE_NONE
    * Utilize new "resource_names" instead of "*_io_res". Many thanks
      to Vladimir for making this possible.
      - Also remove ocelot_ext_regmap_init() function
    * Remove dev_set_drvdata(dev, NULL) from remove() to match other
      drivers

v3
    * Remove additional entry in vsc7512_port_modes array
    * Add MFD_OCELOT namespace import, which is needed for
      vsc7512_*_io_res

v2
    * Add MAINTAINERS update
    * Remove phrase "by way of the ocelot-mfd interface" from the commit
      message
    * Move MFD resource addition to a separate patch
    * Update Kconfig help
    * Remove "ocelot_ext_reset()" - it is now shared with ocelot_lib
    * Remove unnecessary includes
    * Remove "_EXT" from OCELOT_EXT_PORT_MODE_SERDES
    * Remove _ext from the compatible string
    * Remove no-longer-necessary GCB register definitions

v1 from previous RFC:
    * Remove unnecessary byteorder and kconfig header includes.
    * Create OCELOT_EXT_PORT_MODE_SERDES macro to match vsc9959.
    * Utilize readx_poll_timeout for SYS_RESET_CFG_MEM_INIT.
    * *_io_res struct arrays have been moved to the MFD files.
    * Changes to utilize phylink_generic_validate() have been squashed.
    * dev_err_probe() is used in the probe function.
    * Make ocelot_ext_switch_of_match static.
    * Relocate ocelot_ext_ops structure to be next to vsc7512_info, to
      match what was done in other felix drivers.
    * Utilize dev_get_regmap() instead of the obsolete
      ocelot_init_regmap_from_resource() routine.

---
 MAINTAINERS                         |   1 +
 drivers/net/dsa/ocelot/Kconfig      |  20 ++++
 drivers/net/dsa/ocelot/Makefile     |   2 +
 drivers/net/dsa/ocelot/ocelot_ext.c | 163 ++++++++++++++++++++++++++++
 4 files changed, 186 insertions(+)
 create mode 100644 drivers/net/dsa/ocelot/ocelot_ext.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 6e85524a7443..733e311ee9c6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -15157,6 +15157,7 @@ M:	Colin Foster <colin.foster@in-advantage.com>
 S:	Supported
 F:	Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml
 F:	drivers/mfd/ocelot*
+F:	drivers/net/dsa/ocelot/ocelot_ext.c
 F:	include/linux/mfd/ocelot.h
 
 OCXL (Open Coherent Accelerator Processor Interface OpenCAPI) DRIVER
diff --git a/drivers/net/dsa/ocelot/Kconfig b/drivers/net/dsa/ocelot/Kconfig
index 60f1f7ada465..640725524d0c 100644
--- a/drivers/net/dsa/ocelot/Kconfig
+++ b/drivers/net/dsa/ocelot/Kconfig
@@ -8,6 +8,26 @@ config NET_DSA_MSCC_FELIX_DSA_LIB
 	  Its name comes from the first hardware chip to make use of it
 	  (VSC9959), code named Felix.
 
+config NET_DSA_MSCC_OCELOT_EXT
+	tristate "Ocelot External Ethernet switch support"
+	depends on NET_DSA && SPI
+	depends on NET_VENDOR_MICROSEMI
+	select MDIO_MSCC_MIIM
+	select MFD_OCELOT_CORE
+	select MSCC_OCELOT_SWITCH_LIB
+	select NET_DSA_MSCC_FELIX_DSA_LIB
+	select NET_DSA_TAG_OCELOT_8021Q
+	select NET_DSA_TAG_OCELOT
+	help
+	  This driver supports the VSC7511, VSC7512, VSC7513 and VSC7514 chips
+	  when controlled through SPI.
+
+	  The Ocelot switch family is a set of multi-port networking chips. All
+	  of these chips have the ability to be controlled externally through
+	  SPI or PCIe interfaces.
+
+	  Say "Y" here to enable external control to these chips.
+
 config NET_DSA_MSCC_FELIX
 	tristate "Ocelot / Felix Ethernet switch support"
 	depends on NET_DSA && PCI
diff --git a/drivers/net/dsa/ocelot/Makefile b/drivers/net/dsa/ocelot/Makefile
index fd7dde570d4e..ead868a293e3 100644
--- a/drivers/net/dsa/ocelot/Makefile
+++ b/drivers/net/dsa/ocelot/Makefile
@@ -1,8 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0-only
 obj-$(CONFIG_NET_DSA_MSCC_FELIX_DSA_LIB) += mscc_felix_dsa_lib.o
 obj-$(CONFIG_NET_DSA_MSCC_FELIX) += mscc_felix.o
+obj-$(CONFIG_NET_DSA_MSCC_OCELOT_EXT) += mscc_ocelot_ext.o
 obj-$(CONFIG_NET_DSA_MSCC_SEVILLE) += mscc_seville.o
 
 mscc_felix_dsa_lib-objs := felix.o
 mscc_felix-objs := felix_vsc9959.o
+mscc_ocelot_ext-objs := ocelot_ext.o
 mscc_seville-objs := seville_vsc9953.o
diff --git a/drivers/net/dsa/ocelot/ocelot_ext.c b/drivers/net/dsa/ocelot/ocelot_ext.c
new file mode 100644
index 000000000000..14efa6387bd7
--- /dev/null
+++ b/drivers/net/dsa/ocelot/ocelot_ext.c
@@ -0,0 +1,163 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright 2021-2022 Innovative Advantage Inc.
+ */
+
+#include <linux/mfd/ocelot.h>
+#include <linux/phylink.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+#include <soc/mscc/ocelot.h>
+#include <soc/mscc/vsc7514_regs.h>
+#include "felix.h"
+
+#define VSC7514_NUM_PORTS		11
+
+#define OCELOT_PORT_MODE_SERDES		(OCELOT_PORT_MODE_SGMII | \
+					 OCELOT_PORT_MODE_QSGMII)
+
+static const u32 vsc7512_port_modes[VSC7514_NUM_PORTS] = {
+	OCELOT_PORT_MODE_INTERNAL,
+	OCELOT_PORT_MODE_INTERNAL,
+	OCELOT_PORT_MODE_INTERNAL,
+	OCELOT_PORT_MODE_INTERNAL,
+	OCELOT_PORT_MODE_NONE,
+	OCELOT_PORT_MODE_NONE,
+	OCELOT_PORT_MODE_NONE,
+	OCELOT_PORT_MODE_NONE,
+	OCELOT_PORT_MODE_NONE,
+	OCELOT_PORT_MODE_NONE,
+	OCELOT_PORT_MODE_NONE,
+};
+
+static const struct ocelot_ops ocelot_ext_ops = {
+	.reset		= ocelot_reset,
+	.wm_enc		= ocelot_wm_enc,
+	.wm_dec		= ocelot_wm_dec,
+	.wm_stat	= ocelot_wm_stat,
+	.port_to_netdev	= felix_port_to_netdev,
+	.netdev_to_port	= felix_netdev_to_port,
+};
+
+static const char * const vsc7512_resource_names[TARGET_MAX] = {
+	[SYS] = "sys",
+	[REW] = "rew",
+	[S0] = "s0",
+	[S1] = "s1",
+	[S2] = "s2",
+	[QS] = "qs",
+	[QSYS] = "qsys",
+	[ANA] = "ana",
+};
+
+static const struct felix_info vsc7512_info = {
+	.resource_names			= vsc7512_resource_names,
+	.regfields			= vsc7514_regfields,
+	.map				= vsc7514_regmap,
+	.ops				= &ocelot_ext_ops,
+	.vcap				= vsc7514_vcap_props,
+	.num_mact_rows			= 1024,
+	.num_ports			= VSC7514_NUM_PORTS,
+	.num_tx_queues			= OCELOT_NUM_TC,
+	.port_modes			= vsc7512_port_modes,
+};
+
+static int ocelot_ext_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct dsa_switch *ds;
+	struct ocelot *ocelot;
+	struct felix *felix;
+	int err;
+
+	felix = kzalloc(sizeof(*felix), GFP_KERNEL);
+	if (!felix)
+		return -ENOMEM;
+
+	dev_set_drvdata(dev, felix);
+
+	ocelot = &felix->ocelot;
+	ocelot->dev = dev;
+
+	ocelot->num_flooding_pgids = 1;
+
+	felix->info = &vsc7512_info;
+
+	ds = kzalloc(sizeof(*ds), GFP_KERNEL);
+	if (!ds) {
+		err = -ENOMEM;
+		dev_err_probe(dev, err, "Failed to allocate DSA switch\n");
+		goto err_free_felix;
+	}
+
+	ds->dev = dev;
+	ds->num_ports = felix->info->num_ports;
+	ds->num_tx_queues = felix->info->num_tx_queues;
+
+	ds->ops = &felix_switch_ops;
+	ds->priv = ocelot;
+	felix->ds = ds;
+	felix->tag_proto = DSA_TAG_PROTO_OCELOT;
+
+	err = dsa_register_switch(ds);
+	if (err) {
+		dev_err_probe(dev, err, "Failed to register DSA switch\n");
+		goto err_free_ds;
+	}
+
+	return 0;
+
+err_free_ds:
+	kfree(ds);
+err_free_felix:
+	kfree(felix);
+	return err;
+}
+
+static int ocelot_ext_remove(struct platform_device *pdev)
+{
+	struct felix *felix = dev_get_drvdata(&pdev->dev);
+
+	if (!felix)
+		return 0;
+
+	dsa_unregister_switch(felix->ds);
+
+	kfree(felix->ds);
+	kfree(felix);
+
+	return 0;
+}
+
+static void ocelot_ext_shutdown(struct platform_device *pdev)
+{
+	struct felix *felix = dev_get_drvdata(&pdev->dev);
+
+	if (!felix)
+		return;
+
+	dsa_switch_shutdown(felix->ds);
+
+	dev_set_drvdata(&pdev->dev, NULL);
+}
+
+static const struct of_device_id ocelot_ext_switch_of_match[] = {
+	{ .compatible = "mscc,vsc7512-switch" },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, ocelot_ext_switch_of_match);
+
+static struct platform_driver ocelot_ext_switch_driver = {
+	.driver = {
+		.name = "ocelot-switch",
+		.of_match_table = of_match_ptr(ocelot_ext_switch_of_match),
+	},
+	.probe = ocelot_ext_probe,
+	.remove = ocelot_ext_remove,
+	.shutdown = ocelot_ext_shutdown,
+};
+module_platform_driver(ocelot_ext_switch_driver);
+
+MODULE_DESCRIPTION("External Ocelot Switch driver");
+MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS(MFD_OCELOT);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v5 net-next 13/13] mfd: ocelot: add external ocelot switch control
  2023-01-27 19:35 [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys Colin Foster
                   ` (11 preceding siblings ...)
  2023-01-27 19:35 ` [PATCH v5 net-next 12/13] net: dsa: ocelot: add external ocelot switch control Colin Foster
@ 2023-01-27 19:35 ` Colin Foster
  2023-01-27 19:53   ` Florian Fainelli
  2023-01-30 15:31 ` [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys Vladimir Oltean
  2023-01-31  5:20 ` patchwork-bot+netdevbpf
  14 siblings, 1 reply; 34+ messages in thread
From: Colin Foster @ 2023-01-27 19:35 UTC (permalink / raw)
  To: netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Florian Fainelli, Andrew Lunn,
	UNGLinuxDriver, Alexandre Belloni, Claudiu Manoil,
	Vladimir Oltean, Paolo Abeni, Jakub Kicinski, Eric Dumazet,
	David S. Miller, Krzysztof Kozlowski, Rob Herring, Lee Jones

Utilize the existing ocelot MFD interface to add switch functionality to
the Microsemi VSC7512 chip.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
Acked-for-MFD-by: Lee Jones <lee@kernel.org>
---

v5
    * Add Acked-for-MFD Lee tag
    * Remove OCELOT_REG_NAME_ macros

v4
    * Integrate a different patch, so now this one
      - Adds the resources during this patch. Previouisly this
        was done in a separate patch
      - Utilize the standard {,num_}resources initializer

v3
    * No change

v2
    * New patch, broken out from a previous one

---
 drivers/mfd/ocelot-core.c | 60 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/drivers/mfd/ocelot-core.c b/drivers/mfd/ocelot-core.c
index 013e83173062..b0ff05c1759f 100644
--- a/drivers/mfd/ocelot-core.c
+++ b/drivers/mfd/ocelot-core.c
@@ -45,6 +45,39 @@
 #define VSC7512_SIO_CTRL_RES_START	0x710700f8
 #define VSC7512_SIO_CTRL_RES_SIZE	0x00000100
 
+#define VSC7512_ANA_RES_START		0x71880000
+#define VSC7512_ANA_RES_SIZE		0x00010000
+
+#define VSC7512_QS_RES_START		0x71080000
+#define VSC7512_QS_RES_SIZE		0x00000100
+
+#define VSC7512_QSYS_RES_START		0x71800000
+#define VSC7512_QSYS_RES_SIZE		0x00200000
+
+#define VSC7512_REW_RES_START		0x71030000
+#define VSC7512_REW_RES_SIZE		0x00010000
+
+#define VSC7512_SYS_RES_START		0x71010000
+#define VSC7512_SYS_RES_SIZE		0x00010000
+
+#define VSC7512_S0_RES_START		0x71040000
+#define VSC7512_S1_RES_START		0x71050000
+#define VSC7512_S2_RES_START		0x71060000
+#define VCAP_RES_SIZE			0x00000400
+
+#define VSC7512_PORT_0_RES_START	0x711e0000
+#define VSC7512_PORT_1_RES_START	0x711f0000
+#define VSC7512_PORT_2_RES_START	0x71200000
+#define VSC7512_PORT_3_RES_START	0x71210000
+#define VSC7512_PORT_4_RES_START	0x71220000
+#define VSC7512_PORT_5_RES_START	0x71230000
+#define VSC7512_PORT_6_RES_START	0x71240000
+#define VSC7512_PORT_7_RES_START	0x71250000
+#define VSC7512_PORT_8_RES_START	0x71260000
+#define VSC7512_PORT_9_RES_START	0x71270000
+#define VSC7512_PORT_10_RES_START	0x71280000
+#define VSC7512_PORT_RES_SIZE		0x00010000
+
 #define VSC7512_GCB_RST_SLEEP_US	100
 #define VSC7512_GCB_RST_TIMEOUT_US	100000
 
@@ -96,6 +129,28 @@ static const struct resource vsc7512_sgpio_resources[] = {
 	DEFINE_RES_REG_NAMED(VSC7512_SIO_CTRL_RES_START, VSC7512_SIO_CTRL_RES_SIZE, "gcb_sio"),
 };
 
+static const struct resource vsc7512_switch_resources[] = {
+	DEFINE_RES_REG_NAMED(VSC7512_ANA_RES_START, VSC7512_ANA_RES_SIZE, "ana"),
+	DEFINE_RES_REG_NAMED(VSC7512_QS_RES_START, VSC7512_QS_RES_SIZE, "qs"),
+	DEFINE_RES_REG_NAMED(VSC7512_QSYS_RES_START, VSC7512_QSYS_RES_SIZE, "qsys"),
+	DEFINE_RES_REG_NAMED(VSC7512_REW_RES_START, VSC7512_REW_RES_SIZE, "rew"),
+	DEFINE_RES_REG_NAMED(VSC7512_SYS_RES_START, VSC7512_SYS_RES_SIZE, "sys"),
+	DEFINE_RES_REG_NAMED(VSC7512_S0_RES_START, VCAP_RES_SIZE, "s0"),
+	DEFINE_RES_REG_NAMED(VSC7512_S1_RES_START, VCAP_RES_SIZE, "s1"),
+	DEFINE_RES_REG_NAMED(VSC7512_S2_RES_START, VCAP_RES_SIZE, "s2"),
+	DEFINE_RES_REG_NAMED(VSC7512_PORT_0_RES_START, VSC7512_PORT_RES_SIZE, "port0"),
+	DEFINE_RES_REG_NAMED(VSC7512_PORT_1_RES_START, VSC7512_PORT_RES_SIZE, "port1"),
+	DEFINE_RES_REG_NAMED(VSC7512_PORT_2_RES_START, VSC7512_PORT_RES_SIZE, "port2"),
+	DEFINE_RES_REG_NAMED(VSC7512_PORT_3_RES_START, VSC7512_PORT_RES_SIZE, "port3"),
+	DEFINE_RES_REG_NAMED(VSC7512_PORT_4_RES_START, VSC7512_PORT_RES_SIZE, "port4"),
+	DEFINE_RES_REG_NAMED(VSC7512_PORT_5_RES_START, VSC7512_PORT_RES_SIZE, "port5"),
+	DEFINE_RES_REG_NAMED(VSC7512_PORT_6_RES_START, VSC7512_PORT_RES_SIZE, "port6"),
+	DEFINE_RES_REG_NAMED(VSC7512_PORT_7_RES_START, VSC7512_PORT_RES_SIZE, "port7"),
+	DEFINE_RES_REG_NAMED(VSC7512_PORT_8_RES_START, VSC7512_PORT_RES_SIZE, "port8"),
+	DEFINE_RES_REG_NAMED(VSC7512_PORT_9_RES_START, VSC7512_PORT_RES_SIZE, "port9"),
+	DEFINE_RES_REG_NAMED(VSC7512_PORT_10_RES_START, VSC7512_PORT_RES_SIZE, "port10")
+};
+
 static const struct mfd_cell vsc7512_devs[] = {
 	{
 		.name = "ocelot-pinctrl",
@@ -121,6 +176,11 @@ static const struct mfd_cell vsc7512_devs[] = {
 		.use_of_reg = true,
 		.num_resources = ARRAY_SIZE(vsc7512_miim1_resources),
 		.resources = vsc7512_miim1_resources,
+	}, {
+		.name = "ocelot-switch",
+		.of_compatible = "mscc,vsc7512-switch",
+		.num_resources = ARRAY_SIZE(vsc7512_switch_resources),
+		.resources = vsc7512_switch_resources,
 	},
 };
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* Re: [PATCH v5 net-next 01/13] net: mscc: ocelot: expose ocelot wm functions
  2023-01-27 19:35 ` [PATCH v5 net-next 01/13] net: mscc: ocelot: expose ocelot wm functions Colin Foster
@ 2023-01-27 19:37   ` Florian Fainelli
  0 siblings, 0 replies; 34+ messages in thread
From: Florian Fainelli @ 2023-01-27 19:37 UTC (permalink / raw)
  To: Colin Foster, netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Andrew Lunn, UNGLinuxDriver,
	Alexandre Belloni, Claudiu Manoil, Vladimir Oltean, Paolo Abeni,
	Jakub Kicinski, Eric Dumazet, David S. Miller,
	Krzysztof Kozlowski, Rob Herring, Lee Jones



On 1/27/2023 11:35 AM, Colin Foster wrote:
> Expose ocelot_wm functions so they can be shared with other drivers.
> 
> Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v5 net-next 02/13] net: mscc: ocelot: expose regfield definition to be used by other drivers
  2023-01-27 19:35 ` [PATCH v5 net-next 02/13] net: mscc: ocelot: expose regfield definition to be used by other drivers Colin Foster
@ 2023-01-27 19:38   ` Florian Fainelli
  0 siblings, 0 replies; 34+ messages in thread
From: Florian Fainelli @ 2023-01-27 19:38 UTC (permalink / raw)
  To: Colin Foster, netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Andrew Lunn, UNGLinuxDriver,
	Alexandre Belloni, Claudiu Manoil, Vladimir Oltean, Paolo Abeni,
	Jakub Kicinski, Eric Dumazet, David S. Miller,
	Krzysztof Kozlowski, Rob Herring, Lee Jones



On 1/27/2023 11:35 AM, Colin Foster wrote:
> The ocelot_regfields struct is common between several different chips, some
> of which can only be controlled externally. Export this structure so it
> doesn't have to be duplicated in these other drivers.
> 
> Rename the structure as well, to follow the conventions of other shared
> resources.
> 
> Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v5 net-next 03/13] net: mscc: ocelot: expose vcap_props structure
  2023-01-27 19:35 ` [PATCH v5 net-next 03/13] net: mscc: ocelot: expose vcap_props structure Colin Foster
@ 2023-01-27 19:38   ` Florian Fainelli
  0 siblings, 0 replies; 34+ messages in thread
From: Florian Fainelli @ 2023-01-27 19:38 UTC (permalink / raw)
  To: Colin Foster, netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Andrew Lunn, UNGLinuxDriver,
	Alexandre Belloni, Claudiu Manoil, Vladimir Oltean, Paolo Abeni,
	Jakub Kicinski, Eric Dumazet, David S. Miller,
	Krzysztof Kozlowski, Rob Herring, Lee Jones



On 1/27/2023 11:35 AM, Colin Foster wrote:
> The vcap_props structure is common to other devices, specifically the
> VSC7512 chip that can only be controlled externally. Export this structure
> so it doesn't need to be recreated.
> 
> Signed-off-by: Colin Foster <colin.foster@in-advantage.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v5 net-next 04/13] net: mscc: ocelot: expose ocelot_reset routine
  2023-01-27 19:35 ` [PATCH v5 net-next 04/13] net: mscc: ocelot: expose ocelot_reset routine Colin Foster
@ 2023-01-27 19:38   ` Florian Fainelli
  0 siblings, 0 replies; 34+ messages in thread
From: Florian Fainelli @ 2023-01-27 19:38 UTC (permalink / raw)
  To: Colin Foster, netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Andrew Lunn, UNGLinuxDriver,
	Alexandre Belloni, Claudiu Manoil, Vladimir Oltean, Paolo Abeni,
	Jakub Kicinski, Eric Dumazet, David S. Miller,
	Krzysztof Kozlowski, Rob Herring, Lee Jones



On 1/27/2023 11:35 AM, Colin Foster wrote:
> Resetting the switch core is the same whether it is done internally or
> externally. Move this routine to the ocelot library so it can be used by
> other drivers.
> 
> Signed-off-by: Colin Foster <colin.foster@in-advantage.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v5 net-next 05/13] net: mscc: ocelot: expose vsc7514_regmap definition
  2023-01-27 19:35 ` [PATCH v5 net-next 05/13] net: mscc: ocelot: expose vsc7514_regmap definition Colin Foster
@ 2023-01-27 19:39   ` Florian Fainelli
  0 siblings, 0 replies; 34+ messages in thread
From: Florian Fainelli @ 2023-01-27 19:39 UTC (permalink / raw)
  To: Colin Foster, netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Andrew Lunn, UNGLinuxDriver,
	Alexandre Belloni, Claudiu Manoil, Vladimir Oltean, Paolo Abeni,
	Jakub Kicinski, Eric Dumazet, David S. Miller,
	Krzysztof Kozlowski, Rob Herring, Lee Jones



On 1/27/2023 11:35 AM, Colin Foster wrote:
> The VSC7514 target regmap is identical for ones shared with similar
> hardware, specifically the VSC7512. Share this resource, and change the
> name to match the pattern of other exported resources.
> 
> Signed-off-by: Colin Foster <colin.foster@in-advantage.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v5 net-next 06/13] net: dsa: felix: add configurable device quirks
  2023-01-27 19:35 ` [PATCH v5 net-next 06/13] net: dsa: felix: add configurable device quirks Colin Foster
@ 2023-01-27 19:39   ` Florian Fainelli
  0 siblings, 0 replies; 34+ messages in thread
From: Florian Fainelli @ 2023-01-27 19:39 UTC (permalink / raw)
  To: Colin Foster, netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Andrew Lunn, UNGLinuxDriver,
	Alexandre Belloni, Claudiu Manoil, Vladimir Oltean, Paolo Abeni,
	Jakub Kicinski, Eric Dumazet, David S. Miller,
	Krzysztof Kozlowski, Rob Herring, Lee Jones



On 1/27/2023 11:35 AM, Colin Foster wrote:
> The define FELIX_MAC_QUIRKS was used directly in the felix.c shared driver.
> Other devices (VSC7512 for example) don't require the same quirks, so they
> need to be configured on a per-device basis.
> 
> Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v5 net-next 07/13] net: dsa: felix: add support for MFD configurations
  2023-01-27 19:35 ` [PATCH v5 net-next 07/13] net: dsa: felix: add support for MFD configurations Colin Foster
@ 2023-01-27 19:40   ` Florian Fainelli
  0 siblings, 0 replies; 34+ messages in thread
From: Florian Fainelli @ 2023-01-27 19:40 UTC (permalink / raw)
  To: Colin Foster, netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Andrew Lunn, UNGLinuxDriver,
	Alexandre Belloni, Claudiu Manoil, Vladimir Oltean, Paolo Abeni,
	Jakub Kicinski, Eric Dumazet, David S. Miller,
	Krzysztof Kozlowski, Rob Herring, Lee Jones



On 1/27/2023 11:35 AM, Colin Foster wrote:
> The architecture around the VSC7512 differs from existing felix drivers. In
> order to add support for all the chip's features (pinctrl, MDIO, gpio) the
> device had to be laid out as a multi-function device (MFD).
> 
> One difference between an MFD and a standard platform device is that the
> regmaps are allocated to the parent device before the child devices are
> probed. As such, there is no need for felix to initialize new regmaps in
> these configurations, they can simply be requested from the parent device.
> 
> Add support for MFD configurations by performing this request from the
> parent device.
> 
> Signed-off-by: Colin Foster <colin.foster@in-advantage.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v5 net-next 09/13] mfd: ocelot: prepend resource size macros to be 32-bit
  2023-01-27 19:35 ` [PATCH v5 net-next 09/13] mfd: ocelot: prepend resource size macros to be 32-bit Colin Foster
@ 2023-01-27 19:41   ` Florian Fainelli
  0 siblings, 0 replies; 34+ messages in thread
From: Florian Fainelli @ 2023-01-27 19:41 UTC (permalink / raw)
  To: Colin Foster, netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Andrew Lunn, UNGLinuxDriver,
	Alexandre Belloni, Claudiu Manoil, Vladimir Oltean, Paolo Abeni,
	Jakub Kicinski, Eric Dumazet, David S. Miller,
	Krzysztof Kozlowski, Rob Herring, Lee Jones



On 1/27/2023 11:35 AM, Colin Foster wrote:
> The *_RES_SIZE macros are initally <= 0x100. Future resource sizes will be
> upwards of 0x200000 in size.
> 
> To keep things clean, fully align the RES_SIZE macros to 32-bit to do
> nothing more than make the code more consistent.
> 
> Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
> Acked-for-MFD-by: Lee Jones <lee@kernel.org>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v5 net-next 08/13] net: dsa: felix: add functionality when not all ports are supported
  2023-01-27 19:35 ` [PATCH v5 net-next 08/13] net: dsa: felix: add functionality when not all ports are supported Colin Foster
@ 2023-01-27 19:41   ` Florian Fainelli
  0 siblings, 0 replies; 34+ messages in thread
From: Florian Fainelli @ 2023-01-27 19:41 UTC (permalink / raw)
  To: Colin Foster, netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Andrew Lunn, UNGLinuxDriver,
	Alexandre Belloni, Claudiu Manoil, Vladimir Oltean, Paolo Abeni,
	Jakub Kicinski, Eric Dumazet, David S. Miller,
	Krzysztof Kozlowski, Rob Herring, Lee Jones



On 1/27/2023 11:35 AM, Colin Foster wrote:
> When the Felix driver would probe the ports and verify functionality, it
> would fail if it hit single port mode that wasn't supported by the driver.
> 
> The initial case for the VSC7512 driver will have physical ports that
> exist, but aren't supported by the driver implementation. Add the
> OCELOT_PORT_MODE_NONE macro to handle this scenario, and allow the Felix
> driver to continue with all the ports that are currently functional.
> 
> Signed-off-by: Colin Foster <colin.foster@in-advantage.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v5 net-next 12/13] net: dsa: ocelot: add external ocelot switch control
  2023-01-27 19:35 ` [PATCH v5 net-next 12/13] net: dsa: ocelot: add external ocelot switch control Colin Foster
@ 2023-01-27 19:53   ` Florian Fainelli
  0 siblings, 0 replies; 34+ messages in thread
From: Florian Fainelli @ 2023-01-27 19:53 UTC (permalink / raw)
  To: Colin Foster, netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Andrew Lunn, UNGLinuxDriver,
	Alexandre Belloni, Claudiu Manoil, Vladimir Oltean, Paolo Abeni,
	Jakub Kicinski, Eric Dumazet, David S. Miller,
	Krzysztof Kozlowski, Rob Herring, Lee Jones



On 1/27/2023 11:35 AM, Colin Foster wrote:
> Add control of an external VSC7512 chip.
> 
> Currently the four copper phy ports are fully functional. Communication to
> external phys is also functional, but the SGMII / QSGMII interfaces are
> currently non-functional.
> 
> Signed-off-by: Colin Foster <colin.foster@in-advantage.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v5 net-next 13/13] mfd: ocelot: add external ocelot switch control
  2023-01-27 19:35 ` [PATCH v5 net-next 13/13] mfd: " Colin Foster
@ 2023-01-27 19:53   ` Florian Fainelli
  2023-01-27 20:15     ` Colin Foster
  0 siblings, 1 reply; 34+ messages in thread
From: Florian Fainelli @ 2023-01-27 19:53 UTC (permalink / raw)
  To: Colin Foster, netdev, linux-kernel, devicetree
  Cc: Russell King, Richard Cochran, Andrew Lunn, UNGLinuxDriver,
	Alexandre Belloni, Claudiu Manoil, Vladimir Oltean, Paolo Abeni,
	Jakub Kicinski, Eric Dumazet, David S. Miller,
	Krzysztof Kozlowski, Rob Herring, Lee Jones



On 1/27/2023 11:35 AM, Colin Foster wrote:
> Utilize the existing ocelot MFD interface to add switch functionality to
> the Microsemi VSC7512 chip.
> 
> Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
> Acked-for-MFD-by: Lee Jones <lee@kernel.org>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v5 net-next 13/13] mfd: ocelot: add external ocelot switch control
  2023-01-27 19:53   ` Florian Fainelli
@ 2023-01-27 20:15     ` Colin Foster
  0 siblings, 0 replies; 34+ messages in thread
From: Colin Foster @ 2023-01-27 20:15 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, linux-kernel, devicetree, Russell King, Richard Cochran,
	Andrew Lunn, UNGLinuxDriver, Alexandre Belloni, Claudiu Manoil,
	Vladimir Oltean, Paolo Abeni, Jakub Kicinski, Eric Dumazet,
	David S. Miller, Krzysztof Kozlowski, Rob Herring, Lee Jones

On Fri, Jan 27, 2023 at 11:53:58AM -0800, Florian Fainelli wrote:
> 
> 
> On 1/27/2023 11:35 AM, Colin Foster wrote:
> > Utilize the existing ocelot MFD interface to add switch functionality to
> > the Microsemi VSC7512 chip.
> > 
> > Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
> > Acked-for-MFD-by: Lee Jones <lee@kernel.org>
> 
> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
> -- 
> Florian

Thanks for all the reviews today Florian!

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys
  2023-01-27 19:35 [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys Colin Foster
                   ` (12 preceding siblings ...)
  2023-01-27 19:35 ` [PATCH v5 net-next 13/13] mfd: " Colin Foster
@ 2023-01-30 15:31 ` Vladimir Oltean
  2023-01-31  5:20 ` patchwork-bot+netdevbpf
  14 siblings, 0 replies; 34+ messages in thread
From: Vladimir Oltean @ 2023-01-30 15:31 UTC (permalink / raw)
  To: Colin Foster
  Cc: netdev, linux-kernel, devicetree, Russell King, Richard Cochran,
	Florian Fainelli, Andrew Lunn, UNGLinuxDriver, Alexandre Belloni,
	Claudiu Manoil, Paolo Abeni, Jakub Kicinski, Eric Dumazet,
	David S. Miller, Krzysztof Kozlowski, Rob Herring, Lee Jones

On Fri, Jan 27, 2023 at 11:35:46AM -0800, Colin Foster wrote:
> This patch series is a continuation to add support for the VSC7512:
> https://patchwork.kernel.org/project/netdevbpf/list/?series=674168&state=*
> 
> That series added the framework and initial functionality for the
> VSC7512 chip. Several of these patches grew during the initial
> development of the framework, which is why v1 will include changelogs.
> It was during v9 of that original MFD patch set that these were dropped.
> 
> With that out of the way, the VSC7512 is mainly a subset of the VSC7514
> chip. The 7512 lacks an internal MIPS processor, but otherwise many of
> the register definitions are identical. That is why several of these
> patches are simply to expose common resources from
> drivers/net/ethernet/mscc/*.
> 
> This patch only adds support for the first four ports (swp0-swp3). The
> remaining ports require more significant changes to the felix driver,
> and will be handled in the future.

For the whole series:

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com> # regression

A minor nitpick after this is merged: please clean up and unexport stuff
from include/soc/mscc/vsc7514_regs.h which was added with your previous
approaches and then we steered mid-way.

Congratulations!

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v5 net-next 10/13] dt-bindings: net: mscc,vsc7514-switch: add dsa binding for the vsc7512
  2023-01-27 19:35 ` [PATCH v5 net-next 10/13] dt-bindings: net: mscc,vsc7514-switch: add dsa binding for the vsc7512 Colin Foster
@ 2023-01-30 21:10   ` Rob Herring
  0 siblings, 0 replies; 34+ messages in thread
From: Rob Herring @ 2023-01-30 21:10 UTC (permalink / raw)
  To: Colin Foster
  Cc: devicetree, linux-kernel, David S. Miller, Krzysztof Kozlowski,
	Andrew Lunn, Jakub Kicinski, Rob Herring, UNGLinuxDriver,
	Russell King, Alexandre Belloni, Claudiu Manoil, Eric Dumazet,
	Richard Cochran, Paolo Abeni, Florian Fainelli, Vladimir Oltean,
	netdev, Lee Jones


On Fri, 27 Jan 2023 11:35:56 -0800, Colin Foster wrote:
> The VSC7511, VSC7512, VSC7513 and VSC7514 all have the ability to be
> controlled either internally by a memory-mapped CPU, or externally via
> interfaces like SPI and PCIe. The internal CPU of the VSC7511 and 7512
> don't have the resources to run Linux, so must be controlled via these
> external interfaces in a DSA configuration.
> 
> Add mscc,vsc7512-switch compatible string to indicate that the chips are
> being controlled externally in a DSA configuration.
> 
> Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
> ---
> 
> v5
>     * New patch after a documentation overhaul series
> 
> ---
>  .../bindings/net/mscc,vsc7514-switch.yaml     | 113 ++++++++++++++----
>  1 file changed, 90 insertions(+), 23 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v5 net-next 11/13] dt-bindings: mfd: ocelot: add ethernet-switch hardware support
  2023-01-27 19:35 ` [PATCH v5 net-next 11/13] dt-bindings: mfd: ocelot: add ethernet-switch hardware support Colin Foster
@ 2023-01-30 21:10   ` Rob Herring
  0 siblings, 0 replies; 34+ messages in thread
From: Rob Herring @ 2023-01-30 21:10 UTC (permalink / raw)
  To: Colin Foster
  Cc: Florian Fainelli, Alexandre Belloni, linux-kernel, Paolo Abeni,
	Rob Herring, devicetree, Vladimir Oltean, Andrew Lunn, netdev,
	Eric Dumazet, Jakub Kicinski, Lee Jones, Claudiu Manoil,
	Richard Cochran, David S. Miller, UNGLinuxDriver,
	Krzysztof Kozlowski, Russell King


On Fri, 27 Jan 2023 11:35:57 -0800, Colin Foster wrote:
> The main purpose of the Ocelot chips are the Ethernet switching
> functionalities. Document the support for these features.
> 
> Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
> ---
> 
> v5
>     * Update ref to mscc,vsc7514-switch.yaml instead of
>       mscc.ocelot.yaml
>     * Add unevaluatedProperties: false
> 
> v4
>     * New patch
> 
> ---
>  Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys
  2023-01-27 19:35 [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys Colin Foster
                   ` (13 preceding siblings ...)
  2023-01-30 15:31 ` [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys Vladimir Oltean
@ 2023-01-31  5:20 ` patchwork-bot+netdevbpf
  2023-01-31  9:06   ` Lee Jones
  14 siblings, 1 reply; 34+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-01-31  5:20 UTC (permalink / raw)
  To: Colin Foster
  Cc: netdev, linux-kernel, devicetree, linux, richardcochran,
	f.fainelli, andrew, UNGLinuxDriver, alexandre.belloni,
	claudiu.manoil, vladimir.oltean, pabeni, kuba, edumazet, davem,
	krzysztof.kozlowski+dt, robh+dt, lee

Hello:

This series was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 27 Jan 2023 11:35:46 -0800 you wrote:
> This patch series is a continuation to add support for the VSC7512:
> https://patchwork.kernel.org/project/netdevbpf/list/?series=674168&state=*
> 
> That series added the framework and initial functionality for the
> VSC7512 chip. Several of these patches grew during the initial
> development of the framework, which is why v1 will include changelogs.
> It was during v9 of that original MFD patch set that these were dropped.
> 
> [...]

Here is the summary with links:
  - [v5,net-next,01/13] net: mscc: ocelot: expose ocelot wm functions
    https://git.kernel.org/netdev/net-next/c/c6a9321b0811
  - [v5,net-next,02/13] net: mscc: ocelot: expose regfield definition to be used by other drivers
    https://git.kernel.org/netdev/net-next/c/728d8019f1a3
  - [v5,net-next,03/13] net: mscc: ocelot: expose vcap_props structure
    https://git.kernel.org/netdev/net-next/c/beb9a74e0bf7
  - [v5,net-next,04/13] net: mscc: ocelot: expose ocelot_reset routine
    https://git.kernel.org/netdev/net-next/c/b67f5502136f
  - [v5,net-next,05/13] net: mscc: ocelot: expose vsc7514_regmap definition
    https://git.kernel.org/netdev/net-next/c/2efaca411c96
  - [v5,net-next,06/13] net: dsa: felix: add configurable device quirks
    https://git.kernel.org/netdev/net-next/c/1dc6a2a02320
  - [v5,net-next,07/13] net: dsa: felix: add support for MFD configurations
    https://git.kernel.org/netdev/net-next/c/dc454fa4b764
  - [v5,net-next,08/13] net: dsa: felix: add functionality when not all ports are supported
    https://git.kernel.org/netdev/net-next/c/de879a016a94
  - [v5,net-next,09/13] mfd: ocelot: prepend resource size macros to be 32-bit
    https://git.kernel.org/netdev/net-next/c/fde0b6ced8ed
  - [v5,net-next,10/13] dt-bindings: net: mscc,vsc7514-switch: add dsa binding for the vsc7512
    https://git.kernel.org/netdev/net-next/c/dd43f5e7684c
  - [v5,net-next,11/13] dt-bindings: mfd: ocelot: add ethernet-switch hardware support
    https://git.kernel.org/netdev/net-next/c/11fc80cbb225
  - [v5,net-next,12/13] net: dsa: ocelot: add external ocelot switch control
    https://git.kernel.org/netdev/net-next/c/3d7316ac81ac
  - [v5,net-next,13/13] mfd: ocelot: add external ocelot switch control
    https://git.kernel.org/netdev/net-next/c/8dccdd277e0b

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys
  2023-01-31  5:20 ` patchwork-bot+netdevbpf
@ 2023-01-31  9:06   ` Lee Jones
  2023-01-31 19:45     ` Jakub Kicinski
  0 siblings, 1 reply; 34+ messages in thread
From: Lee Jones @ 2023-01-31  9:06 UTC (permalink / raw)
  To: patchwork-bot+netdevbpf
  Cc: Colin Foster, netdev, linux-kernel, devicetree, linux,
	richardcochran, f.fainelli, andrew, UNGLinuxDriver,
	alexandre.belloni, claudiu.manoil, vladimir.oltean, pabeni, kuba,
	edumazet, davem, krzysztof.kozlowski+dt, robh+dt

On Tue, 31 Jan 2023, patchwork-bot+netdevbpf@kernel.org wrote:

> Hello:
> 
> This series was applied to netdev/net-next.git (master)
> by Jakub Kicinski <kuba@kernel.org>:

Please don't do that.  The commits do not have proper Acked-by tags.

The plan is to merge these via MFD and send out a pull-request to an
immutable branch.  However, if you're prepared to convert all of the:

  Acked-for-MFD-by: Lee Jones <lee@kernel.org>

to

  Acked-by: Lee Jones <lee@kernel.org>

... and send out a pull request to a succinct (only these patches) and
immutable branch then that is also an acceptable solution.

Please let me know what works best for you.

Thanks.

> > This patch series is a continuation to add support for the VSC7512:
> > https://patchwork.kernel.org/project/netdevbpf/list/?series=674168&state=*
> > 
> > That series added the framework and initial functionality for the
> > VSC7512 chip. Several of these patches grew during the initial
> > development of the framework, which is why v1 will include changelogs.
> > It was during v9 of that original MFD patch set that these were dropped.
> > 
> > [...]
> 
> Here is the summary with links:
>   - [v5,net-next,01/13] net: mscc: ocelot: expose ocelot wm functions
>     https://git.kernel.org/netdev/net-next/c/c6a9321b0811
>   - [v5,net-next,02/13] net: mscc: ocelot: expose regfield definition to be used by other drivers
>     https://git.kernel.org/netdev/net-next/c/728d8019f1a3
>   - [v5,net-next,03/13] net: mscc: ocelot: expose vcap_props structure
>     https://git.kernel.org/netdev/net-next/c/beb9a74e0bf7
>   - [v5,net-next,04/13] net: mscc: ocelot: expose ocelot_reset routine
>     https://git.kernel.org/netdev/net-next/c/b67f5502136f
>   - [v5,net-next,05/13] net: mscc: ocelot: expose vsc7514_regmap definition
>     https://git.kernel.org/netdev/net-next/c/2efaca411c96
>   - [v5,net-next,06/13] net: dsa: felix: add configurable device quirks
>     https://git.kernel.org/netdev/net-next/c/1dc6a2a02320
>   - [v5,net-next,07/13] net: dsa: felix: add support for MFD configurations
>     https://git.kernel.org/netdev/net-next/c/dc454fa4b764
>   - [v5,net-next,08/13] net: dsa: felix: add functionality when not all ports are supported
>     https://git.kernel.org/netdev/net-next/c/de879a016a94
>   - [v5,net-next,09/13] mfd: ocelot: prepend resource size macros to be 32-bit
>     https://git.kernel.org/netdev/net-next/c/fde0b6ced8ed
>   - [v5,net-next,10/13] dt-bindings: net: mscc,vsc7514-switch: add dsa binding for the vsc7512
>     https://git.kernel.org/netdev/net-next/c/dd43f5e7684c
>   - [v5,net-next,11/13] dt-bindings: mfd: ocelot: add ethernet-switch hardware support
>     https://git.kernel.org/netdev/net-next/c/11fc80cbb225
>   - [v5,net-next,12/13] net: dsa: ocelot: add external ocelot switch control
>     https://git.kernel.org/netdev/net-next/c/3d7316ac81ac
>   - [v5,net-next,13/13] mfd: ocelot: add external ocelot switch control
>     https://git.kernel.org/netdev/net-next/c/8dccdd277e0b
> 
> You are awesome, thank you!
> -- 
> Deet-doot-dot, I am a bot.
> https://korg.docs.kernel.org/patchwork/pwbot.html
> 
> 

-- 
Lee Jones [李琼斯]

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys
  2023-01-31  9:06   ` Lee Jones
@ 2023-01-31 19:45     ` Jakub Kicinski
  2023-01-31 19:55       ` Colin Foster
  2023-02-01 10:15       ` Lee Jones
  0 siblings, 2 replies; 34+ messages in thread
From: Jakub Kicinski @ 2023-01-31 19:45 UTC (permalink / raw)
  To: Lee Jones
  Cc: patchwork-bot+netdevbpf, Colin Foster, netdev, linux-kernel,
	devicetree, linux, richardcochran, f.fainelli, andrew,
	UNGLinuxDriver, alexandre.belloni, claudiu.manoil,
	vladimir.oltean, pabeni, edumazet, davem, krzysztof.kozlowski+dt,
	robh+dt

On Tue, 31 Jan 2023 09:06:22 +0000 Lee Jones wrote:
> Please don't do that.  The commits do not have proper Acked-by tags.
> 
> The plan is to merge these via MFD and send out a pull-request to an
> immutable branch.  However, if you're prepared to convert all of the:
> 
>   Acked-for-MFD-by: Lee Jones <lee@kernel.org>
> 
> to
> 
>   Acked-by: Lee Jones <lee@kernel.org>

Sorry, I must have been blind yesterday because I definitely double
checked this doesn't touch mfd code. And it does :/

The patches should not be sent for net-next if they are not supposed 
to be applied directly. Or at the very least says something about
merging in the cover letter!

> ... and send out a pull request to a succinct (only these patches) and
> immutable branch then that is also an acceptable solution.
> 
> Please let me know what works best for you.

Sorry for messing up again. Stable branch would obviously had been best.
Do we have to take action now, or can we just wait for the trees to
converge during the merge window?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys
  2023-01-31 19:45     ` Jakub Kicinski
@ 2023-01-31 19:55       ` Colin Foster
  2023-02-01 10:15       ` Lee Jones
  1 sibling, 0 replies; 34+ messages in thread
From: Colin Foster @ 2023-01-31 19:55 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Lee Jones, patchwork-bot+netdevbpf, netdev, linux-kernel,
	devicetree, linux, richardcochran, f.fainelli, andrew,
	UNGLinuxDriver, alexandre.belloni, claudiu.manoil,
	vladimir.oltean, pabeni, edumazet, davem, krzysztof.kozlowski+dt,
	robh+dt

On Tue, Jan 31, 2023 at 11:45:38AM -0800, Jakub Kicinski wrote:
> On Tue, 31 Jan 2023 09:06:22 +0000 Lee Jones wrote:
> > Please don't do that.  The commits do not have proper Acked-by tags.
> > 
> > The plan is to merge these via MFD and send out a pull-request to an
> > immutable branch.  However, if you're prepared to convert all of the:
> > 
> >   Acked-for-MFD-by: Lee Jones <lee@kernel.org>
> > 
> > to
> > 
> >   Acked-by: Lee Jones <lee@kernel.org>
> 
> Sorry, I must have been blind yesterday because I definitely double
> checked this doesn't touch mfd code. And it does :/
> 
> The patches should not be sent for net-next if they are not supposed 
> to be applied directly. Or at the very least says something about
> merging in the cover letter!

My apologies. I wasn't sure how these cross-tree syncs would be done
(and I recognize Lee even asked during a previous submission.) I'll be
more verbose in cover letters moving forward, should I ever be
submitting against multiple trees like this.


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys
  2023-01-31 19:45     ` Jakub Kicinski
  2023-01-31 19:55       ` Colin Foster
@ 2023-02-01 10:15       ` Lee Jones
  1 sibling, 0 replies; 34+ messages in thread
From: Lee Jones @ 2023-02-01 10:15 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: patchwork-bot+netdevbpf, Colin Foster, netdev, linux-kernel,
	devicetree, linux, richardcochran, f.fainelli, andrew,
	UNGLinuxDriver, alexandre.belloni, claudiu.manoil,
	vladimir.oltean, pabeni, edumazet, davem, krzysztof.kozlowski+dt,
	robh+dt

On Tue, 31 Jan 2023, Jakub Kicinski wrote:

> On Tue, 31 Jan 2023 09:06:22 +0000 Lee Jones wrote:
> > Please don't do that.  The commits do not have proper Acked-by tags.
> > 
> > The plan is to merge these via MFD and send out a pull-request to an
> > immutable branch.  However, if you're prepared to convert all of the:
> > 
> >   Acked-for-MFD-by: Lee Jones <lee@kernel.org>
> > 
> > to
> > 
> >   Acked-by: Lee Jones <lee@kernel.org>
> 
> Sorry, I must have been blind yesterday because I definitely double
> checked this doesn't touch mfd code. And it does :/
> 
> The patches should not be sent for net-next if they are not supposed 
> to be applied directly. Or at the very least says something about
> merging in the cover letter!
> 
> > ... and send out a pull request to a succinct (only these patches) and
> > immutable branch then that is also an acceptable solution.
> > 
> > Please let me know what works best for you.
> 
> Sorry for messing up again. Stable branch would obviously had been best.
> Do we have to take action now, or can we just wait for the trees to
> converge during the merge window?

Russell explained to me (off-list) that the net-next branch is immutable
and the only way to fix this would be to revert the whole set.

Let's not go to that much trouble this time.

It does mean that I cannot take any more commits on the affected files,
but that shouldn't be a big deal seeing how far into the release cycle
we are.

No real harm done.

-- 
Lee Jones [李琼斯]

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2023-02-01 10:15 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-27 19:35 [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys Colin Foster
2023-01-27 19:35 ` [PATCH v5 net-next 01/13] net: mscc: ocelot: expose ocelot wm functions Colin Foster
2023-01-27 19:37   ` Florian Fainelli
2023-01-27 19:35 ` [PATCH v5 net-next 02/13] net: mscc: ocelot: expose regfield definition to be used by other drivers Colin Foster
2023-01-27 19:38   ` Florian Fainelli
2023-01-27 19:35 ` [PATCH v5 net-next 03/13] net: mscc: ocelot: expose vcap_props structure Colin Foster
2023-01-27 19:38   ` Florian Fainelli
2023-01-27 19:35 ` [PATCH v5 net-next 04/13] net: mscc: ocelot: expose ocelot_reset routine Colin Foster
2023-01-27 19:38   ` Florian Fainelli
2023-01-27 19:35 ` [PATCH v5 net-next 05/13] net: mscc: ocelot: expose vsc7514_regmap definition Colin Foster
2023-01-27 19:39   ` Florian Fainelli
2023-01-27 19:35 ` [PATCH v5 net-next 06/13] net: dsa: felix: add configurable device quirks Colin Foster
2023-01-27 19:39   ` Florian Fainelli
2023-01-27 19:35 ` [PATCH v5 net-next 07/13] net: dsa: felix: add support for MFD configurations Colin Foster
2023-01-27 19:40   ` Florian Fainelli
2023-01-27 19:35 ` [PATCH v5 net-next 08/13] net: dsa: felix: add functionality when not all ports are supported Colin Foster
2023-01-27 19:41   ` Florian Fainelli
2023-01-27 19:35 ` [PATCH v5 net-next 09/13] mfd: ocelot: prepend resource size macros to be 32-bit Colin Foster
2023-01-27 19:41   ` Florian Fainelli
2023-01-27 19:35 ` [PATCH v5 net-next 10/13] dt-bindings: net: mscc,vsc7514-switch: add dsa binding for the vsc7512 Colin Foster
2023-01-30 21:10   ` Rob Herring
2023-01-27 19:35 ` [PATCH v5 net-next 11/13] dt-bindings: mfd: ocelot: add ethernet-switch hardware support Colin Foster
2023-01-30 21:10   ` Rob Herring
2023-01-27 19:35 ` [PATCH v5 net-next 12/13] net: dsa: ocelot: add external ocelot switch control Colin Foster
2023-01-27 19:53   ` Florian Fainelli
2023-01-27 19:35 ` [PATCH v5 net-next 13/13] mfd: " Colin Foster
2023-01-27 19:53   ` Florian Fainelli
2023-01-27 20:15     ` Colin Foster
2023-01-30 15:31 ` [PATCH v5 net-next 00/13] add support for the the vsc7512 internal copper phys Vladimir Oltean
2023-01-31  5:20 ` patchwork-bot+netdevbpf
2023-01-31  9:06   ` Lee Jones
2023-01-31 19:45     ` Jakub Kicinski
2023-01-31 19:55       ` Colin Foster
2023-02-01 10:15       ` Lee Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.