blob: 3313a0fc27d5795a621d8ef98588355d750f8094 [file] [log] [blame]
Angel Pons182dbde2020-04-02 23:49:05 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
Martin Rothebace9f2018-05-26 18:56:17 -06003
Kyösti Mälkki50c96372014-10-18 07:51:03 +03004#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 Reinauer12bce3f2015-06-18 01:17:38 -070017#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älkki50c96372014-10-18 07:51:03 +030020
21static inline u8 fch_gpio_state(unsigned int gpio_nr)
22{
23 return FCH_GPIO(gpio_nr) >> 7;
24}
25
26#endif