coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
gpio_oem.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef _CIMX_SB_GPIO_OEM_H_
4 #define _CIMX_SB_GPIO_OEM_H_
5 
6 #define SB_GPIO_REG02 2
7 #define SB_GPIO_REG09 9
8 #define SB_GPIO_REG10 10
9 #define SB_GPIO_REG15 15
10 #define SB_GPIO_REG17 17
11 #define SB_GPIO_REG21 21
12 #define SB_GPIO_REG25 25
13 #define SB_GPIO_REG28 28
14 
15 /* FCH GPIO access helpers */
16 #define FCH_IOMUX(gpio_nr) (*(u8*)((uintptr_t)ACPI_MMIO_BASE+IOMUX_BASE+(gpio_nr)))
17 #define FCH_PMIO(reg_nr) (*(u8*)((uintptr_t)ACPI_MMIO_BASE+PMIO_BASE+(reg_nr)))
18 #define FCH_GPIO(gpio_nr) (*(volatile u8*)((uintptr_t)ACPI_MMIO_BASE+GPIO_BASE+(gpio_nr)))
19 
20 static inline u8 fch_gpio_state(unsigned int gpio_nr)
21 {
22  return FCH_GPIO(gpio_nr) >> 7;
23 }
24 
25 #endif
static u8 fch_gpio_state(unsigned int gpio_nr)
Definition: gpio_oem.h:20
#define FCH_GPIO(gpio_nr)
Definition: gpio_oem.h:18
uint8_t u8
Definition: stdint.h:45