Martin L Roth has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/73294 )
Change subject: mb/google/skyrim: Allow port descriptors to be overridden ......................................................................
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
Signed-off-by: Martin Roth gaumless@gmail.com Change-Id: I8cff44f5b39d130a7191a69970cae8a88bb5d475 --- M src/mainboard/google/skyrim/port_descriptors.c M src/mainboard/google/skyrim/variants/baseboard/include/baseboard/variants.h 2 files changed, 48 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/73294/1
diff --git a/src/mainboard/google/skyrim/port_descriptors.c b/src/mainboard/google/skyrim/port_descriptors.c index d745bd7..d293343 100644 --- a/src/mainboard/google/skyrim/port_descriptors.c +++ b/src/mainboard/google/skyrim/port_descriptors.c @@ -77,12 +77,32 @@ }, };
-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) +__weak void variant_get_dxio_descriptor(const fsp_dxio_descriptor **dxio_descs, size_t *dxio_num) { - *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); + *dxio_num = 0; + *dxio_descs = NULL; +} + +__weak void variant_get_ddi_descriptor(const fsp_ddi_descriptor **ddi_descs, size_t *ddi_num) +{ + *ddi_num = 0; + *ddi_descs = NULL; +} + +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) +{ + variant_get_dxio_descriptor(dxio_descs, dxio_num); + if (!*dxio_num || !*dxio_descs) + { + *dxio_descs = skyrim_mdn_dxio_descriptors; + *dxio_num = ARRAY_SIZE(skyrim_mdn_dxio_descriptors); + } + + variant_get_ddi_descriptor(ddi_descs, ddi_num); + if (!*ddi_num || !*ddi_descs) { + *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 f2cd76b..a06682f 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,10 @@ /* 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); + +/* Allow variants to override the DDI Descriptors */ +void variant_get_ddi_descriptor(const fsp_ddi_descriptor **ddi_descs, size_t *ddi_num); + #endif /* __BASEBOARD_VARIANTS_H__ */