Attention is currently required from: Bora Guvendik, Cliff Huang, Jamie Ryu, Wonkyu Kim.
Jérémy Compostella has posted comments on this change by Wonkyu Kim. ( https://review.coreboot.org/c/coreboot/+/87247?usp=email )
Change subject: ec/intel: read board ID one time from EC per stage ......................................................................
Patch Set 5:
(1 comment)
File src/ec/intel/board_id.c:
https://review.coreboot.org/c/coreboot/+/87247/comment/ca7ded18_5715e95e?usp... : PS5, Line 21: get_rvp_board_id
We could actually make this function much flatter and read-able in my opinion. […]
We could actually make this function much flatter and read-able in my opinion. What do you think of the following?
int get_rvp_board_id(void) { static int id = BOARD_ID_UNKNOWN; static bool initialized; static const char *ec_system;
/* If already initialized, return the cached board ID. */ if (initialized) return id;
/* Mark as initialized after the first read attempt. */ initialized = true;
if (CONFIG(EC_GOOGLE_CHROMEEC)) { /* Chrome EC */ ec_system = "ChromeEC"; id = get_board_id_via_ext_ec(); } else if (send_ec_command(EC_FAB_ID_CMD) == 0) { /* Windows EC */ /* Windows EC */ ec_system = "WinEC"; id = recv_ec_data() << 8; id |= recv_ec_data(); } else { /* Error or unknown system */ return id; }
/* Mask the board ID and log the information. */ id &= BOARD_ID_MASK; printk(BIOS_INFO, "[%s] board id: 0x%x\n", ec_system, id);
return id; }