summaryrefslogtreecommitdiff
path: root/arch/riscv/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/riscv/include')
-rw-r--r--arch/riscv/include/asm/arch-jh7110/gpio.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/arch-jh7110/gpio.h b/arch/riscv/include/asm/arch-jh7110/gpio.h
index 80675d64de..d83f6d2d9f 100644
--- a/arch/riscv/include/asm/arch-jh7110/gpio.h
+++ b/arch/riscv/include/asm/arch-jh7110/gpio.h
@@ -46,6 +46,27 @@ struct starfive_gpio_platdata {
void *base;
};
+#define SYS_IOMUX_DOEN(gpio, oen) \
+ clrsetbits_le32(SYS_IOMUX_BASE+GPIO_OFFSET(gpio), \
+ GPIO_DOEN_MASK << GPIO_SHIFT(gpio), \
+ (oen) << GPIO_SHIFT(gpio))
+
+#define SYS_IOMUX_DOUT(gpio, gpo) \
+ clrsetbits_le32(SYS_IOMUX_BASE + GPIO_DOUT + GPIO_OFFSET(gpio),\
+ GPIO_DOUT_MASK << GPIO_SHIFT(gpio),\
+ ((gpo) & GPIO_DOUT_MASK) << GPIO_SHIFT(gpio))
+
+#define SYS_IOMUX_DIN(gpio, gpi)\
+ clrsetbits_le32(SYS_IOMUX_BASE + GPIO_DIN + GPIO_OFFSET(gpi),\
+ GPIO_DIN_MASK << GPIO_SHIFT(gpi),\
+ ((gpio+2) & GPIO_DIN_MASK) << GPIO_SHIFT(gpi))
+
+#define SYS_IOMUX_COMPLEX(gpio, gpi, gpo, oen) do {\
+ SYS_IOMUX_DOEN(gpio, oen);\
+ SYS_IOMUX_DOUT(gpio, gpo);\
+ SYS_IOMUX_DIN(gpio, gpi); \
+ } while (0)
+
#ifdef __cplusplus
}
#endif