linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Sasha Levin <sashal@kernel.org>,
	samuel@sholland.org, linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev
Subject: [PATCH AUTOSEL 6.17-6.12] soc: sunxi: sram: add entry for a523
Date: Thu,  9 Oct 2025 11:54:37 -0400	[thread overview]
Message-ID: <20251009155752.773732-11-sashal@kernel.org> (raw)
In-Reply-To: <20251009155752.773732-1-sashal@kernel.org>

From: Chen-Yu Tsai <wens@csie.org>

[ Upstream commit 30849ab484f7397c9902082c7567ca4cd4eb03d3 ]

The A523 has two Ethernet controllers. So in the system controller
address space, there are two registers for Ethernet clock delays,
one for each controller.

Add a new entry for the A523 system controller that allows access to
the second register.

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://patch.msgid.link/20250908181059.1785605-4-wens@kernel.org
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

YES – this should go to stable; without it the second GMAC on A523
cannot program its clock-delay register.

- The A523 DT already instantiates the system-control syscon with an
  A523-specific compatible and wires GMAC0 (with GMAC1 expected next) to
  that syscon (`arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi:423` and
  `arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi:543`). Because the
  current driver falls back to the A64 variant,
  `sunxi_sram_regmap_accessible_reg()` only exposes a single EMAC clock
  register (`drivers/soc/sunxi/sunxi_sram.c:325`), so any attempt to use
  the second EMAC clock register at 0x34 is blocked, which makes the
  second Ethernet controller unusable on this SoC.
- The patch adds a dedicated A523 variant with `.num_emac_clocks = 2`
  and wires it into the OF match table
  (`drivers/soc/sunxi/sunxi_sram.c:313` and
  `drivers/soc/sunxi/sunxi_sram.c:438` after the change). This is the
  minimal change required to expose the second register; no other SoCs
  are affected and no behaviour changes for existing users.
- Risk is very low: the change only enlarges the allowed register window
  for the A523 system controller and mirrors the existing H616 handling.
  Without it, backporting forthcoming GMAC1 enablement (or any
  downstream board DT that already uses it) will continue to fail, so
  carrying this fix in stable keeps A523 Ethernet support from
  regressing.

Next step if you pick it up: merge alongside the GMAC1 enablement so the
second port works end-to-end.

 drivers/soc/sunxi/sunxi_sram.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c
index 2781a091a6a64..16144a0a0d371 100644
--- a/drivers/soc/sunxi/sunxi_sram.c
+++ b/drivers/soc/sunxi/sunxi_sram.c
@@ -310,6 +310,10 @@ static const struct sunxi_sramc_variant sun50i_h616_sramc_variant = {
 	.has_ths_offset = true,
 };
 
+static const struct sunxi_sramc_variant sun55i_a523_sramc_variant = {
+	.num_emac_clocks = 2,
+};
+
 #define SUNXI_SRAM_THS_OFFSET_REG	0x0
 #define SUNXI_SRAM_EMAC_CLOCK_REG	0x30
 #define SUNXI_SYS_LDO_CTRL_REG		0x150
@@ -430,6 +434,10 @@ static const struct of_device_id sunxi_sram_dt_match[] = {
 		.compatible = "allwinner,sun50i-h616-system-control",
 		.data = &sun50i_h616_sramc_variant,
 	},
+	{
+		.compatible = "allwinner,sun55i-a523-system-control",
+		.data = &sun55i_a523_sramc_variant,
+	},
 	{ },
 };
 MODULE_DEVICE_TABLE(of, sunxi_sram_dt_match);
-- 
2.51.0



  parent reply	other threads:[~2025-10-09 15:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20251009155752.773732-1-sashal@kernel.org>
2025-10-09 15:54 ` [PATCH AUTOSEL 6.17-6.12] soc: apple: mailbox: Add Apple A11 and T2 mailbox support Sasha Levin
2025-10-10  2:22   ` Nick Chan
2025-11-04  0:22     ` Sasha Levin
2025-10-09 15:54 ` Sasha Levin [this message]
2025-10-09 16:38   ` [PATCH AUTOSEL 6.17-6.12] soc: sunxi: sram: add entry for a523 Andre Przywara
2025-11-04  0:22     ` Sasha Levin
2025-10-09 15:54 ` [PATCH AUTOSEL 6.17-5.10] pinctrl: single: fix bias pull up/down handling in pin_config_set Sasha Levin
2025-10-09 15:54 ` [PATCH AUTOSEL 6.17-6.16] soc: ti: k3-socinfo: Add information for AM62L SR1.1 Sasha Levin
2025-10-09 15:55 ` [PATCH AUTOSEL 6.17] mfd: macsmc: Add "apple,t8103-smc" compatible Sasha Levin
2025-10-09 15:55 ` [PATCH AUTOSEL 6.17-5.4] mfd: stmpe: Remove IRQ domain upon removal Sasha Levin
2025-10-09 15:55 ` [PATCH AUTOSEL 6.17-5.4] cpufreq/longhaul: handle NULL policy in longhaul_exit Sasha Levin
2025-10-09 15:55 ` [PATCH AUTOSEL 6.17-6.16] firmware: ti_sci: Enable abort handling of entry to LPM Sasha Levin
2025-10-09 15:55 ` [PATCH AUTOSEL 6.17-5.15] soc: aspeed: socinfo: Add AST27xx silicon IDs Sasha Levin
2025-10-09 15:55 ` [PATCH AUTOSEL 6.17-6.6] arm64: zynqmp: Revert usb node drive strength and slew rate for zcu106 Sasha Levin
2025-10-09 15:55 ` [PATCH AUTOSEL 6.17-6.12] arm64: zynqmp: Disable coresight by default Sasha Levin
2025-10-09 15:55 ` [PATCH AUTOSEL 6.17-6.6] pmdomain: apple: Add "apple,t8103-pmgr-pwrstate" Sasha Levin
2025-10-09 15:56 ` [PATCH AUTOSEL 6.17-6.16] arm64: versal-net: Update rtc calibration value Sasha Levin
2025-10-09 15:56 ` [PATCH AUTOSEL 6.17-5.10] soc: ti: pruss: don't use %pK through printk Sasha Levin
2025-10-09 15:56 ` [PATCH AUTOSEL 6.17-5.4] mfd: stmpe-i2c: Add missing MODULE_LICENSE Sasha Levin
2025-10-09 15:56 ` [PATCH AUTOSEL 6.17-5.4] irqchip/gic-v2m: Handle Multiple MSI base IRQ Alignment Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251009155752.773732-11-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=patches@lists.linux.dev \
    --cc=samuel@sholland.org \
    --cc=stable@vger.kernel.org \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).