diff options
author | Tom Rini <trini@konsulko.com> | 2021-05-31 10:19:14 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-05-31 10:19:14 -0400 |
commit | d8729a114e1e98806cffb87d2dca895f99a0170a (patch) | |
tree | 5a42400633c76de4ca80df0bb835fad0d181078a /arch/riscv/include/asm/arch-fu740/gpio.h | |
parent | fa68645b948969cd9d6f40d19323ebe7c998f419 (diff) | |
parent | d7da718bd94943309a7f25f14e694226a45b2aef (diff) |
Merge https://source.denx.de/u-boot/custodians/u-boot-riscv
- SiFive FU740 and Unmatched support
Diffstat (limited to 'arch/riscv/include/asm/arch-fu740/gpio.h')
-rw-r--r-- | arch/riscv/include/asm/arch-fu740/gpio.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/arch-fu740/gpio.h b/arch/riscv/include/asm/arch-fu740/gpio.h new file mode 100644 index 0000000000..908e2e5563 --- /dev/null +++ b/arch/riscv/include/asm/arch-fu740/gpio.h @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2020-2021 SiFive, Inc. + */ + +#ifndef _GPIO_SIFIVE_H +#define _GPIO_SIFIVE_H + +#define GPIO_INPUT_VAL 0x00 +#define GPIO_INPUT_EN 0x04 +#define GPIO_OUTPUT_EN 0x08 +#define GPIO_OUTPUT_VAL 0x0C +#define GPIO_RISE_IE 0x18 +#define GPIO_RISE_IP 0x1C +#define GPIO_FALL_IE 0x20 +#define GPIO_FALL_IP 0x24 +#define GPIO_HIGH_IE 0x28 +#define GPIO_HIGH_IP 0x2C +#define GPIO_LOW_IE 0x30 +#define GPIO_LOW_IP 0x34 +#define GPIO_OUTPUT_XOR 0x40 + +#define NR_GPIOS 16 + +enum gpio_state { + LOW, + HIGH +}; + +/* Details about a GPIO bank */ +struct sifive_gpio_plat { + void *base; /* address of registers in physical memory */ +}; + +#define SIFIVE_GENERIC_GPIO_NR(port, index) \ + (((port) * NR_GPIOS) + ((index) & (NR_GPIOS - 1))) + +#endif /* _GPIO_SIFIVE_H */ |