[PATCH v2 5/7] net: stmmac: dwmac-sun55i: Enable optional MSI-Lite0 clocks on A733

Alastair D'Silva alastair at d-silva.org
Sun Nov 29 17:30:00 PST 2026


Enable the optional ahb-msi-lite0 and mbus-msi-lite0 bus fabric clocks
when provided in the A733 GMAC210 device tree node so the shared
MSI-Lite0 fabric remains clocked during clk_disable_unused() without
marking the gates CLK_IS_CRITICAL in the CCU driver.

Assisted-by: LLM
Signed-off-by: Alastair D'Silva <alastair at d-silva.org>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-sun55i.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun55i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun55i.c
index e311d5fccfbb..648e2f9a1b0d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun55i.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun55i.c
@@ -11,6 +11,7 @@
 
 #include <linux/bitfield.h>
 #include <linux/bits.h>
+#include <linux/clk.h>
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of.h>
@@ -77,10 +78,23 @@ static const struct regmap_config sun60i_a733_regmap_cfg = {
 static int sun60i_gmac210_init_resources(struct platform_device *pdev,
 					 struct sun55i_gmac *gmac)
 {
+	static const char * const msi_clks[] = {
+		"ahb-msi-lite0",
+		"mbus-msi-lite0",
+	};
 	struct device *dev = &pdev->dev;
 	struct reset_control *ahb_reset;
 	void __iomem *base;
 
+	for (unsigned int i = 0; i < ARRAY_SIZE(msi_clks); i++) {
+		struct clk *clk = devm_clk_get_optional_enabled(dev, msi_clks[i]);
+
+		if (IS_ERR(clk))
+			return dev_err_probe(dev, PTR_ERR(clk),
+					     "Failed to enable %s clock\n",
+					     msi_clks[i]);
+	}
+
 	/*
 	 * Get the configuration region out of reset before changing it.
 	 * stmmac core holds the same shared reset but only deasserts it later.
-- 
2.53.0




More information about the linux-arm-kernel mailing list