[PATCH net-next 1/4] net: lan969x: add the core PLL registers

Daniel Machon daniel.machon at microchip.com
Fri Nov 13 02:19:40 PST 2026


Add the CHIP_TOP registers required to configure the lan969x core PLL,
and map the CHIP_TOP target. They are used in a later patch of this
series.

Signed-off-by: Daniel Machon <daniel.machon at microchip.com>
---
 .../ethernet/microchip/sparx5/lan969x/lan969x.c    |  1 +
 .../ethernet/microchip/sparx5/sparx5_main_regs.h   | 82 ++++++++++++++++++++++
 2 files changed, 83 insertions(+)

diff --git a/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.c b/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.c
index c02499d1b297a..df211e608056a 100644
--- a/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.c
+++ b/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.c
@@ -13,6 +13,7 @@ static const struct sparx5_main_io_resource lan969x_main_iomap[] =  {
 	{ TARGET_CPU,                   0xc0000, 0 }, /* 0xe00c0000 */
 	{ TARGET_FDMA,                  0xc0400, 0 }, /* 0xe00c0400 */
 	{ TARGET_GCB,                 0x2010000, 1 }, /* 0xe2010000 */
+	{ TARGET_CHIP_TOP,            0x2020000, 1 }, /* 0xe2020000 */
 	{ TARGET_QS,                  0x2030000, 1 }, /* 0xe2030000 */
 	{ TARGET_PTP,                 0x2040000, 1 }, /* 0xe2040000 */
 	{ TARGET_ANA_ACL,             0x2050000, 1 }, /* 0xe2050000 */
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main_regs.h b/drivers/net/ethernet/microchip/sparx5/sparx5_main_regs.h
index 1bf7dabf622e6..071d2f013a195 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_main_regs.h
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main_regs.h
@@ -26,6 +26,7 @@ enum sparx5_target {
 	TARGET_ANA_L2 = 7,
 	TARGET_ANA_L3 = 8,
 	TARGET_ASM = 9,
+	TARGET_CHIP_TOP = 10,
 	TARGET_CLKGEN = 11,
 	TARGET_CPU = 12,
 	TARGET_DEV10G = 17,
@@ -2636,6 +2637,87 @@ extern const struct sparx5_regs *regs;
 #define ASM_RAM_INIT_RAM_CFG_HOOK_GET(x)\
 	FIELD_GET(ASM_RAM_INIT_RAM_CFG_HOOK, x)
 
+/* LAN969X ONLY */
+/* CHIP_TOP:HW_STAT:HW_STAT */
+#define CHIP_TOP_HW_STAT                                                       \
+	__REG(TARGET_CHIP_TOP, 0, 1, 92, 0, 1, 4, 0, 0, 1, 4)
+
+#define CHIP_TOP_HW_STAT_REFCLK_SEL              BIT(1)
+#define CHIP_TOP_HW_STAT_REFCLK_SEL_SET(x)\
+	FIELD_PREP(CHIP_TOP_HW_STAT_REFCLK_SEL, x)
+#define CHIP_TOP_HW_STAT_REFCLK_SEL_GET(x)\
+	FIELD_GET(CHIP_TOP_HW_STAT_REFCLK_SEL, x)
+
+/* LAN969X ONLY */
+/* CHIP_TOP:CORE_PLL_CFG:CORE_PLL_CFG */
+#define CHIP_TOP_CORE_PLL_CFG                                                  \
+	__REG(TARGET_CHIP_TOP, 0, 1, 212, 0, 1, 8, 0, 0, 1, 4)
+
+#define CHIP_TOP_CORE_PLL_CFG_REF_CLK_SEL        GENMASK(29, 28)
+#define CHIP_TOP_CORE_PLL_CFG_REF_CLK_SEL_SET(x)\
+	FIELD_PREP(CHIP_TOP_CORE_PLL_CFG_REF_CLK_SEL, x)
+#define CHIP_TOP_CORE_PLL_CFG_REF_CLK_SEL_GET(x)\
+	FIELD_GET(CHIP_TOP_CORE_PLL_CFG_REF_CLK_SEL, x)
+
+#define CHIP_TOP_CORE_PLL_CFG_DIVACK             BIT(27)
+#define CHIP_TOP_CORE_PLL_CFG_DIVACK_SET(x)\
+	FIELD_PREP(CHIP_TOP_CORE_PLL_CFG_DIVACK, x)
+#define CHIP_TOP_CORE_PLL_CFG_DIVACK_GET(x)\
+	FIELD_GET(CHIP_TOP_CORE_PLL_CFG_DIVACK, x)
+
+#define CHIP_TOP_CORE_PLL_CFG_NEWDIV             BIT(26)
+#define CHIP_TOP_CORE_PLL_CFG_NEWDIV_SET(x)\
+	FIELD_PREP(CHIP_TOP_CORE_PLL_CFG_NEWDIV, x)
+#define CHIP_TOP_CORE_PLL_CFG_NEWDIV_GET(x)\
+	FIELD_GET(CHIP_TOP_CORE_PLL_CFG_NEWDIV, x)
+
+#define CHIP_TOP_CORE_PLL_CFG_FILTER_RANGE       GENMASK(25, 23)
+#define CHIP_TOP_CORE_PLL_CFG_FILTER_RANGE_SET(x)\
+	FIELD_PREP(CHIP_TOP_CORE_PLL_CFG_FILTER_RANGE, x)
+#define CHIP_TOP_CORE_PLL_CFG_FILTER_RANGE_GET(x)\
+	FIELD_GET(CHIP_TOP_CORE_PLL_CFG_FILTER_RANGE, x)
+
+#define CHIP_TOP_CORE_PLL_CFG_DIVQ               GENMASK(22, 8)
+#define CHIP_TOP_CORE_PLL_CFG_DIVQ_SET(x)\
+	FIELD_PREP(CHIP_TOP_CORE_PLL_CFG_DIVQ, x)
+#define CHIP_TOP_CORE_PLL_CFG_DIVQ_GET(x)\
+	FIELD_GET(CHIP_TOP_CORE_PLL_CFG_DIVQ, x)
+
+#define CHIP_TOP_CORE_PLL_CFG_DIVR               GENMASK(7, 2)
+#define CHIP_TOP_CORE_PLL_CFG_DIVR_SET(x)\
+	FIELD_PREP(CHIP_TOP_CORE_PLL_CFG_DIVR, x)
+#define CHIP_TOP_CORE_PLL_CFG_DIVR_GET(x)\
+	FIELD_GET(CHIP_TOP_CORE_PLL_CFG_DIVR, x)
+
+#define CHIP_TOP_CORE_PLL_CFG_ENA_CFG            BIT(1)
+#define CHIP_TOP_CORE_PLL_CFG_ENA_CFG_SET(x)\
+	FIELD_PREP(CHIP_TOP_CORE_PLL_CFG_ENA_CFG, x)
+#define CHIP_TOP_CORE_PLL_CFG_ENA_CFG_GET(x)\
+	FIELD_GET(CHIP_TOP_CORE_PLL_CFG_ENA_CFG, x)
+
+#define CHIP_TOP_CORE_PLL_CFG_LOCK_STAT          BIT(0)
+#define CHIP_TOP_CORE_PLL_CFG_LOCK_STAT_SET(x)\
+	FIELD_PREP(CHIP_TOP_CORE_PLL_CFG_LOCK_STAT, x)
+#define CHIP_TOP_CORE_PLL_CFG_LOCK_STAT_GET(x)\
+	FIELD_GET(CHIP_TOP_CORE_PLL_CFG_LOCK_STAT, x)
+
+/* LAN969X ONLY */
+/* CHIP_TOP:CORE_PLL_CFG:CORE_PLL_FREQ_CFG */
+#define CHIP_TOP_CORE_PLL_FREQ_CFG                                             \
+	__REG(TARGET_CHIP_TOP, 0, 1, 212, 0, 1, 8, 4, 0, 1, 4)
+
+#define CHIP_TOP_CORE_PLL_FREQ_CFG_DIVFI         GENMASK(30, 24)
+#define CHIP_TOP_CORE_PLL_FREQ_CFG_DIVFI_SET(x)\
+	FIELD_PREP(CHIP_TOP_CORE_PLL_FREQ_CFG_DIVFI, x)
+#define CHIP_TOP_CORE_PLL_FREQ_CFG_DIVFI_GET(x)\
+	FIELD_GET(CHIP_TOP_CORE_PLL_FREQ_CFG_DIVFI, x)
+
+#define CHIP_TOP_CORE_PLL_FREQ_CFG_DIVFF         GENMASK(23, 0)
+#define CHIP_TOP_CORE_PLL_FREQ_CFG_DIVFF_SET(x)\
+	FIELD_PREP(CHIP_TOP_CORE_PLL_FREQ_CFG_DIVFF, x)
+#define CHIP_TOP_CORE_PLL_FREQ_CFG_DIVFF_GET(x)\
+	FIELD_GET(CHIP_TOP_CORE_PLL_FREQ_CFG_DIVFF, x)
+
 /* SPARX5 ONLY */
 /* CLKGEN:LCPLL1:LCPLL1_CORE_CLK_CFG */
 #define CLKGEN_LCPLL1_CORE_CLK_CFG                                             \

-- 
2.34.1




More information about the linux-arm-kernel mailing list