coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
chromeos.c File Reference
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <ec/google/chromeec/ec.h>
#include <ec/google/chromeec/ec_commands.h>
#include <gpio.h>
#include "board.h"
Include dependency graph for chromeos.c:

Go to the source code of this file.

Macros

#define GPIO_WP   GPIO(7, A, 6)
 
#define GPIO_LID   GPIO(0, A, 6)
 
#define GPIO_POWER   GPIO(0, A, 5)
 
#define GPIO_RECOVERY   GPIO(0, B, 1)
 
#define GPIO_ECINRW   GPIO(0, A, 7)
 
#define GPIO_ECIRQ   GPIO(7, A, 7)
 

Functions

void setup_chromeos_gpios (void)
 
void fill_lb_gpios (struct lb_gpios *gpios)
 
int get_recovery_mode_switch (void)
 HACK: Use Fn-Key as recovery mode switch. More...
 
int get_write_protect_state (void)
 Only used if CONFIG(CHROMEOS) is set. More...
 
int get_ec_is_trusted (void)
 

Macro Definition Documentation

◆ GPIO_ECINRW

#define GPIO_ECINRW   GPIO(0, A, 7)

Definition at line 15 of file chromeos.c.

◆ GPIO_ECIRQ

#define GPIO_ECIRQ   GPIO(7, A, 7)

Definition at line 16 of file chromeos.c.

◆ GPIO_LID

#define GPIO_LID   GPIO(0, A, 6)

Definition at line 12 of file chromeos.c.

◆ GPIO_POWER

#define GPIO_POWER   GPIO(0, A, 5)

Definition at line 13 of file chromeos.c.

◆ GPIO_RECOVERY

#define GPIO_RECOVERY   GPIO(0, B, 1)

Definition at line 14 of file chromeos.c.

◆ GPIO_WP

#define GPIO_WP   GPIO(7, A, 6)

Definition at line 11 of file chromeos.c.

Function Documentation

◆ fill_lb_gpios()

void fill_lb_gpios ( struct lb_gpios gpios)

Definition at line 27 of file chromeos.c.

References ACTIVE_HIGH, ACTIVE_LOW, ARRAY_SIZE, get_recovery_mode_switch(), GPIO_BACKLIGHT, GPIO_ECINRW, GPIO_ECIRQ, GPIO_LID, GPIO_POWER, GPIO_RECOVERY, GPIO_RESET, and lb_add_gpios().

Here is the call graph for this function:

◆ get_ec_is_trusted()

int get_ec_is_trusted ( void  )

Definition at line 60 of file chromeos.c.

References GPIO_ECINRW, and gpio_get().

Here is the call graph for this function:

◆ get_recovery_mode_switch()

int get_recovery_mode_switch ( void  )

HACK: Use Fn-Key as recovery mode switch.

Wait for sense register ready and read Fn-Key state.

Definition at line 42 of file chromeos.c.

References EC_HOST_EVENT_KEYBOARD_RECOVERY, EC_HOST_EVENT_MASK, google_chromeec_get_events_b(), gpio_get(), and GPIO_RECOVERY.

Here is the call graph for this function:

◆ get_write_protect_state()

int get_write_protect_state ( void  )

Only used if CONFIG(CHROMEOS) is set.

Always zero as the WP pin of the flash is tied high.

Definition at line 55 of file chromeos.c.

References gpio_get(), and GPIO_WP.

Here is the call graph for this function:

◆ setup_chromeos_gpios()

void setup_chromeos_gpios ( void  )

Definition at line 18 of file chromeos.c.

References GPIO_ECIRQ, gpio_input(), gpio_input_pullup(), GPIO_LID, GPIO_POWER, GPIO_RECOVERY, and GPIO_WP.

Here is the call graph for this function: