From dcd7ec25cdfbe097ac4d269facd00582e52d980c Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Fri, 24 Feb 2023 13:51:41 -0700 Subject: [PATCH] mb/google/skyrim: Allow port descriptors to be overridden This allows variants to override the skyrim port descriptors. BUG=None TEST=Tested with following patches BRANCH=skyrim Signed-off-by: Martin Roth Change-Id: I8cff44f5b39d130a7191a69970cae8a88bb5d475 Reviewed-on: https://review.coreboot.org/c/coreboot/+/73294 Tested-by: build bot (Jenkins) Reviewed-by: Tim Van Patten Reviewed-by: Eric Lai Reviewed-by: Matt DeVillier --- src/mainboard/google/skyrim/Kconfig | 6 ++++++ src/mainboard/google/skyrim/port_descriptors.c | 13 +++++++++++-- .../variants/baseboard/include/baseboard/variants.h | 3 +++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/mainboard/google/skyrim/Kconfig b/src/mainboard/google/skyrim/Kconfig index 3ab1a6fd5f..89fc9cbcd6 100644 --- a/src/mainboard/google/skyrim/Kconfig +++ b/src/mainboard/google/skyrim/Kconfig @@ -122,6 +122,12 @@ config VARIANT_DIR default "crystaldrift" if BOARD_GOOGLE_CRYSTALDRIFT default "markarth" if BOARD_GOOGLE_MARKARTH +config USE_VARIANT_DXIO_DESCRIPTOR + bool + help + Enable this to allow a variant to override the dxio descriptor values + in port_descriptors.c + config VBOOT select EC_GOOGLE_CHROMEEC_SWITCHES select VBOOT_LID_SWITCH diff --git a/src/mainboard/google/skyrim/port_descriptors.c b/src/mainboard/google/skyrim/port_descriptors.c index d745bd7e1d..067b656065 100644 --- a/src/mainboard/google/skyrim/port_descriptors.c +++ b/src/mainboard/google/skyrim/port_descriptors.c @@ -5,6 +5,9 @@ #include #include +#if CONFIG(USE_VARIANT_DXIO_DESCRIPTOR) +static const fsp_dxio_descriptor skyrim_mdn_dxio_descriptors[] = {}; +#else static const fsp_dxio_descriptor skyrim_mdn_dxio_descriptors[] = { { /* WLAN */ .engine_type = PCIE_ENGINE, @@ -48,6 +51,7 @@ static const fsp_dxio_descriptor skyrim_mdn_dxio_descriptors[] = { .clk_req = CLK_REQ0, }, }; +#endif static const fsp_ddi_descriptor skyrim_mdn_ddi_descriptors[] = { { /* DDI0 - eDP */ @@ -81,8 +85,13 @@ void mainboard_get_dxio_ddi_descriptors( const fsp_dxio_descriptor **dxio_descs, size_t *dxio_num, const fsp_ddi_descriptor **ddi_descs, size_t *ddi_num) { - *dxio_descs = skyrim_mdn_dxio_descriptors; - *dxio_num = ARRAY_SIZE(skyrim_mdn_dxio_descriptors); + if (CONFIG(USE_VARIANT_DXIO_DESCRIPTOR)) { + variant_get_dxio_descriptor(dxio_descs, dxio_num); + } else { + *dxio_descs = skyrim_mdn_dxio_descriptors; + *dxio_num = ARRAY_SIZE(skyrim_mdn_dxio_descriptors); + } + *ddi_descs = skyrim_mdn_ddi_descriptors; *ddi_num = ARRAY_SIZE(skyrim_mdn_ddi_descriptors); } diff --git a/src/mainboard/google/skyrim/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/skyrim/variants/baseboard/include/baseboard/variants.h index f2cd76bbe5..a340530be7 100644 --- a/src/mainboard/google/skyrim/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/skyrim/variants/baseboard/include/baseboard/variants.h @@ -44,4 +44,7 @@ void baseboard_romstage_gpio_table(const struct soc_amd_gpio **gpio, size_t *siz /* This function allows variant to override any GPIO init in romstage. */ void variant_romstage_override_gpio_table(const struct soc_amd_gpio **gpio, size_t *size); +/* Allow variants to override the DXIO Descriptors */ +void variant_get_dxio_descriptor(const fsp_dxio_descriptor **dxio_descs, size_t *dxio_num); + #endif /* __BASEBOARD_VARIANTS_H__ */