coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
chromeos.c File Reference
#include <boardid.h>
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <console/console.h>
#include <delay.h>
#include <drivers/i2c/ww_ring/ww_ring.h>
#include <gpio.h>
#include <soc/cdp.h>
#include <soc/gsbi.h>
#include <timer.h>
Include dependency graph for chromeos.c:

Go to the source code of this file.

Macros

#define DEV_SW   15
 
#define REC_SW   16
 
#define WP_SW   17
 
#define WIPEOUT_MODE_DELAY_MS   (8 * 1000)
 
#define RECOVERY_MODE_EXTRA_DELAY_MS   (8 * 1000)
 

Enumerations

enum  switch_state {
  not_probed = -1 , no_req , recovery_req , wipeout_req ,
  not_probed = -1 , no_req , recovery_req , wipeout_req
}
 

Functions

static int read_gpio (gpio_t gpio_num)
 
void fill_lb_gpios (struct lb_gpios *gpios)
 
static void display_pattern (int pattern)
 
static enum switch_state get_switch_state (void)
 
int get_recovery_mode_switch (void)
 HACK: Use Fn-Key as recovery mode switch. More...
 
int get_wipeout_mode_switch (void)
 
int get_write_protect_state (void)
 Only used if CONFIG(CHROMEOS) is set. More...
 
int get_ec_is_trusted (void)
 

Macro Definition Documentation

◆ DEV_SW

#define DEV_SW   15

Definition at line 14 of file chromeos.c.

◆ REC_SW

#define REC_SW   16

Definition at line 15 of file chromeos.c.

◆ RECOVERY_MODE_EXTRA_DELAY_MS

#define RECOVERY_MODE_EXTRA_DELAY_MS   (8 * 1000)

Definition at line 62 of file chromeos.c.

◆ WIPEOUT_MODE_DELAY_MS

#define WIPEOUT_MODE_DELAY_MS   (8 * 1000)

Definition at line 61 of file chromeos.c.

◆ WP_SW

#define WP_SW   17

Definition at line 16 of file chromeos.c.

Enumeration Type Documentation

◆ switch_state

Enumerator
not_probed 
no_req 
recovery_req 
wipeout_req 
not_probed 
no_req 
recovery_req 
wipeout_req 

Definition at line 48 of file chromeos.c.

Function Documentation

◆ display_pattern()

static void display_pattern ( int  pattern)
static

Definition at line 55 of file chromeos.c.

References board_id(), BOARD_ID_WHIRLWIND_SP5, GSBI_ID_7, pattern, and ww_ring_display_pattern().

Here is the call graph for this function:

◆ fill_lb_gpios()

void fill_lb_gpios ( struct lb_gpios gpios)

Definition at line 26 of file chromeos.c.

References ACTIVE_LOW, ARRAY_SIZE, DEV_SW, lb_add_gpios(), read_gpio(), and REC_SW.

Here is the call graph for this function:

◆ get_ec_is_trusted()

int get_ec_is_trusted ( void  )

Definition at line 132 of file chromeos.c.

◆ 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 117 of file chromeos.c.

References get_switch_state(), and recovery_req.

Here is the call graph for this function:

◆ get_switch_state()

static enum switch_state get_switch_state ( void  )
static

Definition at line 55 of file chromeos.c.

Referenced by get_recovery_mode_switch(), and get_wipeout_mode_switch().

Here is the caller graph for this function:

◆ get_wipeout_mode_switch()

int get_wipeout_mode_switch ( void  )

Definition at line 122 of file chromeos.c.

References get_switch_state(), and wipeout_req.

Referenced by verstage_main().

Here is the call graph for this function:
Here is the caller 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 127 of file chromeos.c.

References read_gpio(), and WP_SW.

Here is the call graph for this function:

◆ read_gpio()

static int read_gpio ( gpio_t  gpio_num)
static

Definition at line 18 of file chromeos.c.

References GPIO_2MA, GPIO_DISABLE, GPIO_FUNC_DISABLE, gpio_get(), GPIO_NO_PULL, gpio_tlmm_config_set(), and udelay().

Referenced by fill_lb_gpios(), and get_write_protect_state().

Here is the call graph for this function:
Here is the caller graph for this function: