coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
gpio.h File Reference
#include <stdint.h>
#include <soc/addressmap.h>
#include <soc/gpio_common.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 PIN(id, name, func1, func2, func3, func4, func5, func6, func7)
 
#define GPIO(name)   ((gpio_t){.id = PAD_##name##_ID})
 

Enumerations

enum  { MAX_GPIO_REG_BITS = 16 , MAX_GPIO_MODE_PER_REG = 5 , GPIO_MODE_BITS = 3 }
 
enum  external_power { GPIO_EINT_3P3V = 0 , GPIO_EINT_1P8V = 1 }
 
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
}
 

Functions

 check_member (gpio_regs, msdc2_ctrl5, 0xcb0)
 
 check_member (gpio_regs, hsic_ctrl[3], 0xe50)
 
void gpio_init (enum external_power)
 

Variables

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

Macro Definition Documentation

◆ GPIO

#define GPIO (   name)    ((gpio_t){.id = PAD_##name##_ID})

Definition at line 30 of file gpio.h.

◆ PIN

#define PIN (   id,
  name,
  func1,
  func2,
  func3,
  func4,
  func5,
  func6,
  func7 
)
Value:
PAD_##name##_ID = id, \
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
const char * name
Definition: mmu.c:92

Definition at line 20 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 9 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 

Definition at line 32 of file gpio.h.

◆ external_power

Enumerator
GPIO_EINT_3P3V 
GPIO_EINT_1P8V 

Definition at line 15 of file gpio.h.

Function Documentation

◆ check_member() [1/2]

check_member ( gpio_regs  ,
hsic_ctrl  [3],
0xe50   
)

◆ check_member() [2/2]

check_member ( gpio_regs  ,
msdc2_ctrl5  ,
0xcb0   
)

◆ gpio_init()

void gpio_init ( enum  external_power)

Definition at line 53 of file gpio_init.c.

References gpio_set_duty(), and set_gpi_from_mipi().

Here is the call graph for this function:

Variable Documentation

◆ mtk_gpio

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