From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC0BB35CB73 for ; Tue, 13 Jan 2026 14:13:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768313613; cv=none; b=iyGfgyZYEb8POn/IgdHw2ZVrDfs4Zw4qTKHnZP6eMr+Z/++mf5AT3XgTrERf0MB7J8Nnx2HdGWdkWO1vUe8LwHz7ncMVZI8iYDXyzoRqW1so/GYb/BeNaaJQPzKxywhrVngTgRZh/1Xr2x/BZLYgc/cp9rYVK0NO4yUmVqHTR3w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768313613; c=relaxed/simple; bh=ixwvhtBEkBoDvp5N4KEkKF182ppMydq9tQFQtSsQMTM=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=k8C0kDOcNgEYSninyLepBQtUtmS1tJpWZlh4r7hig3BF5atxIfv4lWcxvaQseCNBUsUEMWuYlHUBlKOHemQyFQFutUpPGutUZ9EuCALFZoEP8LwGw4M6HGejtDeMzOqdj1OXrUm3ycufYcnpJvRJGV7p7x8NbXqDNlhP0A1Z3uQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=dAP2Pc6s; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dAP2Pc6s" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-47d3ffa6720so70117275e9.0 for ; Tue, 13 Jan 2026 06:13:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1768313610; x=1768918410; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=EpPYFuBpeHzrlOUi6OsVjYU9ydxR9fDDFonQuw5LFlU=; b=dAP2Pc6sTNDk+xB8Fx9CPJZ5LqG1aueLBOMwUKZ+EMH2PEyy6FgLyqfSsA6v6gamPt 5EU7j3ls8TmXWIT3L0/vblU/e4t4H4BDYcpntOMVaTnJgC31oy8J5oNefpeM/XEpzKws s4VqjitoshTyQz6xTXbHwLbDjsJR10RO6crpPQMwgnAtz9Mz4bgbDZMBn9nsSZgwEeUC h4HuSA5MLSvaXx65Aq81jvGngvUHqbwB1x862xQKXbWIx1TMm7KqWf9zUFK88fR2MUlF O7kAkvYZx9ktKXZ6YaxkrtShA7/2+OQ415VEQT/eYCSGgEEBPYgYPxtI0+8eOQ5gkvqr U56Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768313610; x=1768918410; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EpPYFuBpeHzrlOUi6OsVjYU9ydxR9fDDFonQuw5LFlU=; b=sBYEsoRBdR6JGozYPruG87dXuTb7d6obNJUG2d6x/e4vxLcOseYNb2tgn9W65PF5rv hzai1fJFwlFju0M5Pi0tz7Xl5tjHYVJDH0kIPVWN4py2yG2wUGMHsT+L6IfCnh+DaLPP jjORbegEA41qhixvfZy7tvaLV6840jZgTvaA1nfjk7eVlfkxy3dL43dJ+jpSo7fQxE+a xHOX6kVYNI5aAYdkwZGjUtz/WglBlVRwKlK/Y4Dd4DAe20sKyKCl43wzbuODthT7BpC5 du2NO3uRZP4RRvUfG+qVexHBK6jU7fFiZ9LeXbk2GI0HTSokmKlYdBgr70JTMuC27AfM 1imA== X-Forwarded-Encrypted: i=1; AJvYcCXtIWu+bw5zlBHzQRA049Fsomhzuz1l5vMNVQpuG6VBo23wCoGiMHNUA47IXGSbYM3ORGoT5DzEqJOq378=@vger.kernel.org X-Gm-Message-State: AOJu0YxdB8+4AWU8kgwq1uxZyzjRrGAIdx9UVnxB3qiQlJGnggwqQMm/ nUYQcntrquFZcSFeZqYCuCJkVc/DudaSUHRoKng5f3MmffRhYgfMKb9IiHnlqiUFNiI= X-Gm-Gg: AY/fxX5vXcRl3hFy3NlzUBElhw7DeIeY0imGcnGNx49nRtOZ/4Wu7yGjdppeb0RDM1s lHdrtCksQqj3Xg/Xgmpgt73PLxGRVFBCnaiznWWzSfHWfRPZhWTOQHRtGJJMarx5w1IsQ+c4D89 oqqLmhLArsPVxnW5SgDmMOflYbKfrR4TdE4PUqdXCw7z1YnUaSCI0Scpyk8BaTWOnN5b/4N7+pA r4r4nuA/i4WJxQVu6CjIKMjRFJtmbWG83dTXdIW8qExqIQkedjyYqr3BNCrhPGySlLAR5Pffbj8 10KMdMGtnAH6xpZeC1cH897TXIZv5wkYlWDiMdu16RI9zIlg/joh3Kkr3UbagCMdyIhBsEdsRE0 Mc/IKTIdpI9ZOVcYrXwl7VpKfBP3HPxbjICWjyd3nBUvUAVXg0F5dJQQodUHni1e7I4iXq2GmAf WYyx21EpDf2A5zF4WnnCHrT9CN1js= X-Google-Smtp-Source: AGHT+IESteNDhCsp9djoyMeUvPvQ33cMYgxEEj70wmWesi8MDh/SKjav/Vxq6pmgAEpoaSXmrBuSJw== X-Received: by 2002:a05:600c:1392:b0:46e:37fe:f0e6 with SMTP id 5b1f17b1804b1-47d84b3b724mr277918305e9.30.1768313610033; Tue, 13 Jan 2026 06:13:30 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47ee0b45b8fsm1590895e9.4.2026.01.13.06.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jan 2026 06:13:29 -0800 (PST) Date: Tue, 13 Jan 2026 17:13:23 +0300 From: Dan Carpenter To: Chester Lin , Frank Li Cc: Alexandre Torgue , Andrew Lunn , Conor Dooley , "David S. Miller" , devicetree@vger.kernel.org, Eric Dumazet , Fabio Estevam , Ghennadi Procopciuc , imx@lists.linux.dev, Jakub Kicinski , Jan Petrous , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Matthias Brugger , Maxime Coquelin , netdev@vger.kernel.org, NXP S32 Linux Team , Paolo Abeni , Pengutronix Kernel Team , Rob Herring , Sascha Hauer , Shawn Guo , linaro-s32@linaro.org Subject: [PATCH v3 0/3] s32g: Use a syscon for GPR Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Frank has pushed back on this a bit. I think he objects to how stmmac/dwmac-s32.c controlls the PHY by writing to a register instead of through a driver. Creating a syscon driver will make writing to other drivers even easier. In the end, we're going to need to write to register eventually whether it's directly or through an abstraction layer. I feel like this is a good change and when we start dealing with SCMI then it's an essential change. I have fixed Krzysztof's complaint about the poor documentation in the nxp,s32-dwmac.yaml file. The s32g devices have a GPR register region which holds a number of miscellaneous registers. Currently only the stmmac/dwmac-s32.c uses anything from there and we just add a line to the device tree to access that GMAC_0_CTRL_STS register: reg = <0x4033c000 0x2000>, /* gmac IP */ <0x4007c004 0x4>; /* GMAC_0_CTRL_STS */ I have included the whole list of registers below. We still have to maintain backwards compatibility to this format, of course, but it would be better to access these registers through a syscon. Putting all the registers together is more organized and shows how the hardware actually is implemented. Secondly, in some versions of this chipset those registers can only be accessed via SCMI. It's relatively straight forward to handle this by writing a syscon driver and registering it with of_syscon_register_regmap() but it's complicated to deal with if the registers aren't grouped together. Changed since v2: * Improve the documentation in .../bindings/net/nxp,s32-dwmac.yaml * "[PATCH v2 2/4] dt-bindings: mfd: syscon: Document the GPR syscon for the NXP S32 SoCs" was applied so drop it. Changed since v1: * Add imx@lists.linux.dev to the CC list. * Fix forward porting bug. s/PHY_INTF_SEL_RGMII/S32_PHY_INTF_SEL_RGMII/ * Use the correct SoC names nxp,s32g2-gpr and nxp,s32g3-gpr instead of nxp,s32g-gpr which is the SoC family. * Fix the phandle name by adding the vendor prefix * Fix the documentation for the phandle * Remove #address-cells and #size-cells from the syscon block Here is the whole list of registers in the GPR region Starting from 0x4007C000 0 Software-Triggered Faults (SW_NCF) 4 GMAC Control (GMAC_0_CTRL_STS) 28 CMU Status 1 (CMU_STATUS_REG1) 2C CMUs Status 2 (CMU_STATUS_REG2) 30 FCCU EOUT Override Clear (FCCU_EOUT_OVERRIDE_CLEAR_REG) 38 SRC POR Control (SRC_POR_CTRL_REG) 54 GPR21 (GPR21) 5C GPR23 (GPR23) 60 GPR24 Register (GPR24) CC Debug Control (DEBUG_CONTROL) F0 Timestamp Control (TIMESTAMP_CONTROL_REGISTER) F4 FlexRay OS Tick Input Select (FLEXRAY_OS_TICK_INPUT_SELECT_REG) FC GPR63 Register (GPR63) Starting from 0x4007CA00 0 Coherency Enable for PFE Ports (PFE_COH_EN) 4 PFE EMAC Interface Mode (PFE_EMACX_INTF_SEL) 20 PFE EMACX Power Control (PFE_PWR_CTRL) 28 Error Injection on Cortex-M7 AHB and AXI Pipe (CM7_TCM_AHB_SLICE) 2C Error Injection AHBP Gasket Cortex-M7 (ERROR_INJECTION_AHBP_GASKET_CM7) 40 LLCE Subsystem Status (LLCE_STAT) 44 LLCE Power Control (LLCE_CTRL) 48 DDR Urgent Control (DDR_URGENT_CTRL) 4C FTM Global Load Control (FLXTIM_CTRL) 50 FTM LDOK Status (FLXTIM_STAT) 54 Top CMU Status (CMU_STAT) 58 Accelerator NoC No Pending Trans Status (NOC_NOPEND_TRANS) 90 SerDes RD/WD Toggle Control (PCIE_TOGGLE) 94 SerDes Toggle Done Status (PCIE_TOGGLEDONE_STAT) E0 Generic Control 0 (GENCTRL0) E4 Generic Control 1 (GENCTRL1) F0 Generic Status 0 (GENSTAT0) FC Cortex-M7 AXI Parity Error and AHBP Gasket Error Alarm (CM7_AXI_AHBP_GASKET_ERROR_ALARM) Starting from 4007C800 4 GPR01 Register (GPR01) 30 GPR12 Register (GPR12) 58 GPR22 Register (GPR22) 70 GPR28 Register (GPR28) 74 GPR29 Register (GPR29) Starting from 4007CB00 4 WKUP Pad Pullup/Pulldown Select (WKUP_PUS) Dan Carpenter (3): net: stmmac: s32: use a syscon for S32_PHY_INTF_SEL_RGMII dt-bindings: net: nxp,s32-dwmac: Use the GPR syscon dts: s32g: Add GPR syscon region .../bindings/net/nxp,s32-dwmac.yaml | 12 ++++++++++ arch/arm64/boot/dts/freescale/s32g2.dtsi | 6 +++++ arch/arm64/boot/dts/freescale/s32g3.dtsi | 6 +++++ .../net/ethernet/stmicro/stmmac/dwmac-s32.c | 23 +++++++++++++++---- 4 files changed, 42 insertions(+), 5 deletions(-) -- 2.51.0