coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
gpio.h File Reference
#include <soc/addressmap.h>
#include <soc/gpio_common.h>
#include <types.h>
Include dependency graph for gpio.h:

Go to the source code of this file.

Data Structures

struct  val_regs
 
struct  gpio_regs
 

Macros

#define GPIO_NUM   185
 
#define PIN(id, name, flag, bit, base, offset, func1, func2, func3, func4, func5, func6, func7)
 
#define GPIO(name)
 

Enumerations

enum  { MAX_GPIO_REG_BITS = 32 , MAX_GPIO_MODE_PER_REG = 8 , GPIO_MODE_BITS = 4 }
 
enum  gpio_drv {
  GPIO_DRV_2_MA = 0 , GPIO_DRV_4_MA = 1 , GPIO_DRV_6_MA = 2 , GPIO_DRV_8_MA = 3 ,
  GPIO_DRV_10_MA = 4 , GPIO_DRV_12_MA = 5 , GPIO_DRV_14_MA = 6 , GPIO_DRV_16_MA = 7
}
 
enum  {
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN , PIN , PIN , PIN ,
  PIN
}
 

Functions

 check_member (gpio_regs, mode[27].val, 0x4b0)
 
 check_member (gpio_regs, dram_pinmux_trapping, 0x6f0)
 

Variables

static struct gpio_regs *const mtk_gpio = (void *)(GPIO_BASE)
 

Macro Definition Documentation

◆ GPIO

#define GPIO (   name)
Value:
((gpio_t){ \
.id = PAD_##name##_ID, \
.flag = PAD_##name##_FLAG, \
.bit = PAD_##name##_BIT, \
.base = PAD_##name##_BASE, \
.offset = PAD_##name##_OFFSET \
})
const char * name
Definition: mmu.c:92
uint32_t gpio_t
Definition: gpio.h:9

Definition at line 49 of file gpio.h.

◆ GPIO_NUM

#define GPIO_NUM   185

Definition at line 15 of file gpio.h.

◆ PIN

#define PIN (   id,
  name,
  flag,
  bit,
  base,
  offset,
  func1,
  func2,
  func3,
  func4,
  func5,
  func6,
  func7 
)
Value:
PAD_##name##_ID = id, \
PAD_##name##_FLAG = flag, \
PAD_##name##_BIT = bit, \
PAD_##name##_BASE = base, \
PAD_##name##_OFFSET = offset, \
PAD_##name##_FUNC_##func1 = 1, \
PAD_##name##_FUNC_##func2 = 2, \
PAD_##name##_FUNC_##func3 = 3, \
PAD_##name##_FUNC_##func4 = 4, \
PAD_##name##_FUNC_##func5 = 5, \
PAD_##name##_FUNC_##func6 = 6, \
PAD_##name##_FUNC_##func7 = 7
static size_t offset
Definition: flashconsole.c:16
uintptr_t base
Definition: uart.c:17

Definition at line 34 of file gpio.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAX_GPIO_REG_BITS 
MAX_GPIO_MODE_PER_REG 
GPIO_MODE_BITS 

Definition at line 17 of file gpio.h.

◆ anonymous enum

anonymous enum
Enumerator
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 
PIN 

Definition at line 57 of file gpio.h.

◆ gpio_drv

enum gpio_drv
Enumerator
GPIO_DRV_2_MA 
GPIO_DRV_4_MA 
GPIO_DRV_6_MA 
GPIO_DRV_8_MA 
GPIO_DRV_10_MA 
GPIO_DRV_12_MA 
GPIO_DRV_14_MA 
GPIO_DRV_16_MA 

Definition at line 23 of file gpio.h.

Function Documentation

◆ check_member() [1/2]

check_member ( gpio_regs  ,
dram_pinmux_trapping  ,
0x6f0   
)

◆ check_member() [2/2]

check_member ( gpio_regs  ,
mode.  val[27],
0x4b0   
)

Variable Documentation

◆ mtk_gpio

struct gpio_regs* const mtk_gpio = (void *)(GPIO_BASE)
static

Definition at line 637 of file gpio.h.