2 * This file is part of the coreboot project.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
21 struct rockchip_gpio_regs
*gpio_port
[] = {
22 (struct rockchip_gpio_regs
*)0xff750000,
23 (struct rockchip_gpio_regs
*)0xff780000,
24 (struct rockchip_gpio_regs
*)0xff790000,
25 (struct rockchip_gpio_regs
*)0xff7a0000,
26 (struct rockchip_gpio_regs
*)0xff7b0000,
27 (struct rockchip_gpio_regs
*)0xff7c0000,
28 (struct rockchip_gpio_regs
*)0xff7d0000,
29 (struct rockchip_gpio_regs
*)0xff7e0000,
30 (struct rockchip_gpio_regs
*)0xff7f0000
33 #define PMU_GPIO_PORT 0
35 int is_pmu_gpio(gpio_t gpio
)
37 if (gpio
.port
== PMU_GPIO_PORT
)
42 void *gpio_grf_reg(gpio_t gpio
)
44 if (is_pmu_gpio(gpio
))
45 return &rk3288_pmu
->gpio0pull
[gpio
.bank
];
46 /* There is one pmu gpio, gpio0, so " - 1" */
47 return &rk3288_grf
->gpio1_p
[(gpio
.port
- 1)][gpio
.bank
];
50 u32
gpio_get_pull_val(gpio_t gpio
, enum gpio_pull pull
)
52 /* use the default gpio pull bias setting defined in soc/gpio.h */