mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
riscv: dts: spacemit: add gpio support for K1 SoC
Populate the GPIO node in the device tree for SpacemiT K1 SoC. Each of 32 pins will act as one bank and map pins to pinctrl controller. Link: https://lore.kernel.org/r/20250424-03-k1-gpio-v9-2-eaece8cc5a86@gentoo.org Signed-off-by: Yixun Lan <dlan@gentoo.org>
This commit is contained in:
parent
3b2802c2d6
commit
5933312899
2 changed files with 21 additions and 0 deletions
|
@ -7,6 +7,9 @@
|
|||
|
||||
#define K1_PADCONF(pin, func) (((pin) << 16) | (func))
|
||||
|
||||
/* Map GPIO pin to each bank's <index, offset> */
|
||||
#define K1_GPIO(x) (x / 32) (x % 32)
|
||||
|
||||
&pinctrl {
|
||||
uart0_2_cfg: uart0-2-cfg {
|
||||
uart0-2-pins {
|
||||
|
|
|
@ -465,6 +465,24 @@
|
|||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio: gpio@d4019000 {
|
||||
compatible = "spacemit,k1-gpio";
|
||||
reg = <0x0 0xd4019000 0x0 0x100>;
|
||||
clocks = <&syscon_apbc CLK_GPIO>,
|
||||
<&syscon_apbc CLK_GPIO_BUS>;
|
||||
clock-names = "core", "bus";
|
||||
gpio-controller;
|
||||
#gpio-cells = <3>;
|
||||
interrupts = <58>;
|
||||
interrupt-parent = <&plic>;
|
||||
interrupt-controller;
|
||||
#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>;
|
||||
};
|
||||
|
||||
pinctrl: pinctrl@d401e000 {
|
||||
compatible = "spacemit,k1-pinctrl";
|
||||
reg = <0x0 0xd401e000 0x0 0x400>;
|
||||
|
|
Loading…
Add table
Reference in a new issue