Skip to content

Commit cf8ad55

Browse files
author
Josh Tsai
committed
Writed the AC BOOT FLAG into SPI ROM
Signed-off-by: Josh Tsai <josh_tsai@compal.corp-partner.google.com>
1 parent dbc75ea commit cf8ad55

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

board/hx30/board.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ bool ac_poweron_check(void)
430430
{
431431
uint8_t memcap;
432432

433-
system_get_bbram(SYSTEM_BBRAM_IDX_AC_BOOT, &memcap);
433+
board_spi_read_byte(SPI_AC_BOOT_OFFSET, &memcap);
434434

435435
return memcap ? true : false;
436436
}
@@ -701,7 +701,7 @@ static void board_init(void)
701701
{
702702
uint8_t memcap;
703703

704-
system_get_bbram(SYSTEM_BBRAM_IDX_AC_BOOT, &memcap);
704+
board_spi_read_byte(SPI_AC_BOOT_OFFSET, &memcap);
705705

706706
if (memcap && !ac_boot_status())
707707
*host_get_customer_memmap(0x48) = (memcap & BIT(0));
@@ -1258,10 +1258,10 @@ static int cmd_boardspicontrol(int argc, char **argv)
12581258
uint8_t data;
12591259

12601260
if (!strcasecmp(argv[1], "read")) {
1261-
board_spi_read_byte(0x00, &data);
1261+
board_spi_read_byte(0x01, &data);
12621262
CPRINTS("DEBUG: cmd get data:0x%02x", data);
12631263
} else if (!strcasecmp(argv[1], "write")) {
1264-
board_spi_write_byte(0x00, 0xAA);
1264+
board_spi_write_byte(0x01, 0xAA);
12651265
}
12661266

12671267
return EC_SUCCESS;

board/hx30/board.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@
336336
*/
337337
#define CONFIG_FLASH_SIZE 0x100000
338338
#define CONFIG_SPI_FLASH_W25Q80
339+
#define SPI_AC_BOOT_OFFSET 0x00
339340

340341
/*
341342
* Enable extra SPI flash and generic SPI

board/hx30/host_command_customization.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static void sci_enable(void)
6060
/* when host set EC driver ready flag, EC need to enable SCI */
6161
lpc_set_host_event_mask(LPC_HOST_EVENT_SCI, SCI_HOST_EVENT_MASK);
6262
update_soc_power_limit(true, false);
63-
system_set_bbram(SYSTEM_BBRAM_IDX_AC_BOOT, ac_boot_status());
63+
board_spi_write_byte(SPI_AC_BOOT_OFFSET, ac_boot_status());
6464
set_non_acpi_mode(0);
6565
} else
6666
hook_call_deferred(&sci_enable_data, 250 * MSEC);
@@ -149,7 +149,7 @@ static enum ec_status factory_mode(struct host_cmd_handler_args *args)
149149
system_set_bbram(STSTEM_BBRAM_IDX_CHASSIS_MAGIC, EC_PARAM_CHASSIS_BBRAM_MAGIC);
150150
system_set_bbram(STSTEM_BBRAM_IDX_CHASSIS_VTR_OPEN, 0);
151151
system_set_bbram(STSTEM_BBRAM_IDX_CHASSIS_WAS_OPEN, 0);
152-
system_set_bbram(SYSTEM_BBRAM_IDX_AC_BOOT, 0);
152+
board_spi_write_byte(SPI_AC_BOOT_OFFSET, 0);
153153
system_set_bbram(STSTEM_BBRAM_IDX_FP_LED_LEVEL, 0);
154154
}
155155

0 commit comments

Comments
 (0)