summaryrefslogtreecommitdiff
path: root/src/mainboard/amd/bilby
diff options
context:
space:
mode:
authorAamir Bohra <aamirbohra@gmail.com>2021-03-31 17:35:20 +0530
committerPaul Fagerburg <pfagerburg@chromium.org>2021-08-04 15:16:05 +0000
commit9fe70ed1975cce3fd839a975c71e6c6bf0013d98 (patch)
tree503f92d8d9a40299e2771fb449e6dc4c3494c605 /src/mainboard/amd/bilby
parent9e34060d52533b5f0891d2a31beb65946d27e082 (diff)
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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56756 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'src/mainboard/amd/bilby')
-rw-r--r--src/mainboard/amd/bilby/Kconfig32
-rw-r--r--src/mainboard/amd/bilby/gpio.c2
-rw-r--r--src/mainboard/amd/bilby/mainboard.c23
-rw-r--r--src/mainboard/amd/bilby/mainboard.h3
-rw-r--r--src/mainboard/amd/bilby/port_descriptors.c10
5 files changed, 66 insertions, 4 deletions
diff --git a/src/mainboard/amd/bilby/Kconfig b/src/mainboard/amd/bilby/Kconfig
index 9510238944..daa6b6ef54 100644
--- a/src/mainboard/amd/bilby/Kconfig
+++ b/src/mainboard/amd/bilby/Kconfig
@@ -106,4 +106,36 @@ config EFS_SPI_MICRON_FLAG
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/gpio.c b/src/mainboard/amd/bilby/gpio.c
index 0d498164ca..2ac4a5f6dd 100644
--- a/src/mainboard/amd/bilby/gpio.c
+++ b/src/mainboard/amd/bilby/gpio.c
@@ -17,8 +17,6 @@ static const struct soc_amd_gpio gpio_set_stage_ram[] = {
PAD_GPI(GPIO_11, PULL_UP),
/* APU_ALS_INT# */
PAD_SCI(GPIO_24, PULL_UP, EDGE_LOW),
- /* SD card detect */
- PAD_GPI(GPIO_31, PULL_UP),
/* NFC IRQ */
PAD_INT(GPIO_69, PULL_UP, EDGE_LOW, STATUS),
};
diff --git a/src/mainboard/amd/bilby/mainboard.c b/src/mainboard/amd/bilby/mainboard.c
index 12f801d9f1..bc91630bf6 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,22 @@ static void pirq_setup(void)
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)
+ gpio_output(display_sel[idx], 0);
+ else if (port_type == DP)
+ gpio_output(display_sel[idx], 1);
+ }
+
+}
+
static void mainboard_init(void *chip_info)
{
struct soc_amd_picasso_config *cfg = config_of_soc();
@@ -88,6 +109,8 @@ static void mainboard_init(void *chip_info)
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 0000000000..b58c350042
--- /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 2801c73821..522e390073 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_dxio_descriptor pco_dxio_descriptors[] = {
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 @@ static const fsp_ddi_descriptor pco_ddi_descriptors[] = {
}
};
+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)