From patchwork Wed Aug 28 11:30:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yixun Lan X-Patchwork-Id: 823245 Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 0B3281741D9; Wed, 28 Aug 2024 11:31:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724844682; cv=none; b=W/9P+EmV2F6knpyhAkcipJ+WPwaf4NFShF7tE61M8BZMwpyd4Ht/c30xBIXuqQ3WGG4d76mIJbcnEiD6YyeHADQY9iB4Q6iyIRBHA8yD4F16JXdbFJJvVyL6uVXid3JPmzLIogRtfFQ/65ScnrDok7eSsRDfChsfBaPBRos8yw8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724844682; c=relaxed/simple; bh=EhXdvTJICZ/CPHgBVnkqp92mbVQd/cH/vOKFkcWHcAI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YeMUAIBCvkBkrgqo8FNwwUr0iruHO8RT98e3ZQSGZYz6Y3Crx4iovUPEjmXIUZmXLlzYyAv17WHCxbQacY35ACmhqROBXLOyVANoYtc6AzTjHEzGninV7yowCJKFq7jpZcw/TOvBMHsscd6UqLralOHV6RANig9mWq/cKYvY0dc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gentoo.org; spf=pass smtp.mailfrom=gentoo.org; arc=none smtp.client-ip=140.211.166.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gentoo.org From: Yixun Lan Date: Wed, 28 Aug 2024 11:30:23 +0000 Subject: [PATCH v3 1/4] dt-bindings: pinctrl: spacemit: add support for K1 SoC Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240828-02-k1-pinctrl-v3-1-1fed6a22be98@gentoo.org> References: <20240828-02-k1-pinctrl-v3-0-1fed6a22be98@gentoo.org> In-Reply-To: <20240828-02-k1-pinctrl-v3-0-1fed6a22be98@gentoo.org> To: Linus Walleij , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley Cc: Yangyu Chen , Jesse Taube , Jisheng Zhang , Inochi Amaoto , Icenowy Zheng , Meng Zhang , Meng Zhang , devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Yixun Lan X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=4318; i=dlan@gentoo.org; h=from:subject:message-id; bh=EhXdvTJICZ/CPHgBVnkqp92mbVQd/cH/vOKFkcWHcAI=; b=owEBzQIy/ZANAwAKATGq6kdZTbvtAcsmYgBmzwp0rycktKHFvryD1vu55Ph4DoP4jJjOWQB5m BI0bYTLHa6JApMEAAEKAH0WIQS1urjJwxtxFWcCI9wxqupHWU277QUCZs8KdF8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0QjVCQUI4QzlDMzF CNzExNTY3MDIyM0RDMzFBQUVBNDc1OTREQkJFRAAKCRAxqupHWU277TMkD/9o5DemKkC5q2PP/p NDonyaDiLDDGYD0ku3QGS5SUuA0bkvC65Pzokq5Xxvh2WH5VpFxwSW4NL8IPjfe8hx2gt/TRQ4R l0rQbiH0sUfSj5OM+N7G00CusSkDXL3Vz2ZsVUuXA1tZdvMZOHgp0ZIE0MjmC/sdKL8cEyu+Yf2 N+rJbfXlmoOnKYo/fUu2FjmZ9cqkvyXdxtyJfUpFf332h5wl68nOFRFkwk0bTD5HPJajTcRqakJ WWU/DCC/Nzx80CDdJGQgyZuupyPPJbWLF2ROaSYMtlnCFhMBqohfJjDTVoBC8xHClvlSlDeh45i u1KUCuJJdx5J+nZM7VUMC8jEf0UDloKvYvGxEWRuBr1wF/I3/E2xGXM07VvFicYljEScwUoTR6Y 2o7OGgxv6X76sQriSHaiY8ofzdr+mn3G4YTWlLjkwtOhQ4P+Ef4fV8noxYTbo9hBV+ObKbZ3Pdy /yblC2Yz649oR2MRUghcC/R7JK9Vdi0f46Mi8cmR9xFde7BBurezz51yM7l/CfdmEVaXaxCA/S8 WA5wKBz3UNX7JunrfoB5Mw6aowQHCBLJbTe7wWjnbGgN8nucy6Q02ppsZT21p2xHOxiUGugBefx lfBh4Wp11ia9h6iEFexcyeFMrgmNTn4M54k66dThp1zbcZAO2eek4ESPXV4gV1AmQ1Yg== X-Developer-Key: i=dlan@gentoo.org; a=openpgp; fpr=50B03A1A5CBCD33576EF8CD7920C0DBCAABEFD55 Add dt-bindings for the pinctrl driver of SpacemiT's K1 SoC. Signed-off-by: Yixun Lan Reviewed-by: Rob Herring (Arm) --- Changes in v3: - drop spacemit,slew-rate-{enable,disable} property - use drive-strength instead of drive-strength-microamp - fold strong-pull-up into bias-pull-up - format fixed - title fixed --- .../bindings/pinctrl/spacemit,k1-pinctrl.yaml | 127 +++++++++++++++++++++ 1 file changed, 127 insertions(+) diff --git a/Documentation/devicetree/bindings/pinctrl/spacemit,k1-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/spacemit,k1-pinctrl.yaml new file mode 100644 index 0000000000000..166e529b54b27 --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/spacemit,k1-pinctrl.yaml @@ -0,0 +1,127 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pinctrl/spacemit,k1-pinctrl.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SpacemiT K1 SoC Pin Controller + +maintainers: + - Yixun Lan + +properties: + compatible: + const: spacemit,k1-pinctrl + + reg: + items: + - description: pinctrl io memory base + +patternProperties: + '-cfg$': + type: object + additionalProperties: false + + description: + A pinctrl node should contain at least one subnode representing the + pinctrl groups available on the machine. + + patternProperties: + '-pins$': + type: object + additionalProperties: false + + description: + Each subnode will list the pins it needs, and how they should + be configured, with regard to muxer configuration, bias pull, + drive strength, input schmitt trigger, slew rate, power source. + + allOf: + - $ref: pincfg-node.yaml# + - $ref: pinmux-node.yaml# + + properties: + pinmux: + description: + The list of GPIOs and their mux settings that properties in the + node apply to. This should be set using the K1_PADCONF macro to + construct the value. + + bias-disable: true + + bias-pull-down: true + + bias-pull-up: + description: | + typical value for selecting bias pull up or strong pull up. + 0: normal bias pull up + 1: strong bias pull up + enum: [ 0, 1 ] + + drive-strength: + description: | + typical current when output high level. + 1.8V output: 11, 21, 32, 42 (mA) + 3.3V output: 7, 10, 13, 16, 19, 23, 26, 29 (mA) + + input-schmitt: + description: | + typical threshold for schmitt trigger. + 0: buffer mode + 1: trigger mode + 2, 3: trigger mode + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [ 0, 1, 2, 3 ] + + power-source: + description: external power supplies at 1.8v or 3.3v. + enum: [ 1800, 3300 ] + + slew-rate: + description: | + slew rate for output buffer. + 0: disable it + 1: enable it (via bundled value from drive strength) + 2: slow speed 0 + 3: slow speed 1 + 4: medium speed + 5: fast speed + enum: [ 0, 1, 2, 3, 4, 5 ] + + required: + - pinmux + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + #define GPIO_68 69 + #define GPIO_69 70 + + #define K1_PADCONF(pin, func) (((pin) << 16) | (func)) + + soc { + #address-cells = <2>; + #size-cells = <2>; + + pinctrl@d401e000 { + compatible = "spacemit,k1-pinctrl"; + reg = <0x0 0xd401e000 0x0 0x400>; + + uart0_2_cfg: uart0-2-cfg { + uart0-2-pins { + pinmux = , + ; + + bias-pull-up = <0>; + drive-strength = <32>; + }; + }; + }; + }; + +...