Aamir Bohra has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/56756 )
Change subject: mb/amd/bilby: Add support for HDMI display ......................................................................
mb/amd/bilby: Add support for HDMI display
DDI 0/1 ports are shared for DP and HDMI. This implementation adds support for HDMI display when HDMI is set as connector type in ddi descriptors.
TEST=verify display over HDMI(0 and 1) in OS.
Signed-off-by: Aamir Bohra aamirbohra@gmail.com Change-Id: I9697211c556f12d1fc0d49418b227fbe6b342673 --- M src/mainboard/amd/bilby/Kconfig M src/mainboard/amd/bilby/mainboard.c A src/mainboard/amd/bilby/mainboard.h M src/mainboard/amd/bilby/port_descriptors.c 4 files changed, 64 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/56/56756/1
diff --git a/src/mainboard/amd/bilby/Kconfig b/src/mainboard/amd/bilby/Kconfig index 9510238..daa6b6e 100644 --- a/src/mainboard/amd/bilby/Kconfig +++ b/src/mainboard/amd/bilby/Kconfig @@ -106,4 +106,36 @@ int default 0
+choice + prompt "DDI-0 connector type" + default CONNECT_DP_ON_DDI_0 + +config CONNECT_HDMI_ON_DDI_0 + bool "Use HDMI interface" + +config CONNECT_DP_ON_DDI_0 + bool "Use Displayport interface" +endchoice + +config DDI0_CONNECTOR_TYPE + int + default 0 if CONNECT_DP_ON_DDI_0 + default 4 if CONNECT_HDMI_ON_DDI_0 + +choice + prompt "DDI-1 connector type" + default CONNECT_DP_ON_DDI_1 + +config CONNECT_HDMI_ON_DDI_1 + bool "Use HDMI interface" + +config CONNECT_DP_ON_DDI_1 + bool "Use Displayport interface" +endchoice + +config DDI1_CONNECTOR_TYPE + int + default 0 if CONNECT_DP_ON_DDI_1 + default 4 if CONNECT_HDMI_ON_DDI_1 + endif # BOARD_AMD_BILBY diff --git a/src/mainboard/amd/bilby/mainboard.c b/src/mainboard/amd/bilby/mainboard.c index 12f801d..4def65b 100644 --- a/src/mainboard/amd/bilby/mainboard.c +++ b/src/mainboard/amd/bilby/mainboard.c @@ -5,13 +5,18 @@ #include <acpi/acpi.h> #include <amdblocks/amd_pci_util.h> #include <FspsUpd.h> +#include <gpio.h> #include <soc/cpu.h> #include <soc/southbridge.h> #include <soc/pci_devs.h> +#include <soc/platform_descriptors.h> #include <types.h> #include <commonlib/helpers.h> #include <chip.h> #include "gpio.h" +#include "mainboard.h" + +#define MAINBOARD_SHARED_DDI_PORTS 2
/* TODO: recheck IRQ tables */
@@ -79,6 +84,20 @@ picr_data_ptr = fch_pic_routing; }
+static void program_display_sel_gpios(void) +{ + int idx, port_type; + gpio_t display_sel[MAINBOARD_SHARED_DDI_PORTS] = {GPIO_29, GPIO_31}; + + for (idx = 0; idx < MAINBOARD_SHARED_DDI_PORTS; idx++) { + port_type = get_ddi_port_conn_type(idx); + if (port_type == HDMI) + /* Set low for HDMI, DP(== HIGH) is default reset config */ + gpio_output(display_sel[idx], 0); + } + +} + static void mainboard_init(void *chip_info) { struct soc_amd_picasso_config *cfg = config_of_soc(); @@ -88,6 +107,8 @@
mainboard_program_gpios();
+ program_display_sel_gpios(); + /* Re-muxing LPCCLK0 can hang the system if LPC is in use. */ if (CONFIG(BILBY_LPC)) printk(BIOS_INFO, "eMMC not available due to LPC requirement\n"); diff --git a/src/mainboard/amd/bilby/mainboard.h b/src/mainboard/amd/bilby/mainboard.h new file mode 100644 index 0000000..9e4bb9c --- /dev/null +++ b/src/mainboard/amd/bilby/mainboard.h @@ -0,0 +1,3 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +int get_ddi_port_conn_type (uint8_t port_num); diff --git a/src/mainboard/amd/bilby/port_descriptors.c b/src/mainboard/amd/bilby/port_descriptors.c index 2801c73..912d711 100644 --- a/src/mainboard/amd/bilby/port_descriptors.c +++ b/src/mainboard/amd/bilby/port_descriptors.c @@ -2,6 +2,7 @@
#include <soc/platform_descriptors.h> #include <types.h> +#include "mainboard.h"
static const fsp_dxio_descriptor pco_dxio_descriptors[] = { { /* MXM - Entry 0 */ @@ -47,12 +48,12 @@
static const fsp_ddi_descriptor pco_ddi_descriptors[] = { { /* DDI0 - DP */ - .connector_type = DP, + .connector_type = CONFIG_DDI0_CONNECTOR_TYPE, .aux_index = AUX1, .hdp_index = HDP1 }, { /* DDI1 - DP */ - .connector_type = DP, + .connector_type = CONFIG_DDI1_CONNECTOR_TYPE, .aux_index = AUX2, .hdp_index = HDP2 }, @@ -68,6 +69,11 @@ } };
+int get_ddi_port_conn_type (uint8_t port_num) +{ + return pco_ddi_descriptors[port_num].connector_type; +} + 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)