Angel Pons | 182dbde | 2020-04-02 23:49:05 +0200 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
Martin Roth | ebace9f | 2018-05-26 18:56:17 -0600 | [diff] [blame] | 3 | |
Kyösti Mälkki | 50c9637 | 2014-10-18 07:51:03 +0300 | [diff] [blame] | 4 | #ifndef _CIMX_SB_GPIO_OEM_H_ |
| 5 | #define _CIMX_SB_GPIO_OEM_H_ |
| 6 | |
| 7 | #define SB_GPIO_REG02 2 |
| 8 | #define SB_GPIO_REG09 9 |
| 9 | #define SB_GPIO_REG10 10 |
| 10 | #define SB_GPIO_REG15 15 |
| 11 | #define SB_GPIO_REG17 17 |
| 12 | #define SB_GPIO_REG21 21 |
| 13 | #define SB_GPIO_REG25 25 |
| 14 | #define SB_GPIO_REG28 28 |
| 15 | |
| 16 | /* FCH GPIO access helpers */ |
Stefan Reinauer | 12bce3f | 2015-06-18 01:17:38 -0700 | [diff] [blame] | 17 | #define FCH_IOMUX(gpio_nr) (*(u8*)((uintptr_t)ACPI_MMIO_BASE+IOMUX_BASE+(gpio_nr))) |
| 18 | #define FCH_PMIO(reg_nr) (*(u8*)((uintptr_t)ACPI_MMIO_BASE+PMIO_BASE+(reg_nr))) |
| 19 | #define FCH_GPIO(gpio_nr) (*(volatile u8*)((uintptr_t)ACPI_MMIO_BASE+GPIO_BASE+(gpio_nr))) |
Kyösti Mälkki | 50c9637 | 2014-10-18 07:51:03 +0300 | [diff] [blame] | 20 | |
| 21 | static inline u8 fch_gpio_state(unsigned int gpio_nr) |
| 22 | { |
| 23 | return FCH_GPIO(gpio_nr) >> 7; |
| 24 | } |
| 25 | |
| 26 | #endif |