RE: [PATCH net-next 09/17] net: dsa: mv88e6xxx: Get Product ID when enabling RMU
From: Jagielski, Jedrzej
Date: Fri Jul 03 2026 - 09:50:24 EST
From: Luke Howard <lukeh@xxxxxxxx>
Sent: Friday, July 3, 2026 9:47 AM
>
>From: Andrew Lunn <andrew@xxxxxxx>
>
>When the RMU is enabled, it is recommended to get the product ID,
>which identifies the switch. This is used as a test that communication
>with the switch actually works and the RMU can be used. If successful,
>mark the RMU usable.
>
>This completes the general infrastructure to send a request and
>process the response.
>
>Co-developed: Mattias Forsblad <mattias.forsblad@xxxxxxxxx>
>Signed-off-by: Mattias Forsblad <mattias.forsblad@xxxxxxxxx>
>Signed-off-by: Andrew Lunn <andrew@xxxxxxx>
>Signed-off-by: Luke Howard <lukeh@xxxxxxxx>
>---
> drivers/net/dsa/mv88e6xxx/chip.h | 10 +++
> drivers/net/dsa/mv88e6xxx/rmu.c | 151 ++++++++++++++++++++++++++++++++++++++-
> drivers/net/dsa/mv88e6xxx/rmu.h | 11 +++
> 3 files changed, 170 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h
>index 940ae698659fc..07300c25cbd36 100644
>--- a/drivers/net/dsa/mv88e6xxx/chip.h
>+++ b/drivers/net/dsa/mv88e6xxx/chip.h
>@@ -346,6 +346,15 @@ struct mv88e6xxx_tcam {
> struct list_head entries;
> };
>
>+enum mv88e6xxx_rmu_state {
>+ MV88E6XXX_RMU_DISABLED = 0,
>+ MV88E6XXX_RMU_ENABLED = 1,
>+ /* Reserved: a future RMU-only mode (e.g. MV88E6XXX_RMU_ONLY_ENABLED)
>+ * may be added here to indicate a switch operating purely via RMU
>+ * without an MDIO bus.
>+ */
As from what i see it's not being extended within the series, can we drop
that comment and use simple bool enabled/disabled in the place of
mv88e6xxx_rmu_state?
or am I missing something and > 2 states are needed
...
>+ return dsa_inband_request(&chip->rmu_inband, skb,
>+ (edsa ? mv88e6xxx_rmu_fill_seqno_edsa :
>+ mv88e6xxx_rmu_fill_seqno_dsa),
>+ resp, resp_len, timeout_ms);
>+}
>+
>+static int mv88e6xxx_rmu_get_id(struct mv88e6xxx_chip *chip)
>+{
>+ const __be16 req[4] = {
>+ MV88E6XXX_RMU_REQ_FORMAT_GET_ID,
>+ MV88E6XXX_RMU_REQ_PAD,
>+ MV88E6XXX_RMU_REQ_CODE_GET_ID,
>+ MV88E6XXX_RMU_REQ_DATA};
>+ struct mv88e6xxx_rmu_header resp;
>+ int resp_len;
>+ int ret = -1;
no need to init
>+
>+ resp_len = sizeof(resp);
>+ ret = mv88e6xxx_rmu_request(chip, req, sizeof(req),