Re: [PATCH v2 1/7] net: dsa: b53: Add BroadSync HD register definitions

From: Martin Kaistra
Date: Wed Nov 10 2021 - 03:19:09 EST


Am 09.11.21 um 19:04 schrieb Florian Fainelli:
On 11/9/21 1:50 AM, Martin Kaistra wrote:
From: Kurt Kanzenbach <kurt@xxxxxxxxxxxxx>

Add register definitions for the BroadSync HD features of
BCM53128. These will be used to enable PTP support.

Signed-off-by: Kurt Kanzenbach <kurt@xxxxxxxxxxxxx>
Signed-off-by: Martin Kaistra <martin.kaistra@xxxxxxxxxxxxx>
---

[snip]

+/*************************************************************************
+ * ARL Control Registers
+ *************************************************************************/
+
+/* Multiport Control Register (16 bit) */
+#define B53_MPORT_CTRL 0x0e
+#define MPORT_CTRL_DIS_FORWARD 0
+#define MPORT_CTRL_CMP_ETYPE 1
+#define MPORT_CTRL_CMP_ADDR 2
+#define MPORT_CTRL_CMP_ADDR_ETYPE 3
+#define MPORT_CTRL_SHIFT(x) ((x) << 1)
+#define MPORT_CTRL_MASK 0x2

The mask should be 0x3 since this is a 2-bit wide field.


Correct, thanks.
Currently, this mask is not used, as I am just writing
MPORT0_TS_EN |
(MPORT_CTRL_CMP_ETYPE << MPORT_CTRL_SHIFT(0))
to the register. Should I keep the definition anyway?