diff options
Diffstat (limited to 'src/mainboard')
-rw-r--r-- | src/mainboard/amd/bilby/Kconfig | 32 | ||||
-rw-r--r-- | src/mainboard/amd/bilby/gpio.c | 2 | ||||
-rw-r--r-- | src/mainboard/amd/bilby/mainboard.c | 23 | ||||
-rw-r--r-- | src/mainboard/amd/bilby/mainboard.h | 3 | ||||
-rw-r--r-- | src/mainboard/amd/bilby/port_descriptors.c | 10 |
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) |