From nobody Tue Nov 24 11:35:54 2026 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795459282; b=ShPE9gS+R6KeF4F9gbQdwcWs+UD2RUxf3LyUoRVrHEMoDpMBfCOLHRaV0IBGEZHhCD6U 5J4uOK74rJR5M8BiA8EMlh5QGUI5dZcn/k+6SV8F7NMBoKn2GjxRcDjyCgDzZlEJBgKZt y2cilPMFkYrWP/J4xyLaoTE0iXE3JK8gnhZYg6AJqe9H9tFKwiYDLdhyDWCsRfpoQfl/f kbViUtNcewdquqr4zlWFe3/57w5P1NyLDER3GCl01CJZJo7P9RypMWmzZ6oMLYR2gAP1Z SpMb4knIwxpza+9OMZsImOdEF35DOLpXq82uHLb6REKRNIdvxfswq0jKB66TAMs8pxQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795459282; h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=etweggmvewghqZeCOi7wUZ9wIdIXkNXXNOxh61ejO+Q=; b=QGfGmtI96mGwZdOT3kVEaWmB3X07qmL4Y6BNkAkKAwnXLumx+/opQJk+ee562No0fsxn 4d+hjaF3E1o6bqMWBHHGa820FxHGFdhndMpgKdeeAJ4UqF9OBigWKyEUJZQAUF+x2fF1a OBwUyuAE/ZrzjttYifxOfeaxHeMxSk8+DW9wtxF2HgUOv++G55ymP/jX3XUnaHbzqD0Gu Xhk1UhshDtkFXa9SwYSQ8fEht9kRsdei/L+S7th3OZBUv/DZWQk+G6dUMHAcWNq6W3CW+ hsCaLdsF7JvzRVhTNbHVzsE5lsHI9QtE2n8jUwVt6oebzfZ9+fTNdOK57NrgaKewNQg== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=LqanlPaV; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 921CD606A31F; Mon, 23 Nov 2026 18:41:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=LqanlPaV Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1795459282; b=V5m9pbVMVm72Nlidenx8lzySdZYL8J5iRz0ttsop3pTmuzyNmQQyzcSDy3kZSw10eF1g fAw1AEB6/wD6xgugdXos5yO00heCZyzFDTedJpls6HSyLii8aukAFasNdo6gfKGMUmC7X AijCWuHw8jfM99OFW/we8ukfUhKv5ENL/pCWmX7MBpryrQ6NyYk5BZEGP7WtrNjam2hcS KLdWn7Toby0HLNrI6Ba5tRJahVDVDy20MDSMIAPEbdnpQOAj8GvtRz98scbd4uzga1bV4 U+0MQ9LxykUp1xOOPQtlgTNyklLW3MAB4lL7rfC90/vsMw8KrGLvrxN/sOOoet5LYkw== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1795459282; h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=etweggmvewghqZeCOi7wUZ9wIdIXkNXXNOxh61ejO+Q=; b=Rt2xGV+dRG414T+HDb3PGPG+CITepVscNf7NAWnTvMiM8LvGeWUmnOgKhBdVi7jgr5qs 5P9SBrsRQQH/JQ2aIpGOCFsrU/kIYqJlmAfRQn8uBBHjON7U/Q50kLwmz3HyAG3nmI/Go oL7tBoPQnMBgUnkfx2dj0seQcusquYaXySf1w7WQpbFmLiT0pI3i5AAF52aq8C2FoW/ni eM181/RyfjCYS7aBBbQoOZpGXszWLOGFHESpRY+gNEnt/hc5yxB0UbulZnSiWJVAJMrBn 2kAMFd2Wf4X7XXrPnHeeZsHpFiaaGNAR58Vpxam1IRFLPTlKuLo42+BXskQNCmjtQZA== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 3D3321F000E1; Mon, 23 Nov 2026 18:41:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795459282; bh=etweggmvewghqZeCOi7wUZ9wIdIXkNXXNOxh61ejO+Q=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To; b=LqanlPaVdVslqpa8pijZ/2zTI3tQtkLc7hDsR5HQV0dh2maatazdvZDBpsWyMAh6X +kyy7UDSpiOJ2BCERZHZT5zexmnNZ636tdgQTREkzMiCU21YnluXI4em+6l0oKRGAe QI701/xs3K1vV9Yw/a9uc2t/POQZnk60VBPVS81mnWJLIfV1eiRRbRouqM3gTbu2YX kUalMz1gqJUsbpfpyeqiK/vysa6HurHBRaVb6welvdBMdHDFn3ord/TsaNFWw+8ZMC 99CbFzsqNRLLArXXgBMUrYGssgWFXoGlb+tNmpniU+p/oGBK87EZzcxrBgMy86cJas AQ4L3d8W0fBhQ== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id 315BE4C5A6; Mon, 23 Nov 2026 18:41:13 +0000 (UTC) From: Fil Dunsky via B4 Relay Date: Mon, 23 Nov 2026 21:41:12 +0300 Subject: [PATCH 1/5] dt-bindings: soc: Add Cortina Systems CS7542 global control block X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Message-Id: <20261123-cs7542-syscon-v1-1-49858e631449@gmail.com> References: <20261123-cs7542-syscon-v1-0-49858e631449@gmail.com> In-Reply-To: <20261123-cs7542-syscon-v1-0-49858e631449@gmail.com> To: Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stephen Boyd , Brian Masney , Jerome Brunet , Linus Walleij Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, Arnd Bergmann X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1795459271; l=2734; i=filipp.dunsky@gmail.com; s=20260930; h=from:subject:message-id; bh=FpK/rtN440rKXrT4wuja3g3AXioE5n0xbhhWrVDfiGg=; b=dMCDcND35ZLUQP4SaDj3fquLpIXW8sGrBp5IFWt31xYIFau+g7bRCwpKRiJdVq1YMl2o0cVpo gmIpD/GJ7YFCEATjt9Hn8mHKArGTmC3F5daYW6+oOYiB9smjW1mWfhz X-Developer-Key: i=filipp.dunsky@gmail.com; a=ed25519; pk=JAYP8e2rJ54DHOmhNtXud8rl1igAaAXoOHxtJmVXI1g= X-Endpoint-Received: by B4 Relay for filipp.dunsky@gmail.com/20260930 with auth_id=1085 X-Original-From: Fil Dunsky Reply-To: filipp.dunsky@gmail.com Content-Transfer-Encoding: quoted-printable From: Fil Dunsky Describe the shared global register block and its strap-selected APB, CPU and AXI clocks. A pinctrl child will share the syscon regmap. Keep clock IDs in the order used by the previous out-of-tree CS75xx clock provider. AI assistance: Codex prepared this change from the existing OpenWrt port and GPL vendor sources. Signed-off-by: Fil Dunsky --- .../soc/cortina/cortina,cs7542-syscon.yaml | 49 ++++++++++++++++++= ++++ include/dt-bindings/clock/cortina,cs7542-clock.h | 9 ++++ 2 files changed, 58 insertions(+) diff --git a/Documentation/devicetree/bindings/soc/cortina/cortina,cs7542-s= yscon.yaml b/Documentation/devicetree/bindings/soc/cortina/cortina,cs7542-s= yscon.yaml new file mode 100644 index 000000000..fb074de87 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/cortina/cortina,cs7542-syscon.y= aml @@ -0,0 +1,49 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/cortina/cortina,cs7542-syscon.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Cortina Systems CS7542 global control block + +maintainers: + - Fil Dunsky + +description: + The global control block contains the boot strap status, GPIO/peripheral + mux registers, reset controls and the secondary CPU release register. + It provides the APB, CPU and AXI clock rates selected by the boot straps. + The clock specifiers are defined in dt-bindings/clock/cortina,cs7542-clo= ck.h. + The pin controller uses the same register map through its parent syscon. + +properties: + compatible: + items: + - const: cortina,cs7542-syscon + - const: syscon + - const: simple-mfd + + reg: + maxItems: 1 + + "#clock-cells": + const: 1 + + pinctrl: + type: object + $ref: /schemas/pinctrl/cortina,cs7542-pinctrl.yaml# + +required: + - compatible + - reg + - "#clock-cells" + +additionalProperties: false + +examples: + - | + syscon@f0000000 { + compatible =3D "cortina,cs7542-syscon", "syscon", "simple-mfd"; + reg =3D <0xf0000000 0x100>; + #clock-cells =3D <1>; + }; diff --git a/include/dt-bindings/clock/cortina,cs7542-clock.h b/include/dt-= bindings/clock/cortina,cs7542-clock.h new file mode 100644 index 000000000..34d544238 --- /dev/null +++ b/include/dt-bindings/clock/cortina,cs7542-clock.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ +#ifndef _DT_BINDINGS_CLOCK_CORTINA_CS7542_H +#define _DT_BINDINGS_CLOCK_CORTINA_CS7542_H + +#define CS7542_CLK_APB 0 +#define CS7542_CLK_CPU 1 +#define CS7542_CLK_AXI 2 + +#endif --=20 2.53.0 From nobody Tue Nov 24 11:35:54 2026 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795459279; b=AbnKTmNWsrhkhQV+dEERSPKHFb8u/htd8G0XBiWhZ6zdS4WXys4C/4udr7XcIksUMvmz Q7GjHh/Yi5ROy8aIETp4m38blyPvWLDXR6twsKRwGyojs1aL7qDYtKJGmTC1Q0Gx6TlJ9 RAsPNd59UBrxPQ/HtGv1aly0nW6DDyzlF2y/nMHmWhJEg3WYI8PpNdH79XZjPwMnpl85X 5rCt7iUGLdG3VOwQMu9hcpT67iDZI5rhQ9gcCMGVQ77f5KRZztXNxv1agycg2lfUrjctJ oAXirvHUFqq2TXQs4f6o4VE3kPFfI3cUJysZ+TQnuacBuXJY8MqbhutmQBM3Ij6sTQw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795459279; h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=l9bZ/Z4zkSpMsXFfmdertwdtzZqERHTevFQJLNpFelA=; b=HXWU2kz4FnbDwiJpz4sRGW78fo40SJ9IU+9OMojWvpqO25tve0I5N1phj+N5oCTrQbat ZU5tvllFeDAgJQE1dlatisfxsKLda9MGoyupxY4qa25s448v6E9SBm7Zv8drHaJcP3rKz 0/jAZKj338SSobJDUnMYa+x/iyH28LfpT4OEAw/0ChbgykhlA9CY7KuLupjlmv9shVe3E U8CwVl10W+f7lXBO6Vz4kjocIxzjS6oiGmJnlnsZCRu5kC4/LP0EORgqhQJNNUI1zM19M kqKYRiHioTPhmDD2t8I75U2epFO6xX11gP3eLmxpE+rHYKU3I1r4+oxpx/5hX5r2I7w== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WCLZRcQR; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0EEB6606A332; Mon, 23 Nov 2026 18:41:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WCLZRcQR Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1795459278; b=nOFI2nR9O02h+2s9rVukDxLQPHKK+lsLN92RpJ44it9hAlNcCbeWlRX4il80gNy94poK sH42TDKYpuf+7qZ0HVgB7jtnwlnUUg7TghuNdiBTR12Zzl/XkDTq7+Iuy664AXYKvx/Yt 5sFaBQ6F2KmDMM/ZqwFquBaWr6K927BFXIQXVabugmQO6idEtWK77QNxTl5i/5B7crSyt yjXmg388Ab2dcOqMFpYEMKWcKvUYpN9Je3xc6QQx/Yw8e21srsK1bjyVtX+rK6MQeWIQm ylP/GKirMPAp81S+EhYjQ3NrhulnydM3iJZJlFkntkDAJrALV4WIBppgnAZgxO/55oQ== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1795459278; h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=l9bZ/Z4zkSpMsXFfmdertwdtzZqERHTevFQJLNpFelA=; b=z9TUIU/H+mDSBGAYVPvhKrKXmqVxX80iGSicYoxvYZYyxb4rw4WRK+U/I6t0BQ9KaMzd V/PTfO3kMmuHp7pzinoVZ5ICtaGXX/iVKFSza8S14l6IJQ4wKZj2SY1T1kVvNm7ETnuSk lRHrw0IPzoVvw2meGUb3flFSSo6X+up9+aEskNJYlAh19SUvY7INDdnSmRCW/yPEcuggm TIsaub/3KG7Oocj/ahsZXJi0ENVhji2JAX4W1CFGcirUTP6WSSvqZJpTv9BSKdB+ItNAd vgWYg/rU3GmKImNNTtT8YGkSJVtSQoilOkk4eXjEYKYXhY7ggnTbMUs03vEitpVhbGQ== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 3C37E1F000E0; Mon, 23 Nov 2026 18:41:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795459278; bh=l9bZ/Z4zkSpMsXFfmdertwdtzZqERHTevFQJLNpFelA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To; b=WCLZRcQRhnunx3ncBde7d4/wfKUikDruboZ4tfsbfUmediZD9zhOC1XLKOBk1L/c8 xRbs0APQlCjAwrWiOJdSAeoV+AEyUYQKyI5EVLDRvzWX+eefgV28B1oVQEp/5/SPyI cvI3slNE4WDldtd4gkhmcUwTY5nif87TgNskEzmwvlQDlZL77QLKwv0utKhj7UWxym 4f2SgB+PfMqJ9rGmNY4nExWcBkBPnAPDT1K8HqrCD0/zC9ZPGQrtlj2LceLZTTD3IQ SeXRQPKVYRC3lqohJ+kTeBwIMrH6kANfW9+g7szTnAUi7xBCTMwxv/lj0qRTfaFZfZ VlbQnlZgYExfw== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id 4F2D84C5B3; Mon, 23 Nov 2026 18:41:13 +0000 (UTC) From: Fil Dunsky via B4 Relay Date: Mon, 23 Nov 2026 21:41:13 +0300 Subject: [PATCH 2/5] dt-bindings: pinctrl: Add Cortina Systems CS7542 pin mux X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Message-Id: <20261123-cs7542-syscon-v1-2-49858e631449@gmail.com> References: <20261123-cs7542-syscon-v1-0-49858e631449@gmail.com> In-Reply-To: <20261123-cs7542-syscon-v1-0-49858e631449@gmail.com> To: Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stephen Boyd , Brian Masney , Jerome Brunet , Linus Walleij Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, Arnd Bergmann X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1795459271; l=3060; i=filipp.dunsky@gmail.com; s=20260930; h=from:subject:message-id; bh=F7pjXfN4EBv+S1ypEhkh5BVaKDFizMnbeKv3RXHbfp0=; b=w8dkZuv2wVtDFo9Ev6CsnIlivgO3sDNUIIHTMLKxbC8nlqrBQr1KZ8oLyKx46tGoO9O33Cy7/ StVSRq9sZfIDaPDpwNf8DMlihSaS3bGND+y2N6FyXPtGX8HwNfZ3M28 X-Developer-Key: i=filipp.dunsky@gmail.com; a=ed25519; pk=JAYP8e2rJ54DHOmhNtXud8rl1igAaAXoOHxtJmVXI1g= X-Endpoint-Received: by B4 Relay for filipp.dunsky@gmail.com/20260930 with auth_id=1085 X-Original-From: Fil Dunsky Reply-To: filipp.dunsky@gmail.com Content-Transfer-Encoding: quoted-printable From: Fil Dunsky Describe the GPIO/peripheral selector in the global control block. Expose GPIO selection for all five banks and the UART signals used by the OpenWrt port, without inventing routes for other peripherals. Register offsets and masks are kept out of the device tree ABI. AI assistance: Codex prepared this change from the existing OpenWrt port and GPL vendor sources. Signed-off-by: Fil Dunsky --- .../bindings/pinctrl/cortina,cs7542-pinctrl.yaml | 84 ++++++++++++++++++= ++++ 1 file changed, 84 insertions(+) diff --git a/Documentation/devicetree/bindings/pinctrl/cortina,cs7542-pinct= rl.yaml b/Documentation/devicetree/bindings/pinctrl/cortina,cs7542-pinctrl.= yaml new file mode 100644 index 000000000..cd5c81a0d --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/cortina,cs7542-pinctrl.yaml @@ -0,0 +1,84 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pinctrl/cortina,cs7542-pinctrl.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Cortina Systems CS7542 pin multiplexer + +maintainers: + - Fil Dunsky + +description: + The pin multiplexer is a child of the CS7542 global control syscon. + Five 32-bit registers select GPIO mode when a pin's bit is set, or the + peripheral signal when it is clear. Pin numbers match the five GPIO + banks, from gpio0 to gpio159. Initially only GPIO mode and the UART + signals on gpio72 through gpio77 are supported. Other peripheral + routes and electrical configuration are not described here. + +allOf: + - $ref: pinctrl.yaml# + +properties: + compatible: + const: cortina,cs7542-pinctrl + +patternProperties: + '-pins$': + type: object + $ref: pinmux-node.yaml# + additionalProperties: false + + properties: + function: + enum: [gpio, uart] + + pins: + items: + pattern: '^gpio([0-9]|[1-9][0-9]|1[0-5][0-9])$' + minItems: 1 + maxItems: 160 + + required: + - function + - pins + + allOf: + - if: + properties: + function: + const: uart + then: + properties: + pins: + items: + enum: [gpio72, gpio73, gpio74, gpio75, gpio76, gpio77] + +required: + - compatible + +additionalProperties: false + +examples: + - | + syscon@f0000000 { + compatible =3D "cortina,cs7542-syscon", "syscon", "simple-mfd"; + reg =3D <0xf0000000 0x100>; + #clock-cells =3D <1>; + + pinctrl { + compatible =3D "cortina,cs7542-pinctrl"; + + reset-pins { + function =3D "gpio"; + pins =3D "gpio37"; + }; + + aux-uarts-pins { + function =3D "uart"; + pins =3D "gpio72", "gpio73", "gpio74", "gpio75", + "gpio76", "gpio77"; + }; + }; + }; --=20 2.53.0 From nobody Tue Nov 24 11:35:54 2026 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795459289; b=wO+LyzIpjj2aRJnm53WYheCseeNhOJ3znH4QLMJqeVjAwVYbOAY8to5e78cYNMwCzd9a UG50v5zXs3oNnLl8hr5fxGupA3C1vl8++tozKmxelk5WvcGfkvHPcVzXYsiRIZDRbxA1g BIerOOblvUdWxjCk5nSlGZUzqqpmSiaFOCs6+P7sX3VSpx1uHgfyyMIVsvlD3cWfkl1qc 7KF+bmzMrGjO1xvwX//i0xBOfc4AD+Ga6YtspSOMop/p6AxKIOHPwkdwSyrHvDp6xbblN EHyOF7DvvikqT4h/nSaLdASPjEpmIp2/xsbUcbJFoSS0+7fDGRuK6r7cTHwUamar8Hw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795459289; h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=O14BbX1wLIKYJhhhZsc1QX5KnrTbKI8v08Tn9x+QgPI=; b=vsF9OeU45GSU+0AUTfzIEWf49xFvE+kHaSP9ZcQRX9xA38jYzrjAGKxHTx3XA7ZKirQv s3D8BfhFnXb17BglqkMerwqANI6qptI+/M1wg66R6jvTcd101oxF3LPIA5+U9sfsjwiSx qAazu244Dtbg4yxA/d9pZom3EFuRgp1tfW6/dmOENzX6Yn2zcUJqxjgRDYS368IUQ1nzj Sxu2omAsXeTvKsQMCFzeQBudH1t++7MotkcDW9k5+nAqgH6jyAChBOjvuD/NZz+ehOYGO BA1bOP/cLjmNMMzA/2b89CrcHtTNvn/VBKqBne6o8pgx0XaWrA5DAuyV8siK0dWVUBw== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QoAQqCrQ; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08261606A690; Mon, 23 Nov 2026 18:41:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QoAQqCrQ Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1795459288; b=IeO5z3h8NcHm3Zq3Diy0ZVYuXD++TphEuxMgn+JccK/NhWT/Xj94bBkUoDyc/V2FW/SY xgScHFKm2OmZ/ss75h4g34BEL2gWAS3aPJG9lbYpdqo5CMq87y5IskvlgTFQvBRJfDtba fCMqoL7cbOCxj2n3xnH8y5J/4v+ERBEHYHcKIVHrccXKRh+d4AMq6jagMchKqybkdCmae M0EmrsgQraqa8zhNrV2X8PIMLzkW/5WoYXJ3qnPlCAB4KHaXg2dgM5//fIo/FMOv6+qw3 4l6seBR6ByCkW/BzJ6VE+ul0bDxqF+kLxxPyzgCQW3DrSdjnT2koIih68D1ylx5FVIg== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1795459288; h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=O14BbX1wLIKYJhhhZsc1QX5KnrTbKI8v08Tn9x+QgPI=; b=V3v6OxhDuSktbdkRePBDYlAqc1Q5rlLtanPQIq8xiD4O1gd74UYDpQYYJ7NEkY6+5Qix NdwjPw3gvkOC51n9/nl71eEk6Uvseu9a+6Zu0g5jBOO/iNMVbMavHw+Y5GHbrvZwTdKNn OAnbq/rp8Cd1JEN2QgnVVXXlx+mRWSxB170OzgdcOPqg9m8KAkqWopU3l8v8YS2pKiE3m SKs5MhiMBqZFt3312osxnID9M06NSlcBf4tnLegqnYqvw5xZPuRe8JXGXKf5FWLWkkuAD AqPGa+beocfBfQmcSjG/arNWq1aSXiLr1gscB6Fjp7GSwRRNF8Cp4egZDuyvp9tI9Lg== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 3C34A1F000D8; Mon, 23 Nov 2026 18:41:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795459288; bh=O14BbX1wLIKYJhhhZsc1QX5KnrTbKI8v08Tn9x+QgPI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To; b=QoAQqCrQWkMvHImLgV0+zKzlmX78AIEO/c7wbo7ao2mYua2Gbskopn/5S7CgovvhB Oazb16HQM6nvx+tyPOQknj4R24A0ECiRHxbR2K/BeBQXyAerZ4jWXbMTa9iIacBHH8 jz5wLVijcm6wjWKZ7Z2Y68ul34MXNEo4TwLQh7DGTelKKLPuJbRpMAK/dfTk2pzLJ9 xyoC+bTfZe6hNdkNrdWU7C6PMaDH7lEkmfULBJXdC5ertt6sFzOi5Yav+Bv22ceiqj SqmSTR3VRkuYKOm8iXHayHiH6zOL4QLrc5sVBAXSkiIRFIeGkR/1mECERptt1mgaHa U0Jm/5MhYct0A== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id 6C1D34C5B7; Mon, 23 Nov 2026 18:41:13 +0000 (UTC) From: Fil Dunsky via B4 Relay Date: Mon, 23 Nov 2026 21:41:14 +0300 Subject: [PATCH 3/5] clk: Add Cortina Systems CS7542 strap-selected clocks X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Message-Id: <20261123-cs7542-syscon-v1-3-49858e631449@gmail.com> References: <20261123-cs7542-syscon-v1-0-49858e631449@gmail.com> In-Reply-To: <20261123-cs7542-syscon-v1-0-49858e631449@gmail.com> To: Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stephen Boyd , Brian Masney , Jerome Brunet , Linus Walleij Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, Arnd Bergmann X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1795459271; l=5002; i=filipp.dunsky@gmail.com; s=20260930; h=from:subject:message-id; bh=JEa90SGQ0FgER4S1FcL2NkC7oSwXVNfRbOUFnfhpGuk=; b=e0rWIO8xaF7w/JxsQI1xMpXHd7PA0yFu8QyZU0nPuYXJuZbaup7pL+v3doiI2mBjTRi0pqYQ3 4w6h8Ukd29VAWNQe8XizC1ikSTIqHkjSXy5cPSfa07jcQ2a0Jt0chie X-Developer-Key: i=filipp.dunsky@gmail.com; a=ed25519; pk=JAYP8e2rJ54DHOmhNtXud8rl1igAaAXoOHxtJmVXI1g= X-Endpoint-Received: by B4 Relay for filipp.dunsky@gmail.com/20260930 with auth_id=1085 X-Original-From: Fil Dunsky Reply-To: filipp.dunsky@gmail.com Content-Transfer-Encoding: quoted-printable From: Fil Dunsky Register APB, CPU and AXI fixed-rate outputs from GLOBAL_STRAP[3:1], using the seven configurations recorded in the vendor kernel. Reject the reserved encoding instead of publishing a guessed frequency. Register before timer initialization and leave the syscon platform node available for its pinctrl child. Use the shared regmap, only read strap status, and unwind all registered clocks if provider setup fails. This is intentionally not a DVFS or programmable PLL driver. AI assistance: Codex prepared this change from the existing OpenWrt port and GPL vendor sources. Signed-off-by: Fil Dunsky --- drivers/clk/Kconfig | 9 +++++ drivers/clk/Makefile | 1 + drivers/clk/clk-cs7542.c | 90 ++++++++++++++++++++++++++++++++++++++++++++= ++++ 3 files changed, 100 insertions(+) diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index 37a8e35d4..47b5265fe 100644 --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig @@ -58,6 +58,15 @@ config LMK04832 Say yes here to build support for Texas Instruments' LMK04832 Ultra Low-Noise JESD204B Compliant Clock Jitter Cleaner With Dual Loop PLLs =20 +config COMMON_CLK_CS7542 + bool "Cortina Systems CS7542 strap-selected clocks" + depends on OF && HAS_IOMEM + select MFD_SYSCON + help + Read the boot straps of the CS7542 global control block to provide + its APB, CPU and AXI clocks. This driver does not change PLLs or + dividers. It is built in because the APB clock is needed by timers. + config COMMON_CLK_APPLE_NCO tristate "Clock driver for Apple SoC NCOs" depends on ARCH_APPLE || COMPILE_TEST diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index 52d138d4f..16b1168c8 100644 --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile @@ -63,6 +63,7 @@ obj-$(CONFIG_ARCH_AXXIA) +=3D clk-axm5516.o obj-$(CONFIG_COMMON_CLK_BD718XX) +=3D clk-bd718x7.o obj-$(CONFIG_COMMON_CLK_BM1880) +=3D clk-bm1880.o obj-$(CONFIG_COMMON_CLK_CDCE706) +=3D clk-cdce706.o +obj-$(CONFIG_COMMON_CLK_CS7542) +=3D clk-cs7542.o obj-$(CONFIG_COMMON_CLK_CDCE925) +=3D clk-cdce925.o obj-$(CONFIG_ARCH_CLPS711X) +=3D clk-clps711x.o obj-$(CONFIG_COMMON_CLK_CS2000_CP) +=3D clk-cs2000-cp.o diff --git a/drivers/clk/clk-cs7542.c b/drivers/clk/clk-cs7542.c new file mode 100644 index 000000000..4e6c1e98a --- /dev/null +++ b/drivers/clk/clk-cs7542.c @@ -0,0 +1,90 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* Cortina Systems CS7542 strap-selected clocks */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define CS7542_GLOBAL_STRAP 0x0c +#define CS7542_STRAP_SPEED GENMASK(3, 1) +#define CS7542_NUM_CLKS 3 + +/* Rates from the GPL vendor kernel's get_platform_clk(). */ +static const unsigned long cs7542_rates[][CS7542_NUM_CLKS] =3D { + /* APB, CPU, AXI */ + { 100000000, 400000000, 133333333 }, + { 100000000, 600000000, 150000000 }, + { 100000000, 700000000, 140000000 }, + { 100000000, 800000000, 160000000 }, + { 100000000, 900000000, 150000000 }, + { 150000000, 750000000, 150000000 }, + { 170000000, 850000000, 141666667 }, +}; + +static const char * const cs7542_clock_names[] =3D { + [CS7542_CLK_APB] =3D "cs7542-apb", + [CS7542_CLK_CPU] =3D "cs7542-cpu", + [CS7542_CLK_AXI] =3D "cs7542-axi", +}; + +static void __init cs7542_clk_init(struct device_node *np) +{ + struct clk_hw_onecell_data *data; + struct regmap *map; + unsigned int strap, speed; + int i, ret; + + map =3D syscon_node_to_regmap(np); + if (IS_ERR(map)) { + pr_err("%pOF: cannot get global regmap: %ld\n", np, PTR_ERR(map)); + return; + } + + ret =3D regmap_read(map, CS7542_GLOBAL_STRAP, &strap); + if (ret) { + pr_err("%pOF: cannot read clock strap: %d\n", np, ret); + return; + } + + speed =3D FIELD_GET(CS7542_STRAP_SPEED, strap); + if (speed >=3D ARRAY_SIZE(cs7542_rates)) { + pr_err("%pOF: unsupported clock strap %u\n", np, speed); + return; + } + + data =3D kzalloc_flex(*data, hws, CS7542_NUM_CLKS); + if (!data) + return; + data->num =3D CS7542_NUM_CLKS; + + for (i =3D 0; i < CS7542_NUM_CLKS; i++) { + data->hws[i] =3D clk_hw_register_fixed_rate(NULL, + cs7542_clock_names[i], NULL, + 0, cs7542_rates[speed][i]); + if (IS_ERR(data->hws[i])) { + ret =3D PTR_ERR(data->hws[i]); + goto err_unregister; + } + } + + ret =3D of_clk_add_hw_provider(np, of_clk_hw_onecell_get, data); + if (!ret) + return; + +err_unregister: + while (i--) + clk_hw_unregister_fixed_rate(data->hws[i]); + kfree(data); + pr_err("%pOF: cannot register clocks: %d\n", np, ret); +} + +/* Timers need APB before platform devices, but the pinctrl child must pro= be. */ +CLK_OF_DECLARE_DRIVER(cs7542_clk, "cortina,cs7542-syscon", cs7542_clk_init= ); --=20 2.53.0 From nobody Tue Nov 24 11:35:54 2026 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795459286; b=oTeoKFupDSSljR7twHBMaI8It041oMsjhkRJHaB0qNuth8cTJGQaSQlkSd2Ly8Hm7D+J JcVDIL/grxemL4hvEWnTlsDQuB4BLYMMrUwmvhnaea0rNf5vIIEZ6qq1DcDHSIWvsj/++ KGb1udDO98gSEf5xinK4dcs90McCnsERruyciBULJFYFNCYJ6rY1WDOdjZarKmX6z9TYD Dw6sWuahT+wDxjBNTDQpY7s29UCHlUJiOTId+onIXKHSNhO/UhvUqWaArrMHLfxHyWR1A AUbviCLFnaaB0YAdaknTI5u19ilCELNNgr8Y6aOSJsOIJeuRsFDNucnDUD2IvzThvsw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795459286; h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=WLwYUf2K3oU0qGF1X7733AbXhs/+Y44YMPNhVj2XPc8=; b=kIAgZ1H3aBCSLzuHWKLOR0Gj0RPE6kdul015Da+AV1cF/iduR7kzViQSmZ8qEBrEMn9W 2OrZKNE2akwSNfDdS3H3AmxzIW3tqISrZK8i2X0vIGf3wmXTnaCARmdTU4jxTFZsYM0Eo foIiEza1TO0evo0aFVehOWkNctLG9riv++ZqiYDDEyhjXcI2Y3F+D6HOVqekiedVUmcHs SwASESibLVBgc6/m9iPtNR0V8lH0QDitpZtR0FpRvbifPw7ihCKFHaQVGuCP0/rO2rHz9 AvlyP+XAA03UjBtpICVA4kbxcn2baMTy+KMFutm9egMbM1Gx3c7dLgcmqX4BSGmVzhw== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Rq9RF6FM; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91A32606A32E; Mon, 23 Nov 2026 18:41:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Rq9RF6FM Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1795459286; b=JevfkMoN+uIxgMzCpEcaLZxlzTuP4ZUwONC57loSi1TtTzSuoNKJzoggjjX4Y2l0A0WX GwR8YDfDLDOmmXvVj9Bdd0tDVN/YIr/lUfECXXdSTQBpZZCS1OaXKfmWqgTKx7jCXbL4V 9k8Ut/XDD+EmEdzNbCRJYjRv6Fju5gsf0I6fRc9Y17nAeP429kbB4EtYzgAxXYvJWGOXN ycMKUX3uhwrdkgtjW49ZMl3EFkVJmxQ+TG+Y3zhxmNuyCb7Cf2+nzLJEyTwNUgboblXlf ZDUWow9n9G+R3C1C08+RF0jhMyU/dOERANikT+yS2pwmNAC9qEcDT5J9UAcShuyRpfQ== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1795459286; h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=WLwYUf2K3oU0qGF1X7733AbXhs/+Y44YMPNhVj2XPc8=; b=ZHvw+o7w1k3Tfnn1/DFA4T6haXMjDRsj26PWnCqVjy3JG/empMyH3CLG704SkhKR60+w xLDomr4an62pBtDlWRuJYldAvDUd5YkHQXo/NC4dmXY/J0arIFtos1uc96KEy4qphp6BN woVtAGOwYxUxoNxAvaL5MijfJ+tYkK025aX2RiOh1p4QIwIkwEHzPqRebpK57Jsr8pifZ 9zApelFe71C4m42yc3lo9uz76jZQvYpAlUYbXGpz/bNo3RUqyorSXwmvs97nFHjklzJ20 2dcnL6pBabb2SoZE2C0e70Z8AeKJNdTKyzpdTu/hS0tumnszoOivGBJ1Exe3bC30brg== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 3D4991F000E6; Mon, 23 Nov 2026 18:41:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795459286; bh=WLwYUf2K3oU0qGF1X7733AbXhs/+Y44YMPNhVj2XPc8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To; b=Rq9RF6FMzvYpeJlywqrVlueNXz1obL13XUKLC/+TiK9TwXgcfUCijVt3L/Yx7Wrx6 N7s6HARW1dkW04GNS9X7CoLCCMgKw3vqk0GM+byyNchduz2XoCiSXFsu8hpE3VWb4I gWRYW/wBUzNbeiLecLvonEpeTzSIAGYMwVmbjyIeLDBMU1jn8QZgIdVuvUU7gtFCKX Y/2dssYX3duKP4sjPJdZXlsCvOg27IzyHm7qKSv5VTOjh3kJDmmwWpuyeZnBg6mN0H gVt3NystnZjof5tPii3w6tjbXTktZia4X4XzY1jLEbxNRyPZ4Pkdp74+XHOUFhA0zj xeeflOEfCUYnw== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id 8829E4C5BB; Mon, 23 Nov 2026 18:41:13 +0000 (UTC) From: Fil Dunsky via B4 Relay Date: Mon, 23 Nov 2026 21:41:15 +0300 Subject: [PATCH 4/5] pinctrl: Add Cortina Systems CS7542 pin multiplexer X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Message-Id: <20261123-cs7542-syscon-v1-4-49858e631449@gmail.com> References: <20261123-cs7542-syscon-v1-0-49858e631449@gmail.com> In-Reply-To: <20261123-cs7542-syscon-v1-0-49858e631449@gmail.com> To: Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stephen Boyd , Brian Masney , Jerome Brunet , Linus Walleij Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, Arnd Bergmann X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1795459271; l=8121; i=filipp.dunsky@gmail.com; s=20260930; h=from:subject:message-id; bh=y7eDR0Y8zYV/gTt6vf8KzGBbu+9dW9ODBAkBl6O1sT0=; b=/L0IQ8Eqf3RNF0VY4xlIdt+Pg67Yq/+QX1roK2Td4jqqloByl7sjo/rccTdYWryHCSYgbtMRP sbCUF0K6mYLCGcANmtn/MrADLJcUVWdZnP1Fop5vaMnnE7WuIB5XiPr X-Developer-Key: i=filipp.dunsky@gmail.com; a=ed25519; pk=JAYP8e2rJ54DHOmhNtXud8rl1igAaAXoOHxtJmVXI1g= X-Endpoint-Received: by B4 Relay for filipp.dunsky@gmail.com/20260930 with auth_id=1085 X-Original-From: Fil Dunsky Reply-To: filipp.dunsky@gmail.com Content-Transfer-Encoding: quoted-printable From: Fil Dunsky Use the global syscon regmap for the five GPIO mux registers. Each bit selects GPIO when set and a peripheral signal when clear. Support GPIO on all 160 lines and the six UART pins exercised by the OpenWrt port. Do not guess mux settings for the other peripherals. Use masked regmap updates so independent pins and users of the shared block retain their settings. No register changes are made merely by probing; only a selected state or a GPIO request changes a pin. Register and initialize the controller before enabling its own hogs. AI assistance: Codex prepared this change from the existing OpenWrt port and GPL vendor sources. Signed-off-by: Fil Dunsky --- drivers/pinctrl/Kconfig | 13 +++ drivers/pinctrl/Makefile | 1 + drivers/pinctrl/pinctrl-cs7542.c | 188 +++++++++++++++++++++++++++++++++++= ++++ 3 files changed, 202 insertions(+) diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index dc7138302..89f247cb2 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -188,6 +188,19 @@ config PINCTRL_BM1880 help Pinctrl driver for Bitmain BM1880 SoC. =20 +config PINCTRL_CS7542 + tristate "Cortina Systems CS7542 pin multiplexer" + depends on OF && HAS_IOMEM + select MFD_SYSCON + select PINMUX + select GENERIC_PINCONF + help + Select GPIO mode or the supported peripheral signals in the CS7542 + global control block. This driver shares the syscon register map + with the clock provider and leaves unrelated pins unchanged. + Electrical pin configuration and other peripheral routes are not + implemented. + config PINCTRL_CY8C95X0 tristate "Cypress CY8C95X0 I2C pinctrl and GPIO driver" depends on I2C diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile index ce0825f4f..59541be4d 100644 --- a/drivers/pinctrl/Makefile +++ b/drivers/pinctrl/Makefile @@ -23,6 +23,7 @@ obj-$(CONFIG_PINCTRL_AW9523) +=3D pinctrl-aw9523.o obj-$(CONFIG_PINCTRL_AXP209) +=3D pinctrl-axp209.o obj-$(CONFIG_PINCTRL_BM1880) +=3D pinctrl-bm1880.o obj-$(CONFIG_PINCTRL_CY8C95X0) +=3D pinctrl-cy8c95x0.o +obj-$(CONFIG_PINCTRL_CS7542) +=3D pinctrl-cs7542.o obj-$(CONFIG_PINCTRL_DA850_PUPD) +=3D pinctrl-da850-pupd.o obj-$(CONFIG_PINCTRL_DA9062) +=3D pinctrl-da9062.o obj-$(CONFIG_PINCTRL_DIGICOLOR) +=3D pinctrl-digicolor.o diff --git a/drivers/pinctrl/pinctrl-cs7542.c b/drivers/pinctrl/pinctrl-cs7= 542.c new file mode 100644 index 000000000..977c4ce98 --- /dev/null +++ b/drivers/pinctrl/pinctrl-cs7542.c @@ -0,0 +1,188 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* Cortina Systems CS7542 GPIO/peripheral pin multiplexer */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "pinctrl-utils.h" + +#define CS7542_GPIO_MUX 0x1c +#define CS7542_NUM_PINS 160 +#define CS7542_UART_FIRST 72 +#define CS7542_UART_LAST 77 + +enum cs7542_function { + CS7542_FUNCTION_GPIO, + CS7542_FUNCTION_UART, +}; + +struct cs7542_pinctrl { + struct regmap *map; + struct pinctrl_desc desc; + struct pinctrl_pin_desc pins[CS7542_NUM_PINS]; + const char *groups[CS7542_NUM_PINS]; +}; + +static const char * const cs7542_functions[] =3D { "gpio", "uart" }; +static const char * const cs7542_uart_groups[] =3D { + "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77", +}; + +static int cs7542_get_groups_count(struct pinctrl_dev *pctldev) +{ + return CS7542_NUM_PINS; +} + +static const char *cs7542_get_group_name(struct pinctrl_dev *pctldev, + unsigned int group) +{ + struct cs7542_pinctrl *pctl =3D pinctrl_dev_get_drvdata(pctldev); + + return pctl->groups[group]; +} + +static int cs7542_get_group_pins(struct pinctrl_dev *pctldev, + unsigned int group, const unsigned int **pins, + unsigned int *num_pins) +{ + struct cs7542_pinctrl *pctl =3D pinctrl_dev_get_drvdata(pctldev); + + *pins =3D &pctl->pins[group].number; + *num_pins =3D 1; + return 0; +} + +static const struct pinctrl_ops cs7542_pinctrl_ops =3D { + .get_groups_count =3D cs7542_get_groups_count, + .get_group_name =3D cs7542_get_group_name, + .get_group_pins =3D cs7542_get_group_pins, + .dt_node_to_map =3D pinconf_generic_dt_node_to_map_pin, + .dt_free_map =3D pinctrl_utils_free_map, +}; + +static int cs7542_get_functions_count(struct pinctrl_dev *pctldev) +{ + return ARRAY_SIZE(cs7542_functions); +} + +static const char *cs7542_get_function_name(struct pinctrl_dev *pctldev, + unsigned int function) +{ + return cs7542_functions[function]; +} + +static int cs7542_get_function_groups(struct pinctrl_dev *pctldev, + unsigned int function, + const char * const **groups, + unsigned int *num_groups) +{ + struct cs7542_pinctrl *pctl =3D pinctrl_dev_get_drvdata(pctldev); + + if (function =3D=3D CS7542_FUNCTION_GPIO) { + *groups =3D pctl->groups; + *num_groups =3D CS7542_NUM_PINS; + } else { + *groups =3D cs7542_uart_groups; + *num_groups =3D ARRAY_SIZE(cs7542_uart_groups); + } + return 0; +} + +static int cs7542_set_mux(struct pinctrl_dev *pctldev, unsigned int functi= on, + unsigned int group) +{ + struct cs7542_pinctrl *pctl =3D pinctrl_dev_get_drvdata(pctldev); + unsigned int mask; + + if (group >=3D CS7542_NUM_PINS || function >=3D ARRAY_SIZE(cs7542_functio= ns)) + return -EINVAL; + if (function =3D=3D CS7542_FUNCTION_UART && + (group < CS7542_UART_FIRST || group > CS7542_UART_LAST)) + return -EINVAL; + + mask =3D BIT(group % 32); + return regmap_update_bits(pctl->map, CS7542_GPIO_MUX + (group / 32) * 4, + mask, function =3D=3D CS7542_FUNCTION_GPIO ? mask : 0); +} + +static int cs7542_gpio_request_enable(struct pinctrl_dev *pctldev, + struct pinctrl_gpio_range *range, + unsigned int pin) +{ + return cs7542_set_mux(pctldev, CS7542_FUNCTION_GPIO, pin); +} + +static const struct pinmux_ops cs7542_pinmux_ops =3D { + .get_functions_count =3D cs7542_get_functions_count, + .get_function_name =3D cs7542_get_function_name, + .get_function_groups =3D cs7542_get_function_groups, + .set_mux =3D cs7542_set_mux, + .gpio_request_enable =3D cs7542_gpio_request_enable, + .strict =3D true, +}; + +static int cs7542_pinctrl_probe(struct platform_device *pdev) +{ + struct device *dev =3D &pdev->dev; + struct cs7542_pinctrl *pctl; + struct pinctrl_dev *pctldev; + unsigned int i; + int ret; + + pctl =3D devm_kzalloc(dev, sizeof(*pctl), GFP_KERNEL); + if (!pctl) + return -ENOMEM; + + pctl->map =3D syscon_node_to_regmap(dev->of_node->parent); + if (IS_ERR(pctl->map)) + return dev_err_probe(dev, PTR_ERR(pctl->map), "cannot get global regmap\= n"); + + for (i =3D 0; i < CS7542_NUM_PINS; i++) { + pctl->groups[i] =3D devm_kasprintf(dev, GFP_KERNEL, "gpio%u", i); + if (!pctl->groups[i]) + return -ENOMEM; + pctl->pins[i].number =3D i; + pctl->pins[i].name =3D pctl->groups[i]; + } + + pctl->desc.name =3D dev_name(dev); + pctl->desc.owner =3D THIS_MODULE; + pctl->desc.pins =3D pctl->pins; + pctl->desc.npins =3D CS7542_NUM_PINS; + pctl->desc.pctlops =3D &cs7542_pinctrl_ops; + pctl->desc.pmxops =3D &cs7542_pinmux_ops; + + ret =3D devm_pinctrl_register_and_init(dev, &pctl->desc, pctl, &pctldev); + if (ret) + return dev_err_probe(dev, ret, "cannot register pin controller\n"); + + return pinctrl_enable(pctldev); +} + +static const struct of_device_id cs7542_pinctrl_match[] =3D { + { .compatible =3D "cortina,cs7542-pinctrl" }, + { } +}; +MODULE_DEVICE_TABLE(of, cs7542_pinctrl_match); + +static struct platform_driver cs7542_pinctrl_driver =3D { + .probe =3D cs7542_pinctrl_probe, + .driver =3D { + .name =3D "cs7542-pinctrl", + .of_match_table =3D cs7542_pinctrl_match, + }, +}; +module_platform_driver(cs7542_pinctrl_driver); + +MODULE_DESCRIPTION("Cortina Systems CS7542 pin multiplexer"); +MODULE_LICENSE("GPL"); --=20 2.53.0 From nobody Tue Nov 24 11:35:54 2026 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795459289; b=rZCxeFIoT33x/x3ml0K7jvPU0owYBQ+SF6PHtDof569BJ4xaM5OqP9ghsQl86mp9cBUP 35LqdXtzp4TgMyOL6v81fkTOXsmiT1tekz7tOZ6mUF8/XL0geoshgNRH7J2LUWMb0+GfB iYv22PlnpTkPyh9lB2ElqV2YJfgU1Of8wG2jvJKjPmmOqiVbcheBmRa/ln3v4HVZoTWS5 5/SOcbPG7IwpEYN0kY/EYjjJbDsoUndw5yEderaqQEN6WBqUd9OWl+JrORMHkhh0IjauH SBnXy82zpDLbWQjh9WDQ8Yp8MmZl1gAzfvA1DqfPjhyfG5TPLTCrwj0RNCAV1hgiYnw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795459289; h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=JA1RY4AoQnfSHpB9qDuwptqbpVvMYp1OIFwFo8h5NUs=; b=dfkZtCrz5x/7JOwgJ5ENhRfsOlEPp7c3SupCAd2bkyVZUdoi6j3H+8T2pOa1df/U69MX cscCJCcx0EjW3OltltwADwpE3gNqPUq6EUTE+ZKoC4NzZqNvZUP2H3XVXHmypdH6VPT8R 19oa/zDgiwFEbmfDlb0OSxdyj2yoEpkuQljymgjm7pfsm73KA+7cDO8WgEsJtndb1QsHJ xNOyfH4eIrN1WTxplU0y8mGgd35Mf4nvGJwoVT8a9pRvOTfOmGmAIVkdg72v19RORXGm4 SMW/96LppSplesIaAOf3+VrDlaLToHHQU7aG9X9A7ysxhlTfyfaJafmq79f3+5NDwNg== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Hk3CV+w9; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 87858606A32E; Mon, 23 Nov 2026 18:41:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Hk3CV+w9 Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1795459289; b=dQbm51Qaga2rcHEs3PjdI5AbYBKsDLNRvJN3rFPc+MHYf+POgLpHHV74DYikouOJ6r7B ZPo37rIGl74mHbNQIxngIW1saZB/4MzBgc8Z2O6byTO+Kvxa/bXD3+h0kkpVgz5YY9OgY Fa4q8oLiZgW+PLhGsBSnlTQZvFdLHbE+xFM/MkEpQMotIqcNRwlgUxZg7+jZzJmSck5RP olsY5Qz+vX8JRGejhQGHmyg+cYPmRCHsm1oJcWAkQ+hF6KfAk+B5S2Z3j9rF+KSPGkimG JtI/Y4+riPWW/vsr34SPLjzOp9rzhHX2eJHemdO3rD8nzfXaG9lGVGE+OL4Cqc/QRPw== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1795459289; h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=JA1RY4AoQnfSHpB9qDuwptqbpVvMYp1OIFwFo8h5NUs=; b=MZVrVyK7jOsFXCuR104V0N+2SAsmiky+RuGodUc/iv0WR5VLImcvTwlBt3R0wjLaL23+ uSikhuhTt9TdaZ02NJl1ol9mMpvj4Q6yew36Y3NTMGLPsw7bykFMQs1nif7gZE9cRTncv ZBqV+nsBKicn/Wynv8+RQfyd3L/0yZpvfkkEZATDbsiQgycyo2QI+bE7MoftiuBHk+QoE vHvM95jfdXYJ58r6CUIr0K8e/AjBKix8gNtjF4p6IEXHaR2Nq7y+KrsFB56G71cXSyAzC jq4h6WCGY8j/n0i+TfS3AANTK9ztFJnGuNyU0ko5YQfzT5vvKcgCuo9USl8fUBCcSGQ== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 424831F000C0; Mon, 23 Nov 2026 18:41:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795459289; bh=JA1RY4AoQnfSHpB9qDuwptqbpVvMYp1OIFwFo8h5NUs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To; b=Hk3CV+w9++LCKyMaCPgnv5LYLF5e3niV97mXxvfYAkZqw6fJ0+sFTzfmSm5dLTn6+ 1iFH60QQ1p5DfAk2xuaxuEIN8sJfr/98sJ1ILeeAQST0Imr6stFw6PYDJdeeSO1YLk 39xOTTXDhvYUvxOTYegHCPsHSfta/ZTQ/ZzvPa3qMKKAhddAf8EFV9MCVXuG4L0zuH ZB4QEzbk+xFG+Oprz7dyGukEpyL+E43rI/d6+nb5Q52HazSlxvz3G7oW/+Y0G61Jtm UrMVrKc+hxoedG/KDUUIwFExsO4E3hk+E/DPAG5MBn7hG+MegeczGpngQVEvW64M9J 81yaeUpE9hMhw== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id A43704C5BF; Mon, 23 Nov 2026 18:41:13 +0000 (UTC) From: Fil Dunsky via B4 Relay Date: Mon, 23 Nov 2026 21:41:16 +0300 Subject: [PATCH 5/5] MAINTAINERS: Add CS7542 global control support X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Message-Id: <20261123-cs7542-syscon-v1-5-49858e631449@gmail.com> References: <20261123-cs7542-syscon-v1-0-49858e631449@gmail.com> In-Reply-To: <20261123-cs7542-syscon-v1-0-49858e631449@gmail.com> To: Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stephen Boyd , Brian Masney , Jerome Brunet , Linus Walleij Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, Arnd Bergmann X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1795459271; l=1174; i=filipp.dunsky@gmail.com; s=20260930; h=from:subject:message-id; bh=fgWHYLyeGItAI+Z6w73sl393x6RrEmbFL0xFZL+FdhU=; b=sDCjqIa/sgV9CFJOqw4l+bU2+00O+z4TTreM9rs37EA5rtQg1l+SVzAMioWOdf3TXxhV5bRW5 XsCQjqX31txAPMDIQE/gBNNAhnaIQzHvepqsA3/NEyZJvhSzcEmuC27 X-Developer-Key: i=filipp.dunsky@gmail.com; a=ed25519; pk=JAYP8e2rJ54DHOmhNtXud8rl1igAaAXoOHxtJmVXI1g= X-Endpoint-Received: by B4 Relay for filipp.dunsky@gmail.com/20260930 with auth_id=1085 X-Original-From: Fil Dunsky Reply-To: filipp.dunsky@gmail.com Content-Transfer-Encoding: quoted-printable From: Fil Dunsky Track the global control binding, strap clock provider and pin multiplexer independently of the pending platform series. AI assistance: Codex prepared this change from the existing OpenWrt port and GPL vendor sources. Signed-off-by: Fil Dunsky --- MAINTAINERS | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 44540a1eb..d8835aeca 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2949,6 +2949,16 @@ F: tools/perf/tests/shell/coresight/* F: tools/perf/util/cs-etm-decoder/* F: tools/perf/util/cs-etm.* =20 +ARM/CORTINA SYSTEMS CS7542 GLOBAL CONTROL +M: Fil Dunsky +L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) +S: Maintained +F: Documentation/devicetree/bindings/pinctrl/cortina,cs7542-pinctrl.yaml +F: Documentation/devicetree/bindings/soc/cortina/ +F: drivers/clk/clk-cs7542.c +F: drivers/pinctrl/pinctrl-cs7542.c +F: include/dt-bindings/clock/cortina,cs7542-clock.h + ARM/CORTINA SYSTEMS GEMINI ARM ARCHITECTURE M: Hans Ulli Kroll M: Linus Walleij --=20 2.53.0