soc: Remove copyright notices
[coreboot.git] / src / soc / rockchip / rk3288 / gpio.c
blob4df0227fc009515ed807b099808962ec3beb43b0
1 /*
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.
15 #include <gpio.h>
16 #include <soc/gpio.h>
17 #include <soc/grf.h>
18 #include <soc/pmu.h>
19 #include <soc/soc.h>
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)
38 return 1;
39 return 0;
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 */
53 return pull;