From 170f2edadb5688989cbb1a7b899fb0a0615f78bd Mon Sep 17 00:00:00 2001 From: "Tan, Lean Sheng" Date: Fri, 27 Nov 2020 03:56:08 -0800 Subject: mb/intel/ehlcrb: Remove board ID detection via EC Since there is no EC support on EHL CRB, this patch removes board ID detection via EC (board_id.c & board_id.h) and its related files. Temporarily removes variant_memcfg_config function in romstage_fsp_param.c, will be added back when updating memory configs later. Signed-off-by: Tan, Lean Sheng Change-Id: I40d96285dc05ec5faabc123950b6b3728299e99a Reviewed-on: https://review.coreboot.org/c/coreboot/+/48121 Reviewed-by: Frans Hendriks Reviewed-by: Werner Zeh Tested-by: build bot (Jenkins) --- src/mainboard/intel/elkhartlake_crb/Makefile.inc | 3 -- src/mainboard/intel/elkhartlake_crb/board_id.c | 43 ---------------------- src/mainboard/intel/elkhartlake_crb/board_id.h | 15 -------- .../intel/elkhartlake_crb/romstage_fsp_params.c | 1 - .../baseboard/include/baseboard/variants.h | 2 +- .../intel/elkhartlake_crb/variants/ehlcrb/memory.c | 8 ---- 6 files changed, 1 insertion(+), 71 deletions(-) delete mode 100644 src/mainboard/intel/elkhartlake_crb/board_id.c delete mode 100644 src/mainboard/intel/elkhartlake_crb/board_id.h diff --git a/src/mainboard/intel/elkhartlake_crb/Makefile.inc b/src/mainboard/intel/elkhartlake_crb/Makefile.inc index 69a93685ba..382ec2e354 100644 --- a/src/mainboard/intel/elkhartlake_crb/Makefile.inc +++ b/src/mainboard/intel/elkhartlake_crb/Makefile.inc @@ -5,11 +5,8 @@ subdirs-y += spd bootblock-y += bootblock.c romstage-y += romstage_fsp_params.c -romstage-y += board_id.c ramstage-y += mainboard.c -ramstage-y += board_id.c - subdirs-y += variants/baseboard CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include diff --git a/src/mainboard/intel/elkhartlake_crb/board_id.c b/src/mainboard/intel/elkhartlake_crb/board_id.c deleted file mode 100644 index 90609ff079..0000000000 --- a/src/mainboard/intel/elkhartlake_crb/board_id.c +++ /dev/null @@ -1,43 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include -#include -#include -#include - -#include "board_id.h" - -static uint32_t get_board_id_via_ext_ec(void) -{ - uint32_t id = BOARD_ID_INIT; - - if (google_chromeec_get_board_version(&id)) - id = BOARD_ID_UNKNOWN; - - return id; -} - -/* - * Get Board ID via EC I/O port write/read - * Board id is 5 bit, so mask other bits while returning board id. - */ -int get_board_id(void) -{ - MAYBE_STATIC_NONZERO int id = -1; - - if (id < 0) { - if (CONFIG(EC_GOOGLE_CHROMEEC)) { - id = get_board_id_via_ext_ec(); - } else { - uint8_t buffer[2]; - uint8_t index; - if (send_ec_command(EC_FAB_ID_CMD) == 0) { - for (index = 0; index < sizeof(buffer); index++) - buffer[index] = recv_ec_data(); - id = (buffer[0] << 8) | buffer[1]; - } - } - } - - return (id & 0x1f); -} diff --git a/src/mainboard/intel/elkhartlake_crb/board_id.h b/src/mainboard/intel/elkhartlake_crb/board_id.h deleted file mode 100644 index 85c7c85f40..0000000000 --- a/src/mainboard/intel/elkhartlake_crb/board_id.h +++ /dev/null @@ -1,15 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#ifndef _MAINBOARD_COMMON_BOARD_ID_H_ -#define _MAINBOARD_COMMON_BOARD_ID_H_ - -/* Board/FAB ID Command */ -#define EC_FAB_ID_CMD 0x0D - -/* - * Returns board information (board id[15:8] and - * Fab info[7:0]) on success and < 0 on error - */ -int get_board_id(void); - -#endif /* _MAINBOARD_COMMON_BOARD_ID_H_ */ diff --git a/src/mainboard/intel/elkhartlake_crb/romstage_fsp_params.c b/src/mainboard/intel/elkhartlake_crb/romstage_fsp_params.c index 1354edf74e..481ff0939a 100644 --- a/src/mainboard/intel/elkhartlake_crb/romstage_fsp_params.c +++ b/src/mainboard/intel/elkhartlake_crb/romstage_fsp_params.c @@ -4,7 +4,6 @@ #include #include #include -#include "board_id.h" void mainboard_memory_init_params(FSPM_UPD *memupd) { diff --git a/src/mainboard/intel/elkhartlake_crb/variants/baseboard/include/baseboard/variants.h b/src/mainboard/intel/elkhartlake_crb/variants/baseboard/include/baseboard/variants.h index 53bb75ad23..bf057651d3 100644 --- a/src/mainboard/intel/elkhartlake_crb/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/intel/elkhartlake_crb/variants/baseboard/include/baseboard/variants.h @@ -13,6 +13,6 @@ const struct pad_config *variant_gpio_table(size_t *num); const struct pad_config *variant_early_gpio_table(size_t *num); /* This function returns SPD related FSP-M mainboard configs */ -const struct mb_cfg *variant_memcfg_config(uint8_t board_id); +const struct mb_cfg *variant_memcfg_config(void); #endif /*__BASEBOARD_VARIANTS_H__ */ diff --git a/src/mainboard/intel/elkhartlake_crb/variants/ehlcrb/memory.c b/src/mainboard/intel/elkhartlake_crb/variants/ehlcrb/memory.c index 8446e6cb0f..11db7323c4 100644 --- a/src/mainboard/intel/elkhartlake_crb/variants/ehlcrb/memory.c +++ b/src/mainboard/intel/elkhartlake_crb/variants/ehlcrb/memory.c @@ -1,16 +1,8 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include -#include #include #include #include /* ToDo : Fill EHL related memory configs */ - -const struct mb_cfg *variant_memcfg_config(uint8_t board_id) -{ - /* ToDo : Fill EHL related memory configs */ - - die("unsupported board id : 0x%x\n", board_id); -} -- cgit v1.2.3