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/55699662_ea8256bd?usp... : PS5, Line 21: get_rvp_board_id 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; char *ec_system;
/* Reading board ID after the first time reading. */ if (id != BOARD_ID_UNKNOWN) return id;
/* Reading from EC failed. */ if (id == BOARD_ID_INIT) return BOARD_ID_UNKNOWN;
/* Reading board ID for the first time. */ /* Chrome_EC */ if (CONFIG(EC_GOOGLE_CHROMEEC)) { ec_system = "ChromeEC"; id = get_board_id_via_ext_ec(); goto done; }
/* Windows EC */ if (send_ec_command(EC_FAB_ID_CMD) != 0) { id = BOARD_ID_INIT; goto out; }
ec_system = "WinEC"; id = recv_ec_data() << 8; id |= recv_ec_data();
done: id &= BOARD_ID_MASK; printk(BIOS_INFO, "[%s] board id: 0x%x\n", ec_system, id); out: return id; }