devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/4] riscv: spacemit: add gpio support for K1 SoC
@ 2025-01-21  3:38 Yixun Lan
  2025-01-21  3:38 ` [PATCH v4 1/4] dt-bindings: gpio: spacemit: add " Yixun Lan
                   ` (3 more replies)
  0 siblings, 4 replies; 27+ messages in thread
From: Yixun Lan @ 2025-01-21  3:38 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt
  Cc: Yangyu Chen, Jisheng Zhang, Jesse Taube, Inochi Amaoto,
	Icenowy Zheng, Meng Zhang, linux-gpio, devicetree, linux-kernel,
	linux-riscv, Yixun Lan

The gpio controller of K1 support basic GPIO functions,
which capable of enabling as input, output. It can also be used
as GPIO interrupt which able to detect rising edge, falling edge,
or both. There are four GPIO ports, each consisting of 32 pins and
has indepedent register sets, while still sharing IRQ line and clocks.

The GPIO controller request the clock source from APBC block,
In this series, I haven't added the clock support, but plan
to fix it after clock driver is merged.

Due to first three GPIO ports has interleave register settings, some
resources (IRQ, clock) are shared by all pins, so all GPIO ports have
been organized as sub nodes in the device tree.

The GPIO docs of K1 SoC can be found here, chapter 16.4 GPIO [1]

Note, this patch is based on 'for-next' branch of SpacemiT's SoC tree [4],
due to there is DT dependency.

This patch series has been tested on Bananapi-F3 board,
with following GPIO cases passed:
 1) gpio input
 2) gpio output - set to high, low
 3) gpio interrupt - rising trigger, falling trigger, both edge trigger

Link: https://developer.spacemit.com/documentation?token=Rn9Kw3iFHirAMgkIpTAcV2Arnkf [1]
Link: https://lore.kernel.org/all/20240730-k1-01-basic-dt-v5-0-98263aae83be@gentoo.org [2]
Link: https://lore.kernel.org/all/20241016-02-k1-pinctrl-v5-0-03d395222e4f@gentoo.org/ [3]
Link: https://github.com/spacemit-com/linux [4]
Signed-off-by: Yixun Lan <dlan@gentoo.org>
---
Changes in v4:
- gpio: re-construct gpio as four independent ports, also leverage gpio mmio API
- gpio interrupt: convert to generic gpio irqchip
- Link to v3: https://lore.kernel.org/r/20241225-03-k1-gpio-v3-0-27bb7b441d62@gentoo.org

Changes in v3:
- dt: drop ranges, interrupt-names property
- Link to v2: https://lore.kernel.org/r/20241219-03-k1-gpio-v2-0-28444fd221cd@gentoo.org

Changes in v2:
- address dt-bindings comments, simplify example
- rebase to 6.13-rc3 
- Link to v1: https://lore.kernel.org/r/20240904-03-k1-gpio-v1-0-6072ebeecae0@gentoo.org

---
Yixun Lan (4):
      dt-bindings: gpio: spacemit: add support for K1 SoC
      gpio: spacemit: add support for K1 SoC
      riscv: dts: spacemit: add gpio support for K1 SoC
      riscv: dts: spacemit: add gpio LED for system heartbeat

 .../devicetree/bindings/gpio/spacemit,k1-gpio.yaml | 116 ++++++++
 arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts    |  11 +
 arch/riscv/boot/dts/spacemit/k1.dtsi               |  55 ++++
 drivers/gpio/Kconfig                               |   7 +
 drivers/gpio/Makefile                              |   1 +
 drivers/gpio/gpio-spacemit-k1.c                    | 295 +++++++++++++++++++++
 6 files changed, 485 insertions(+)
---
base-commit: 3d72d603afa72082501e9076eed61e0531339ef8
change-id: 20240828-03-k1-gpio-61bf92f9032c

Best regards,
-- 
Yixun Lan


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2025-02-18 10:59 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-21  3:38 [PATCH v4 0/4] riscv: spacemit: add gpio support for K1 SoC Yixun Lan
2025-01-21  3:38 ` [PATCH v4 1/4] dt-bindings: gpio: spacemit: add " Yixun Lan
2025-01-22 20:03   ` Olof Johansson
2025-01-23 11:30     ` Yixun Lan
2025-01-23 23:19       ` Olof Johansson
2025-01-27 18:17         ` Rob Herring
2025-01-28  3:17           ` Yixun Lan
2025-01-28 16:03             ` Linus Walleij
2025-01-28 16:58               ` Rob Herring
2025-01-28 18:50                 ` Samuel Holland
2025-02-06  9:18               ` Linus Walleij
2025-02-06 10:39                 ` Yixun Lan
2025-02-06 13:31                 ` Yixun Lan
2025-02-13 13:07                   ` Linus Walleij
2025-02-14 11:54                     ` Yixun Lan
2025-02-14 13:08                       ` Yixun Lan
2025-02-18  9:44                       ` Linus Walleij
2025-02-18  9:55                         ` Yixun Lan
2025-02-18 10:17                           ` Linus Walleij
2025-02-18 10:59                             ` Yixun Lan
2025-01-28 15:47           ` Linus Walleij
2025-01-21  3:38 ` [PATCH v4 2/4] " Yixun Lan
2025-02-07 10:56   ` Yixun Lan
2025-02-15 21:11   ` Alex Elder
2025-02-16 12:56     ` Yixun Lan
2025-01-21  3:38 ` [PATCH v4 3/4] riscv: dts: spacemit: add gpio " Yixun Lan
2025-01-21  3:38 ` [PATCH v4 4/4] riscv: dts: spacemit: add gpio LED for system heartbeat Yixun Lan

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).