vboot: Assume EC_SOFTWARE_SYNC and VIRTUAL_DEV_SWITCH by default
The virtualized developer switch was invented five years ago and has been used on every vboot system ever since. We shouldn't need to specify it again and again for every new board. This patch flips the Kconfig logic around and replaces CONFIG_VIRTUAL_DEV_SWITCH with CONFIG_PHYSICAL_DEV_SWITCH, so that only a few ancient boards need to set it and it fits better with CONFIG_PHYSICAL_REC_SWITCH. (Also set the latter for Lumpy which seems to have been omitted incorrectly, and hide it from menuconfig since it's a hardware parameter that shouldn't be configurable.) Since almost all our developer switches are virtual, it doesn't make sense for every board to pass a non-existent or non-functional developer mode switch in the coreboot tables, so let's get rid of that. It's also dangerously confusing for many boards to define a get_developer_mode() function that reads an actual pin (often from a debug header) which will not be honored by coreboot because CONFIG_PHYSICAL_DEV_SWITCH isn't set. Therefore, this patch removes all those non-functional instances of that function. In the future, either the board has a physical dev switch and must define it, or it doesn't and must not. In a similar sense (and since I'm touching so many board configs anyway), it's annoying that we have to keep selecting EC_SOFTWARE_SYNC. Instead, it should just be assumed by default whenever a Chrome EC is present in the system. This way, it can also still be overridden by menuconfig. CQ-DEPEND=CL:459701 Change-Id: If9cbaa7df530580a97f00ef238e3d9a8a86a4a7f Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/18980 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
fa8fa7dd54
commit
320edbe2ba
|
@ -17,10 +17,8 @@ if BOARD_GOOGLE_BASEBOARD_AURON
|
|||
config CHROMEOS
|
||||
select CHROMEOS_RAMOOPS_DYNAMIC
|
||||
select EC_GOOGLE_CHROMEEC_SWITCHES
|
||||
select EC_SOFTWARE_SYNC
|
||||
select LID_SWITCH
|
||||
select VBOOT_VBNV_CMOS
|
||||
select VIRTUAL_DEV_SWITCH
|
||||
|
||||
config MAINBOARD_DIR
|
||||
string
|
||||
|
|
|
@ -28,7 +28,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
struct lb_gpio chromeos_gpios[] = {
|
||||
{CROS_WP_GPIO, ACTIVE_HIGH, 0, "write protect"},
|
||||
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
|
||||
{-1, ACTIVE_HIGH, 0, "power"},
|
||||
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
|
||||
|
|
|
@ -18,7 +18,6 @@ if BOARD_GOOGLE_BASEBOARD_BELTINO
|
|||
config CHROMEOS
|
||||
select PHYSICAL_REC_SWITCH
|
||||
select VBOOT_VBNV_CMOS
|
||||
select VIRTUAL_DEV_SWITCH
|
||||
|
||||
config MAINBOARD_DIR
|
||||
string
|
||||
|
|
|
@ -38,7 +38,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
{GPIO_SPI_WP, ACTIVE_HIGH, 0, "write protect"},
|
||||
{GPIO_REC_MODE, ACTIVE_LOW,
|
||||
get_recovery_mode_switch(), "recovery"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{-1, ACTIVE_HIGH, 1, "lid"},
|
||||
{-1, ACTIVE_HIGH, 0, "power"},
|
||||
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
|
||||
|
@ -58,11 +57,6 @@ int get_write_protect_state(void)
|
|||
return (pci_read_config32(dev, SATA_SP) >> FLAG_SPI_WP) & 1;
|
||||
}
|
||||
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
device_t dev;
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#define WP_GPIO 6
|
||||
#define DEVMODE_GPIO 54
|
||||
#define FORCE_RECOVERY_MODE 0
|
||||
#define FORCE_DEVELOPER_MODE 0
|
||||
|
||||
#ifndef __PRE_RAM__
|
||||
#include <boot/coreboot_tables.h>
|
||||
|
@ -61,13 +60,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
gpios->gpios[1].value = get_recovery_mode_switch();
|
||||
strncpy((char *)gpios->gpios[1].name,"recovery", GPIO_MAX_NAME_LENGTH);
|
||||
|
||||
/* Developer: virtual GPIO active high */
|
||||
gpios->gpios[2].port = -1;
|
||||
gpios->gpios[2].polarity = ACTIVE_HIGH;
|
||||
gpios->gpios[2].value = get_developer_mode_switch();
|
||||
strncpy((char *)gpios->gpios[2].name,"developer",
|
||||
GPIO_MAX_NAME_LENGTH);
|
||||
|
||||
/* lid switch value from EC */
|
||||
gpios->gpios[3].port = -1;
|
||||
gpios->gpios[3].polarity = ACTIVE_HIGH;
|
||||
|
@ -101,23 +93,6 @@ int get_lid_switch(void)
|
|||
return (ec_mem_read(EC_HW_GPI_STATUS) >> EC_GPI_LID_STAT_BIT) & 1;
|
||||
}
|
||||
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
int dev_mode = 0;
|
||||
|
||||
#if FORCE_DEVELOPER_MODE
|
||||
printk(BIOS_DEBUG,"FORCING DEVELOPER MODE.\n");
|
||||
return 1;
|
||||
#endif
|
||||
|
||||
/* Servo GPIO is active low, reverse it for intial state (request) */
|
||||
dev_mode = !get_gpio(DEVMODE_GPIO);
|
||||
printk(BIOS_DEBUG,"DEVELOPER MODE FROM GPIO %d: %x\n",DEVMODE_GPIO,
|
||||
dev_mode);
|
||||
|
||||
return dev_mode;
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
int ec_rec_mode = 0;
|
||||
|
|
|
@ -30,7 +30,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
struct lb_gpio chromeos_gpios[] = {
|
||||
{-1, ACTIVE_HIGH, get_write_protect_state(), "write protect"},
|
||||
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
|
||||
{-1, ACTIVE_HIGH, 0, "power"},
|
||||
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
|
||||
|
|
|
@ -20,11 +20,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
{
|
||||
}
|
||||
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -17,10 +17,8 @@ config BOARD_SPECIFIC_OPTIONS
|
|||
|
||||
config CHROMEOS
|
||||
select EC_GOOGLE_CHROMEEC_SWITCHES
|
||||
select EC_SOFTWARE_SYNC
|
||||
select LID_SWITCH
|
||||
select VBOOT_VBNV_CMOS
|
||||
select VIRTUAL_DEV_SWITCH
|
||||
|
||||
config DISPLAY_SPD_DATA
|
||||
bool "Display Memory Serial Presence Detect Data"
|
||||
|
|
|
@ -35,7 +35,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
struct lb_gpio chromeos_gpios[] = {
|
||||
{-1, ACTIVE_HIGH, get_write_protect_state(), "write protect"},
|
||||
{-1, ACTIVE_HIGH, vboot_recovery_mode_enabled(), "recovery"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
|
||||
{-1, ACTIVE_HIGH, 0, "power"},
|
||||
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
|
||||
|
|
|
@ -59,25 +59,12 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* Developer: virtual GPIO active high */
|
||||
gpios->gpios[count].port = -1;
|
||||
gpios->gpios[count].polarity = ACTIVE_HIGH;
|
||||
gpios->gpios[count].value = get_developer_mode_switch();
|
||||
strncpy((char *)gpios->gpios[count].name, "developer",
|
||||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
gpios->size = sizeof(*gpios) + (count * sizeof(struct lb_gpio));
|
||||
gpios->count = count;
|
||||
|
||||
printk(BIOS_ERR, "Added %d GPIOS size %d\n", count, gpios->size);
|
||||
}
|
||||
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
uint32_t ec_events;
|
||||
|
|
|
@ -29,7 +29,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
struct lb_gpio chromeos_gpios[] = {
|
||||
{-1, ACTIVE_HIGH, get_write_protect_state(), "write protect"},
|
||||
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
|
||||
{-1, ACTIVE_HIGH, 0, "power"},
|
||||
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
|
||||
|
|
|
@ -28,7 +28,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
struct lb_gpio chromeos_gpios[] = {
|
||||
{-1, ACTIVE_HIGH, get_write_protect_state(), "write protect"},
|
||||
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
|
||||
{-1, ACTIVE_HIGH, 0, "power"},
|
||||
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
|
||||
|
|
|
@ -28,7 +28,6 @@ config BOARD_SPECIFIC_OPTIONS # dummy
|
|||
|
||||
config CHROMEOS
|
||||
select VBOOT_VBNV_FLASH
|
||||
select VIRTUAL_DEV_SWITCH
|
||||
|
||||
config MAINBOARD_DIR
|
||||
string
|
||||
|
|
|
@ -52,14 +52,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* Developer: virtual GPIO active high */
|
||||
gpios->gpios[count].port = -1;
|
||||
gpios->gpios[count].polarity = ACTIVE_HIGH;
|
||||
gpios->gpios[count].value = get_developer_mode_switch();
|
||||
strncpy((char *)gpios->gpios[count].name, "developer",
|
||||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* TODO: Reset: active low (output) */
|
||||
gpios->gpios[count].port = GPIO(I5);
|
||||
gpios->gpios[count].polarity = ACTIVE_LOW;
|
||||
|
@ -74,11 +66,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
printk(BIOS_ERR, "Added %d GPIOS size %d\n", count, gpios->size);
|
||||
}
|
||||
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
#if CONFIG_EC_GOOGLE_CHROMEEC
|
||||
|
|
|
@ -33,7 +33,6 @@ config BOARD_SPECIFIC_OPTIONS
|
|||
|
||||
config CHROMEOS
|
||||
select VBOOT_DISABLE_DEV_ON_RECOVERY
|
||||
select VIRTUAL_DEV_SWITCH
|
||||
select WIPEOUT_SUPPORTED
|
||||
|
||||
config BOARD_VARIANT_DK01
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
#include <timer.h>
|
||||
#include <vendorcode/google/chromeos/chromeos.h>
|
||||
|
||||
#define DEV_SW 41
|
||||
#define DEV_POL ACTIVE_LOW
|
||||
#define REC_POL ACTIVE_LOW
|
||||
#define WP_POL ACTIVE_LOW
|
||||
|
||||
|
@ -71,7 +69,6 @@ static int read_gpio(gpio_t gpio_num)
|
|||
void fill_lb_gpios(struct lb_gpios *gpios)
|
||||
{
|
||||
struct lb_gpio chromeos_gpios[] = {
|
||||
{DEV_SW, DEV_POL, read_gpio(DEV_SW), "developer"},
|
||||
{get_rec_sw_gpio_pin(), REC_POL,
|
||||
read_gpio(get_rec_sw_gpio_pin()), "recovery"},
|
||||
{get_wp_status_gpio_pin(), WP_POL,
|
||||
|
@ -82,11 +79,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
|
||||
}
|
||||
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* The recovery switch on storm is overloaded: it needs to be pressed for a
|
||||
* certain duration at startup to signal different requests:
|
||||
|
|
|
@ -31,7 +31,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
struct lb_gpio chromeos_gpios[] = {
|
||||
{-1, ACTIVE_HIGH, get_write_protect_state(), "write protect"},
|
||||
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
|
||||
{-1, ACTIVE_HIGH, 0, "power"},
|
||||
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
|
||||
|
|
|
@ -47,11 +47,9 @@ config BOARD_SPECIFIC_OPTIONS
|
|||
|
||||
config CHROMEOS
|
||||
select EC_GOOGLE_CHROMEEC_SWITCHES
|
||||
select EC_SOFTWARE_SYNC
|
||||
select MAINBOARD_HAS_SPI_TPM_CR50 if GRU_HAS_TPM2
|
||||
select SPI_TPM if GRU_HAS_TPM2
|
||||
select VBOOT_VBNV_FLASH
|
||||
select VIRTUAL_DEV_SWITCH
|
||||
|
||||
config MAINBOARD_DIR
|
||||
string
|
||||
|
|
|
@ -16,7 +16,6 @@ config CHROMEOS
|
|||
select CHROMEOS_RAMOOPS_DYNAMIC
|
||||
select PHYSICAL_REC_SWITCH
|
||||
select VBOOT_VBNV_CMOS
|
||||
select VIRTUAL_DEV_SWITCH
|
||||
|
||||
config MAINBOARD_DIR
|
||||
string
|
||||
|
|
|
@ -40,7 +40,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
get_gpio(GPIO_SPI_WP), "write protect"},
|
||||
{GPIO_REC_MODE, ACTIVE_LOW,
|
||||
get_recovery_mode_switch(), "recovery"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{-1, ACTIVE_HIGH, 1, "lid"},
|
||||
{-1, ACTIVE_HIGH, 0, "power"},
|
||||
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
|
||||
|
@ -60,11 +59,6 @@ int get_write_protect_state(void)
|
|||
return (pci_read_config32(dev, SATA_SP) >> FLAG_SPI_WP) & 1;
|
||||
}
|
||||
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
device_t dev;
|
||||
|
|
|
@ -30,7 +30,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
struct lb_gpio chromeos_gpios[] = {
|
||||
{-1, ACTIVE_HIGH, get_write_protect_state(), "write protect"},
|
||||
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
|
||||
{-1, ACTIVE_HIGH, 0, "power"},
|
||||
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
|
||||
|
|
|
@ -54,12 +54,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
gpios->gpios[3].value = 0;
|
||||
strncpy((char *)gpios->gpios[3].name,"power", GPIO_MAX_NAME_LENGTH);
|
||||
|
||||
/* Developer: a tricky case on Link, there is no switch */
|
||||
gpios->gpios[4].port = -1; /* Indicate that this is a pseudo GPIO */
|
||||
gpios->gpios[4].polarity = ACTIVE_HIGH;
|
||||
gpios->gpios[4].value = get_developer_mode_switch();
|
||||
strncpy((char *)gpios->gpios[4].name,"developer", GPIO_MAX_NAME_LENGTH);
|
||||
|
||||
/* Did we load the VGA Option ROM? */
|
||||
gpios->gpios[5].port = -1; /* Indicate that this is a pseudo GPIO */
|
||||
gpios->gpios[5].polarity = ACTIVE_HIGH;
|
||||
|
|
|
@ -33,9 +33,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
|
|||
|
||||
config CHROMEOS
|
||||
select EC_GOOGLE_CHROMEEC_SWITCHES
|
||||
select EC_SOFTWARE_SYNC
|
||||
select VBOOT_VBNV_EC
|
||||
select VIRTUAL_DEV_SWITCH
|
||||
|
||||
config MAINBOARD_DIR
|
||||
string
|
||||
|
|
|
@ -25,7 +25,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
|
||||
{GPIO(R4), ACTIVE_HIGH, -1, "lid"},
|
||||
{GPIO(Q0), ACTIVE_LOW, -1, "power"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{GPIO(U4), ACTIVE_HIGH, -1, "EC in RW"},
|
||||
{GPIO(I5), ACTIVE_LOW, -1, "reset"},
|
||||
};
|
||||
|
|
|
@ -34,9 +34,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
|
|||
|
||||
config CHROMEOS
|
||||
select EC_GOOGLE_CHROMEEC_SWITCHES
|
||||
select EC_SOFTWARE_SYNC
|
||||
select VBOOT_VBNV_EC
|
||||
select VIRTUAL_DEV_SWITCH
|
||||
|
||||
config MAINBOARD_DIR
|
||||
string
|
||||
|
|
|
@ -25,7 +25,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
|
||||
{GPIO(R4), ACTIVE_HIGH, -1, "lid"},
|
||||
{GPIO(Q0), ACTIVE_LOW, -1, "power"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{GPIO(U4), ACTIVE_HIGH, -1, "EC in RW"},
|
||||
{GPIO(I5), ACTIVE_LOW, -1, "reset"},
|
||||
};
|
||||
|
|
|
@ -35,9 +35,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
|
|||
|
||||
config CHROMEOS
|
||||
select EC_GOOGLE_CHROMEEC_SWITCHES
|
||||
select EC_SOFTWARE_SYNC
|
||||
select VBOOT_VBNV_EC
|
||||
select VIRTUAL_DEV_SWITCH
|
||||
|
||||
config MAINBOARD_DIR
|
||||
string
|
||||
|
|
|
@ -25,7 +25,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
|
||||
{GPIO(R4), ACTIVE_HIGH, -1, "lid"},
|
||||
{GPIO(Q0), ACTIVE_LOW, -1, "power"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{GPIO(U4), ACTIVE_HIGH, -1, "EC in RW"},
|
||||
{GPIO(I5), ACTIVE_LOW, -1, "reset"},
|
||||
};
|
||||
|
|
|
@ -35,11 +35,9 @@ config BOARD_SPECIFIC_OPTIONS
|
|||
|
||||
config CHROMEOS
|
||||
select EC_GOOGLE_CHROMEEC_SWITCHES
|
||||
select EC_SOFTWARE_SYNC
|
||||
select VBOOT_EC_SLOW_UPDATE
|
||||
select VBOOT_OPROM_MATTERS
|
||||
select VBOOT_VBNV_FLASH
|
||||
select VIRTUAL_DEV_SWITCH
|
||||
|
||||
config MAINBOARD_DIR
|
||||
string
|
||||
|
|
|
@ -40,7 +40,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
|
||||
{LID, ACTIVE_HIGH, -1, "lid"},
|
||||
{POWER_BUTTON, ACTIVE_HIGH, -1, "power"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{EC_IN_RW, ACTIVE_HIGH, -1, "EC in RW"},
|
||||
{EC_IRQ, ACTIVE_LOW, -1, "EC interrupt"},
|
||||
};
|
||||
|
|
|
@ -56,12 +56,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
gpios->gpios[1].value = get_recovery_mode_switch();
|
||||
strncpy((char *)gpios->gpios[1].name,"recovery", GPIO_MAX_NAME_LENGTH);
|
||||
|
||||
/* Developer: Virtual GPIO in the EC ( Servo GPIO17 active low) */
|
||||
gpios->gpios[2].port = -1;
|
||||
gpios->gpios[2].polarity = ACTIVE_HIGH;
|
||||
gpios->gpios[2].value = get_developer_mode_switch();
|
||||
strncpy((char *)gpios->gpios[2].name,"developer", GPIO_MAX_NAME_LENGTH);
|
||||
|
||||
/* Lid switch GPIO active high (open). */
|
||||
gpios->gpios[3].port = 15;
|
||||
gpios->gpios[3].polarity = ACTIVE_HIGH;
|
||||
|
@ -88,22 +82,6 @@ int get_lid_switch(void)
|
|||
return get_gpio(15);
|
||||
}
|
||||
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
u8 gpio = !get_gpio(17);
|
||||
/*
|
||||
* Dev mode is controlled by EC and uboot stores a flag in TPM.
|
||||
* This GPIO is only for the debug header.
|
||||
* It is AND'd to the EC request.
|
||||
*/
|
||||
|
||||
printk(BIOS_DEBUG, "DEV MODE GPIO 17: %x\n", gpio);
|
||||
|
||||
/* GPIO17, active low -- return active high reading and let
|
||||
* it be inverted by the caller if needed. */
|
||||
return gpio;
|
||||
}
|
||||
|
||||
int get_write_protect_state(void)
|
||||
{
|
||||
return !get_gpio(70);
|
||||
|
|
|
@ -59,25 +59,12 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
/* Developer: virtual GPIO active high */
|
||||
gpios->gpios[count].port = -1;
|
||||
gpios->gpios[count].polarity = ACTIVE_HIGH;
|
||||
gpios->gpios[count].value = get_developer_mode_switch();
|
||||
strncpy((char *)gpios->gpios[count].name, "developer",
|
||||
GPIO_MAX_NAME_LENGTH);
|
||||
count++;
|
||||
|
||||
gpios->size = sizeof(*gpios) + (count * sizeof(struct lb_gpio));
|
||||
gpios->count = count;
|
||||
|
||||
printk(BIOS_ERR, "Added %d GPIOS size %d\n", count, gpios->size);
|
||||
}
|
||||
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
uint32_t ec_events;
|
||||
|
|
|
@ -28,7 +28,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
struct lb_gpio chromeos_gpios[] = {
|
||||
{-1, ACTIVE_HIGH, get_write_protect_state(), "write protect"},
|
||||
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
|
||||
{-1, ACTIVE_HIGH, 0, "power"},
|
||||
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
|
||||
|
|
|
@ -20,11 +20,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
{
|
||||
}
|
||||
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -15,10 +15,8 @@ if BOARD_GOOGLE_BASEBOARD_RAMBI
|
|||
|
||||
config CHROMEOS
|
||||
select EC_GOOGLE_CHROMEEC_SWITCHES
|
||||
select EC_SOFTWARE_SYNC
|
||||
select LID_SWITCH
|
||||
select VBOOT_VBNV_CMOS
|
||||
select VIRTUAL_DEV_SWITCH
|
||||
|
||||
config MAINBOARD_DIR
|
||||
string
|
||||
|
|
|
@ -29,7 +29,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
struct lb_gpio chromeos_gpios[] = {
|
||||
{-1, ACTIVE_HIGH, get_write_protect_state(), "write protect"},
|
||||
{-1, ACTIVE_HIGH, vboot_recovery_mode_enabled(), "recovery"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
|
||||
{-1, ACTIVE_HIGH, 0, "power"},
|
||||
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
|
||||
|
|
|
@ -25,7 +25,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
struct lb_gpio chromeos_gpios[] = {
|
||||
{-1, ACTIVE_HIGH, get_write_protect_state(), "write protect"},
|
||||
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
|
||||
{-1, ACTIVE_HIGH, 0, "power"},
|
||||
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
|
||||
|
|
|
@ -23,11 +23,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
/*TODO: implement fill_lb_gpios */
|
||||
}
|
||||
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -23,11 +23,9 @@ if BOARD_GOOGLE_BASEBOARD_SLIPPY
|
|||
|
||||
config CHROMEOS
|
||||
select EC_GOOGLE_CHROMEEC_SWITCHES
|
||||
select EC_SOFTWARE_SYNC
|
||||
select LID_SWITCH
|
||||
select MAINBOARD_DO_NATIVE_VGA_INIT if (BOARD_GOOGLE_FALCO || BOARD_GOOGLE_PEPPY)
|
||||
select VBOOT_VBNV_CMOS
|
||||
select VIRTUAL_DEV_SWITCH
|
||||
|
||||
config MAINBOARD_DIR
|
||||
string
|
||||
|
|
|
@ -27,7 +27,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
struct lb_gpio chromeos_gpios[] = {
|
||||
{58, ACTIVE_HIGH, 0, "write protect"},
|
||||
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
|
||||
{-1, ACTIVE_HIGH, 0, "power"},
|
||||
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
|
||||
|
|
|
@ -34,9 +34,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
|
|||
|
||||
config CHROMEOS
|
||||
select EC_GOOGLE_CHROMEEC_SWITCHES
|
||||
select EC_SOFTWARE_SYNC
|
||||
select VBOOT_VBNV_FLASH
|
||||
select VIRTUAL_DEV_SWITCH
|
||||
|
||||
config MAINBOARD_DIR
|
||||
string
|
||||
|
|
|
@ -26,7 +26,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
gpio_get(WRITE_PROTECT_L), "write protect"},
|
||||
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
|
||||
{POWER_BUTTON, ACTIVE_LOW, -1, "power"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{EC_IN_RW, ACTIVE_HIGH, -1, "EC in RW"},
|
||||
{AP_SYS_RESET_L, ACTIVE_LOW, -1, "reset"},
|
||||
};
|
||||
|
|
|
@ -32,7 +32,6 @@ config BOARD_SPECIFIC_OPTIONS
|
|||
config CHROMEOS
|
||||
select VBOOT_DISABLE_DEV_ON_RECOVERY
|
||||
select WIPEOUT_SUPPORTED
|
||||
select VIRTUAL_DEV_SWITCH
|
||||
|
||||
config BOARD_VARIANT_AP148
|
||||
bool "pick this to build an image for ap148"
|
||||
|
|
|
@ -43,7 +43,6 @@ static int read_gpio(gpio_t gpio_num)
|
|||
void fill_lb_gpios(struct lb_gpios *gpios)
|
||||
{
|
||||
struct lb_gpio chromeos_gpios[] = {
|
||||
{DEV_SW, ACTIVE_LOW, read_gpio(DEV_SW), "developer"},
|
||||
{REC_SW, ACTIVE_LOW, read_gpio(REC_SW), "recovery"},
|
||||
{WP_SW, ACTIVE_LOW, read_gpio(WP_SW), "write protect"},
|
||||
{-1, ACTIVE_LOW, 1, "power"},
|
||||
|
@ -52,11 +51,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
|
||||
}
|
||||
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* The recovery switch on storm is overloaded: it needs to be pressed for a
|
||||
* certain duration at startup to signal different requests:
|
||||
|
|
|
@ -49,12 +49,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
gpios->gpios[1].value = get_recovery_mode_switch();
|
||||
strncpy((char *)gpios->gpios[1].name,"recovery", GPIO_MAX_NAME_LENGTH);
|
||||
|
||||
/* Developer: Virtual switch */
|
||||
gpios->gpios[2].port = -1;
|
||||
gpios->gpios[2].polarity = ACTIVE_HIGH;
|
||||
gpios->gpios[2].value = get_developer_mode_switch();
|
||||
strncpy((char *)gpios->gpios[2].name,"developer", GPIO_MAX_NAME_LENGTH);
|
||||
|
||||
/* Lid Switch: Virtual switch */
|
||||
gpios->gpios[3].port = -1;
|
||||
gpios->gpios[3].polarity = ACTIVE_HIGH;
|
||||
|
@ -92,12 +86,6 @@ int get_lid_switch(void)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/* The dev-switch is virtual on Stout (and so handled elsewhere). */
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* The recovery-switch is virtual on Stout and is handled via the EC.
|
||||
* Stout recovery mode is only valid if RTC_PWR_STS is set and the EC
|
||||
|
|
|
@ -29,12 +29,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
printk(BIOS_ERR, "%s unsupported, but called\n", __func__);
|
||||
}
|
||||
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
printk(BIOS_ERR, "%s unsupported, but called\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
printk(BIOS_ERR, "%s unsupported, but called\n", __func__);
|
||||
|
|
|
@ -46,9 +46,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
|
|||
select SPI_FLASH_WINBOND
|
||||
|
||||
config CHROMEOS
|
||||
select EC_SOFTWARE_SYNC
|
||||
select VBOOT_VBNV_EC
|
||||
select VIRTUAL_DEV_SWITCH
|
||||
|
||||
config MAINBOARD_DIR
|
||||
string
|
||||
|
|
|
@ -47,7 +47,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
get_recovery_mode_switch(), "recovery"},
|
||||
{GPIO_LID.raw, ACTIVE_HIGH, -1, "lid"},
|
||||
{GPIO_POWER.raw, ACTIVE_LOW, -1, "power"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{GPIO_ECINRW.raw, ACTIVE_HIGH, -1, "EC in RW"},
|
||||
{GPIO_ECIRQ.raw, ACTIVE_LOW, -1, "EC interrupt"},
|
||||
{GPIO_RESET.raw, ACTIVE_HIGH, -1, "reset"},
|
||||
|
@ -56,11 +55,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
|
||||
}
|
||||
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
uint32_t ec_events;
|
||||
|
|
|
@ -33,7 +33,6 @@ config BOARD_SPECIFIC_OPTIONS # dummy
|
|||
config CHROMEOS
|
||||
select PHYSICAL_REC_SWITCH
|
||||
select VBOOT_VBNV_FLASH
|
||||
select VIRTUAL_DEV_SWITCH
|
||||
|
||||
config MAINBOARD_DIR
|
||||
string
|
||||
|
|
|
@ -36,17 +36,11 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
{GPIO_WP.raw, ACTIVE_LOW, gpio_get(GPIO_WP), "write protect"},
|
||||
{GPIO_RECOVERY.raw, ACTIVE_LOW,
|
||||
gpio_get(GPIO_RECOVERY), "recovery"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{GPIO_RESET.raw, ACTIVE_HIGH, -1, "reset"},
|
||||
};
|
||||
lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
|
||||
}
|
||||
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
return !gpio_get(GPIO_RECOVERY);
|
||||
|
|
|
@ -33,7 +33,6 @@ config BOARD_SPECIFIC_OPTIONS # dummy
|
|||
config CHROMEOS
|
||||
select PHYSICAL_REC_SWITCH
|
||||
select VBOOT_VBNV_FLASH
|
||||
select VIRTUAL_DEV_SWITCH
|
||||
|
||||
config MAINBOARD_DIR
|
||||
string
|
||||
|
|
|
@ -44,17 +44,11 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
{GPIO_RECOVERY_PUSHKEY.raw, ACTIVE_LOW,
|
||||
!get_recovery_mode_switch(), "recovery"},
|
||||
{GPIO_POWER.raw, ACTIVE_LOW, -1, "power"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{GPIO_RESET.raw, ACTIVE_HIGH, -1, "reset"},
|
||||
};
|
||||
lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
|
||||
}
|
||||
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
// Both RECOVERY_SERVO and RECOVERY_PUSHKEY are low active.
|
||||
|
|
|
@ -36,7 +36,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
return;
|
||||
|
||||
u32 gp_lvl = inl(gpio_base + GP_LVL);
|
||||
u32 gp_lvl2 = inl(gpio_base + GP_LVL2);
|
||||
u32 gp_lvl3 = inl(gpio_base + GP_LVL3);
|
||||
|
||||
gpios->size = sizeof(*gpios) + (GPIO_COUNT * sizeof(struct lb_gpio));
|
||||
|
@ -55,12 +54,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
gpios->gpios[1].value = (gp_lvl3 >> (69-64)) & 1;
|
||||
strncpy((char *)gpios->gpios[1].name,"recovery", GPIO_MAX_NAME_LENGTH);
|
||||
|
||||
/* Developer: GPIO48 - BIOS_RESP - J8E4 (silkscreen: J8E3) */
|
||||
gpios->gpios[2].port = 48;
|
||||
gpios->gpios[2].polarity = ACTIVE_LOW;
|
||||
gpios->gpios[2].value = (gp_lvl2 >> (48-32)) & 1;
|
||||
strncpy((char *)gpios->gpios[2].name,"developer", GPIO_MAX_NAME_LENGTH);
|
||||
|
||||
/* Hard code the lid switch GPIO to open. */
|
||||
gpios->gpios[3].port = -1;
|
||||
gpios->gpios[3].polarity = ACTIVE_HIGH;
|
||||
|
@ -81,15 +74,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
}
|
||||
#endif
|
||||
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
/*
|
||||
* Developer: GPIO48, Connected to J8E4, however the silkscreen says
|
||||
* J8E3. The jumper is active low.
|
||||
*/
|
||||
return !get_gpio(48);
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
/*
|
||||
|
|
|
@ -55,12 +55,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
gpios->gpios[1].value = (gp_lvl >> 22) & 1;
|
||||
strncpy((char *)gpios->gpios[1].name,"recovery", GPIO_MAX_NAME_LENGTH);
|
||||
|
||||
/* Developer: GPIO57 */
|
||||
gpios->gpios[2].port = 57;
|
||||
gpios->gpios[2].polarity = ACTIVE_LOW;
|
||||
gpios->gpios[2].value = (gp_lvl2 >> (57-32)) & 1;
|
||||
strncpy((char *)gpios->gpios[2].name,"developer", GPIO_MAX_NAME_LENGTH);
|
||||
|
||||
/* Hard code the lid switch GPIO to open. */
|
||||
gpios->gpios[3].port = -1;
|
||||
gpios->gpios[3].polarity = ACTIVE_HIGH;
|
||||
|
@ -81,12 +75,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
}
|
||||
#endif
|
||||
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
/* Developer: GPIO57, active high */
|
||||
return get_gpio(57);
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
/* Recovery: GPIO22, active low */
|
||||
|
|
|
@ -32,11 +32,6 @@ int clear_recovery_mode_switch(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -36,7 +36,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
struct lb_gpio chromeos_gpios[] = {
|
||||
{-1, ACTIVE_HIGH, get_write_protect_state(), "write protect"},
|
||||
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
|
||||
{-1, ACTIVE_HIGH, 0, "power"},
|
||||
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
|
||||
|
@ -55,12 +54,6 @@ int get_lid_switch(void)
|
|||
return 1;
|
||||
}
|
||||
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
/* No physical developer mode switch. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC)) {
|
||||
|
|
|
@ -30,7 +30,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
struct lb_gpio chromeos_gpios[] = {
|
||||
{-1, ACTIVE_HIGH, get_write_protect_state(), "write protect"},
|
||||
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
|
||||
{-1, ACTIVE_HIGH, 0, "power"},
|
||||
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
|
||||
|
|
|
@ -17,10 +17,8 @@ config BOARD_SPECIFIC_OPTIONS
|
|||
|
||||
config CHROMEOS
|
||||
select EC_GOOGLE_CHROMEEC_SWITCHES
|
||||
select EC_SOFTWARE_SYNC
|
||||
select LID_SWITCH
|
||||
select VBOOT_VBNV_CMOS
|
||||
select VIRTUAL_DEV_SWITCH
|
||||
|
||||
config DYNAMIC_VNN_SUPPORT
|
||||
bool "Enables support for Dynamic VNN"
|
||||
|
|
|
@ -32,7 +32,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
struct lb_gpio chromeos_gpios[] = {
|
||||
{-1, ACTIVE_HIGH, get_write_protect_state(), "write protect"},
|
||||
{-1, ACTIVE_HIGH, vboot_recovery_mode_enabled(), "recovery"},
|
||||
{-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"},
|
||||
{-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
|
||||
{-1, ACTIVE_HIGH, 0, "power"},
|
||||
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
|
||||
|
|
|
@ -21,8 +21,7 @@
|
|||
#include <soc/gpio.h>
|
||||
#include <vendorcode/google/chromeos/chromeos.h>
|
||||
|
||||
/* Compile-time settings for developer and recovery mode. */
|
||||
#define DEV_MODE_SETTING 1
|
||||
/* Compile-time settings for recovery mode. */
|
||||
#define REC_MODE_SETTING 0
|
||||
|
||||
#ifndef __PRE_RAM__
|
||||
|
@ -33,7 +32,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
struct lb_gpio chromeos_gpios[] = {
|
||||
{-1, ACTIVE_HIGH, 0, "write protect"},
|
||||
{-1, ACTIVE_HIGH, REC_MODE_SETTING, "recovery"},
|
||||
{-1, ACTIVE_HIGH, DEV_MODE_SETTING, "developer"},
|
||||
{-1, ACTIVE_HIGH, 1, "lid"}, // force open
|
||||
{-1, ACTIVE_HIGH, 0, "power"},
|
||||
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
|
||||
|
@ -42,11 +40,6 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
}
|
||||
#endif
|
||||
|
||||
int get_developer_mode_switch(void)
|
||||
{
|
||||
return DEV_MODE_SETTING;
|
||||
}
|
||||
|
||||
int get_recovery_mode_switch(void)
|
||||
{
|
||||
return REC_MODE_SETTING;
|
||||
|
|
|
@ -21,6 +21,8 @@ config BOARD_SPECIFIC_OPTIONS # dummy
|
|||
select INTEL_INT15
|
||||
|
||||
config CHROMEOS
|
||||
select PHYSICAL_DEV_SWITCH
|
||||
select PHYSICAL_REC_SWITCH
|
||||
select VBOOT_VBNV_CMOS
|
||||
|
||||
config MAINBOARD_DIR
|
||||
|
|
|
@ -18,6 +18,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
|
|||
select INTEL_INT15
|
||||
|
||||
config CHROMEOS
|
||||
select PHYSICAL_DEV_SWITCH
|
||||
select PHYSICAL_REC_SWITCH
|
||||
select VBOOT_VBNV_CMOS
|
||||
|
||||
|
|
|
@ -70,14 +70,12 @@ config CPU_SPECIFIC_OPTIONS
|
|||
|
||||
config CHROMEOS
|
||||
select CHROMEOS_RAMOOPS_DYNAMIC
|
||||
select EC_SOFTWARE_SYNC if EC_GOOGLE_CHROMEEC
|
||||
select SEPARATE_VERSTAGE
|
||||
select VBOOT_OPROM_MATTERS
|
||||
select VBOOT_SAVE_RECOVERY_REASON_ON_REBOOT
|
||||
select VBOOT_STARTS_IN_BOOTBLOCK
|
||||
select VBOOT_VBNV_CMOS
|
||||
select VBOOT_VBNV_CMOS_BACKUP_TO_FLASH
|
||||
select VIRTUAL_DEV_SWITCH
|
||||
|
||||
config TPM_ON_FAST_SPI
|
||||
bool
|
||||
|
|
|
@ -87,7 +87,6 @@ config USE_FSP1_1_DRIVER
|
|||
|
||||
config CHROMEOS
|
||||
select CHROMEOS_RAMOOPS_DYNAMIC
|
||||
select EC_SOFTWARE_SYNC if EC_GOOGLE_CHROMEEC
|
||||
select SEPARATE_VERSTAGE
|
||||
select VBOOT_EC_SLOW_UPDATE if EC_GOOGLE_CHROMEEC
|
||||
select VBOOT_OPROM_MATTERS
|
||||
|
@ -95,7 +94,6 @@ config CHROMEOS
|
|||
select VBOOT_STARTS_IN_BOOTBLOCK
|
||||
select VBOOT_VBNV_CMOS
|
||||
select VBOOT_VBNV_CMOS_BACKUP_TO_FLASH
|
||||
select VIRTUAL_DEV_SWITCH
|
||||
|
||||
config BOOTBLOCK_RESETS
|
||||
string
|
||||
|
|
|
@ -162,9 +162,6 @@ int vboot_developer_mode_enabled(void)
|
|||
if (!IS_ENABLED(CONFIG_VBOOT))
|
||||
return 0;
|
||||
|
||||
if (get_developer_mode_switch())
|
||||
return 1;
|
||||
|
||||
if (cbmem_possibly_online() && vboot_handoff_check_developer_flag())
|
||||
return 1;
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ static void fill_vboot_handoff(struct vboot_handoff *vboot_handoff,
|
|||
vb_sd->flags |= VBSD_LF_DEV_SWITCH_ON;
|
||||
}
|
||||
/* TODO: Set these in depthcharge */
|
||||
if (IS_ENABLED(CONFIG_VIRTUAL_DEV_SWITCH))
|
||||
if (!IS_ENABLED(CONFIG_PHYSICAL_DEV_SWITCH))
|
||||
vb_sd->flags |= VBSD_HONOR_VIRT_DEV_SWITCH;
|
||||
if (IS_ENABLED(CONFIG_EC_SOFTWARE_SYNC))
|
||||
vb_sd->flags |= VBSD_EC_SOFTWARE_SYNC;
|
||||
|
|
|
@ -329,7 +329,7 @@ void verstage_main(void)
|
|||
antirollback_read_space_firmware(&ctx);
|
||||
timestamp_add_now(TS_END_TPMINIT);
|
||||
|
||||
if (!IS_ENABLED(CONFIG_VIRTUAL_DEV_SWITCH) &&
|
||||
if (IS_ENABLED(CONFIG_PHYSICAL_DEV_SWITCH) &&
|
||||
get_developer_mode_switch())
|
||||
ctx.flags |= VB2_CONTEXT_FORCE_DEVELOPER_MODE;
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@ config CHROMEOS_RAMOOPS_RAM_SIZE
|
|||
|
||||
config EC_SOFTWARE_SYNC
|
||||
bool "Enable EC software sync"
|
||||
default y if EC_GOOGLE_CHROMEEC
|
||||
default n
|
||||
depends on VBOOT
|
||||
help
|
||||
|
@ -76,13 +77,6 @@ config VBOOT_EC_SLOW_UPDATE
|
|||
Whether the EC (or PD) is slow to update and needs to display a
|
||||
screen that informs the user the update is happening.
|
||||
|
||||
config VIRTUAL_DEV_SWITCH
|
||||
bool "Virtual developer switch support"
|
||||
default n
|
||||
depends on VBOOT
|
||||
help
|
||||
Whether this platform has a virtual developer switch.
|
||||
|
||||
config NO_TPM_RESUME
|
||||
bool
|
||||
default n
|
||||
|
@ -91,8 +85,17 @@ config NO_TPM_RESUME
|
|||
boards, booting Windows will break if the TPM resume command
|
||||
is sent during an S3 resume.
|
||||
|
||||
config PHYSICAL_DEV_SWITCH
|
||||
bool
|
||||
default n
|
||||
help
|
||||
Whether this platform has a physical developer switch. Note that this
|
||||
disables virtual dev switch functionality (through secdata). Operation
|
||||
where both a physical pin and the virtual switch get sampled is not
|
||||
supported by coreboot.
|
||||
|
||||
config PHYSICAL_REC_SWITCH
|
||||
bool "Physical recovery switch is present"
|
||||
bool
|
||||
default n
|
||||
help
|
||||
Whether this platform has a physical recovery switch
|
||||
|
|
|
@ -17,12 +17,6 @@
|
|||
#include <string.h>
|
||||
#include "chromeos.h"
|
||||
|
||||
int __attribute__((weak)) get_developer_mode_switch(void)
|
||||
{
|
||||
// Weak implementation. No physical developer switch.
|
||||
return 0;
|
||||
}
|
||||
|
||||
int __attribute__((weak)) clear_recovery_mode_switch(void)
|
||||
{
|
||||
// Weak implementation. Nothing to do.
|
||||
|
|
Loading…
Reference in New Issue