blob: b1f403027dbe377fe2ec6782b4cb409acf67b489 [file] [log] [blame]
Sagar Shrikant Kadam211be3b2019-10-01 10:00:46 -07001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright (C) 2019 SiFive, Inc.
4 */
5
6#ifndef _GPIO_SIFIVE_H
7#define _GPIO_SIFIVE_H
8
9#define GPIO_INPUT_VAL 0x00
10#define GPIO_INPUT_EN 0x04
11#define GPIO_OUTPUT_EN 0x08
12#define GPIO_OUTPUT_VAL 0x0C
13#define GPIO_RISE_IE 0x18
14#define GPIO_RISE_IP 0x1C
15#define GPIO_FALL_IE 0x20
16#define GPIO_FALL_IP 0x24
17#define GPIO_HIGH_IE 0x28
18#define GPIO_HIGH_IP 0x2C
19#define GPIO_LOW_IE 0x30
20#define GPIO_LOW_IP 0x34
21#define GPIO_OUTPUT_XOR 0x40
22
23#define NR_GPIOS 16
24
25enum gpio_state {
26 LOW,
27 HIGH
28};
29
30/* Details about a GPIO bank */
Simon Glassb75b15b2020-12-03 16:55:23 -070031struct sifive_gpio_plat {
Sagar Shrikant Kadam211be3b2019-10-01 10:00:46 -070032 void *base; /* address of registers in physical memory */
33};
34
35#endif /* _GPIO_SIFIVE_H */