diff options
author | Matt DeVillier <matt.devillier@gmail.com> | 2018-07-07 19:08:44 -0500 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2018-07-24 12:04:26 +0000 |
commit | 57dd0733699e5994ac3481cb4913ae5cea8ac857 (patch) | |
tree | 1ab3269ae38308f50dbdd98b915f4c94ba1b6593 /src/mainboard/google/glados/mainboard.c | |
parent | 4966a8c136eb12a0a3dc15a531d71eafb191fdf0 (diff) | |
download | coreboot-57dd0733699e5994ac3481cb4913ae5cea8ac857.tar.xz |
google/sentry: Add as a variant of glados
Add google/sentry (Lenovo Thinkpad 13 Chromebook) as a variant of
glados Skylake reference board:
- add sentry-specific DPTF, EC config, GPIO config, Kconfig,
NHLT config, PEI data, VBT, SPD data, and devicetree
- add sentry-specific GPIO determination of which audio codec
is present
Adapted from Chromium branch firmware-glados-7820.B, commit
b0c3efe54d877246d07f2467b2dff51cc30348fa [soc/intel/skylake: Enable VMX]
Test: build/boot google/sentry, verify correct functionality
Change-Id: I783422aedac8b7fc52098eebd05b2061a1011b60
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/27418
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Youness Alaoui <snifikino@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/google/glados/mainboard.c')
-rw-r--r-- | src/mainboard/google/glados/mainboard.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/mainboard/google/glados/mainboard.c b/src/mainboard/google/glados/mainboard.c index 451b3d4336..476bcf7001 100644 --- a/src/mainboard/google/glados/mainboard.c +++ b/src/mainboard/google/glados/mainboard.c @@ -19,8 +19,10 @@ #include <baseboard/variant.h> #include <console/console.h> #include <device/device.h> +#include <gpio.h> #include <stdlib.h> #include <soc/nhlt.h> +#include <variant/gpio.h> #include <vendorcode/google/chromeos/chromeos.h> #include "ec.h" @@ -32,6 +34,24 @@ static void mainboard_init(struct device *dev) mainboard_ec_init(); } +static uint8_t adi_codec_enable(void) +{ +#ifdef AUDIO_DB_ID + return gpio_get(AUDIO_DB_ID); +#else + return 1; +#endif +} + +static uint8_t max_codec_enable(void) +{ +#ifdef AUDIO_DB_ID + return gpio_get(AUDIO_DB_ID) ? 0 : 1; +#else + return 1; +#endif +} + static unsigned long mainboard_write_acpi_tables( struct device *device, unsigned long current, acpi_rsdp_t *rsdp) { @@ -58,12 +78,12 @@ static unsigned long mainboard_write_acpi_tables( printk(BIOS_ERR, "Couldn't add 4CH DMIC arrays.\n"); /* ADI Smart Amps for left and right. */ - if (IS_ENABLED(CONFIG_NHLT_SSM4567)) + if (IS_ENABLED(CONFIG_NHLT_SSM4567) && adi_codec_enable()) if (nhlt_soc_add_ssm4567(nhlt, AUDIO_LINK_SSP0)) printk(BIOS_ERR, "Couldn't add ssm4567.\n"); /* MAXIM Smart Amps for left and right. */ - if (IS_ENABLED(CONFIG_NHLT_MAX98357)) { + if (IS_ENABLED(CONFIG_NHLT_MAX98357) && max_codec_enable()) { if (nhlt_soc_add_max98357(nhlt, AUDIO_LINK_SSP0)) printk(BIOS_ERR, "Couldn't add max98357.\n"); |