From patchwork Sun Feb 23 11:49:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yixun Lan X-Patchwork-Id: 13986967 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6CFD8C021B3 for ; Sun, 23 Feb 2025 11:50:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:In-Reply-To:References:Message-Id: MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jKrB7RSygnNAk7ylX4NFYhOUYcRoMat7TdiiaIU7T0Q=; b=QRFM7eD9RpJSQ+ tt/PdTfdWyo1aspFCUThp30paRW3rokwd+LFvWBZ47nbVIQrKovVypSxpSqoJzvXqy2mGCpetE0cd ghUOgF103OTb8Mz4HsE2OgPZGcoIVEewkREQZqJHiwu8yPz4+MD+Y1LJttPneryR4h21BL/uazP2Q FH+3qRD+zG3A2heQNDVnuC4mMoRGh2yhArJqQCI4GkXqgVDZTCn3MlPNX1yzH/OlnK+D62NeX3WFd m7KMkMiS5UGDAupGunRjl0AdmemvNpIU2bK+GzfrBdfPoHv7R8H9hOvBxvIsT0wPdIvBR0x1HhVKy GukWdnpQnIBUccEGyJ6Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tmAV6-0000000B1Vd-1EKV; Sun, 23 Feb 2025 11:50:24 +0000 Received: from woodpecker.gentoo.org ([140.211.166.183] helo=smtp.gentoo.org) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tmAV4-0000000B1Uh-0Mac for linux-riscv@lists.infradead.org; Sun, 23 Feb 2025 11:50:23 +0000 Received: from [127.0.0.1] (unknown [180.172.118.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dlan) by smtp.gentoo.org (Postfix) with ESMTPSA id B556B34317F; Sun, 23 Feb 2025 11:50:15 +0000 (UTC) From: Yixun Lan Date: Sun, 23 Feb 2025 19:49:32 +0800 Subject: [PATCH v6 1/4] dt-bindings: gpio: spacemit: add support for K1 SoC MIME-Version: 1.0 Message-Id: <20250223-03-k1-gpio-v6-1-db2e4adeef1c@gentoo.org> References: <20250223-03-k1-gpio-v6-0-db2e4adeef1c@gentoo.org> In-Reply-To: <20250223-03-k1-gpio-v6-0-db2e4adeef1c@gentoo.org> To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Conor Dooley , Paul Walmsley , Palmer Dabbelt X-Mailer: b4 0.15-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=2918; i=dlan@gentoo.org; h=from:subject:message-id; bh=Kk9p+piWnXTCMsCpvXWiYvyWsBN2vniQaFGG+k7h9zM=; b=owEBzQIy/ZANAwAKATGq6kdZTbvtAcsmYgBnuwtjYecUQo843P6AskonOScZM0vFHwMau0n9I bbPmh8Zg/uJApMEAAEKAH0WIQS1urjJwxtxFWcCI9wxqupHWU277QUCZ7sLY18UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0QjVCQUI4QzlDMzF CNzExNTY3MDIyM0RDMzFBQUVBNDc1OTREQkJFRAAKCRAxqupHWU277S0GD/9ZoXb1J3VtYCjmPf +8sf3AwK4bEwBUstAw2Vs+EcQbaeE1j/FOSDHaNIukPSYyF6Hs9dfLN2U/IdOAAvFJ7DK51cUma 3mx2D4TgG1xremHQpxUco3tRU7x5UVKS7XUx/c7k5ZdYwYDbzvPqRWypnKMA1owGxhveShu75+u vvFxo841qATsB13DEaC/bRiDTJl/S7v7guE5pveMBMePhE7R27uTmvs8KCYaq9nyMkXZ3oriyFM BHQ2aE3Qww+Ph49Olxt19ckUbYWhiuu5YWnFAl4N/hkzaFAk3ysGTuN7Cq8rxqtXMA46gJ/tdxf GVNOhFXcih8ME1axGumuJMZj4vt5WF8nSL3+be9yEw0tOvuC9hgiokL7vb33iJYu/gCC9YAftcy M4C50+7PM3BXLOqt8I2fVmKXI+B4uAxL/hDcjtFU0Mtjm6yQt5hdekVggc2Nns0ux4zJziOQ0Pl 4k4AFMyEWYeuS9lYf9qjAMIwPemtvB/uE7taLj9lQ8kGgZI/XKkMDxHxuzmpkdwJHaeQSKT5Zw0 9pYYYMD9zEu0aO+NrZ1fwmmNGpdY0V9WqQSOfZP/fBoz/fIBwfSxUd0enOTUlyw9yrPmKBrlMGF 5vXROWhbBu5LuyZyDwrohU20q9QkhmddlyUQiWAAfjau5liSJYeaBP4gGryo0ksP6t8A== X-Developer-Key: i=dlan@gentoo.org; a=openpgp; fpr=50B03A1A5CBCD33576EF8CD7920C0DBCAABEFD55 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250223_035022_157604_16049D20 X-CRM114-Status: GOOD ( 12.49 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Meng Zhang , Yixun Lan , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Jesse Taube , Yangyu Chen , Inochi Amaoto , Jisheng Zhang , linux-riscv@lists.infradead.org, spacemit@lists.linux.dev Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The GPIO controller of K1 support basic functions as input/output, all pins can be used as interrupt which route to one IRQ line, trigger type can be select between rising edge, falling edge, or both. There are four GPIO banks, each consisting of 32 pins. Signed-off-by: Yixun Lan --- .../devicetree/bindings/gpio/spacemit,k1-gpio.yaml | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/Documentation/devicetree/bindings/gpio/spacemit,k1-gpio.yaml b/Documentation/devicetree/bindings/gpio/spacemit,k1-gpio.yaml new file mode 100644 index 0000000000000000000000000000000000000000..017165d325565a6868700a9ac8298b61dffcfef4 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/spacemit,k1-gpio.yaml @@ -0,0 +1,81 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/spacemit,k1-gpio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SpacemiT K1 GPIO controller + +maintainers: + - Yixun Lan + +description: + The controller's registers are organized as sets of eight 32-bit + registers with each set of port controlling 32 pins. A single + interrupt line is shared for all of the pins by the controller. + +properties: + $nodename: + pattern: "^gpio@[0-9a-f]+$" + + compatible: + const: spacemit,k1-gpio + + reg: + maxItems: 1 + + gpio-controller: true + + "#gpio-cells": + const: 3 + description: + The first two cells are the GPIO bank index and offset inside the bank, + the third cell should specify GPIO flag. + + gpio-ranges: true + + interrupts: + maxItems: 1 + + interrupt-controller: true + + "#interrupt-cells": + const: 3 + description: + The first two cells are the GPIO bank index and offset inside the bank, + the third cell should specify interrupt flag. The controller does not + support level interrupts, so flags of IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_LOW + should not be used. Refer for valid flags. + +required: + - compatible + - reg + - gpio-controller + - "#gpio-cells" + - interrupts + - interrupt-controller + - "#interrupt-cells" + - gpio-ranges + +additionalProperties: false + +dependencies: + interrupt-controller: [ interrupts ] + +examples: + - | + gpio: gpio@d4019000 { + compatible = "spacemit,k1-gpio"; + reg = <0xd4019000 0x800>; + gpio-controller; + #gpio-cells = <3>; + interrupts = <58>; + interrupt-controller; + interrupt-parent = <&plic>; + #interrupt-cells = <3>; + gpio-ranges = <&pinctrl 0 0 0 32>, + <&pinctrl 1 0 32 32>, + <&pinctrl 2 0 64 32>, + <&pinctrl 3 0 96 32>; + }; +...