summaryrefslogtreecommitdiff
path: root/src/mainboard/google/fizz/mainboard.c
diff options
context:
space:
mode:
authorKevin Cheng <kevin.cheng@intel.com>2017-06-06 10:37:59 +0800
committerMartin Roth <martinroth@google.com>2017-06-28 17:39:51 +0000
commit2a6f4aecfe0b76aa3feb14c3267be226b328697b (patch)
tree282307b61aee82b8de62e8d5c6ce20915a2621ac /src/mainboard/google/fizz/mainboard.c
parent837da6ade7aebe9541b5a13e40b75ab2b308ac77 (diff)
downloadcoreboot-2a6f4aecfe0b76aa3feb14c3267be226b328697b.tar.xz
mainboard/google/fizz: Add audio devices
- Describe RT5663 headphone codec in ACPI so it can be enumerated by the OS. - Supply NHLT binaries for RT5663 BUG=b:62872377 TEST=Apply full patch set and UCM, verify basic audio works. Signed-off-by: Kevin Cheng <kevin.cheng@intel.com> Change-Id: I5bbd58b0e660cdf5089e6a6dd35a757ecf8ec076 Reviewed-on: https://review.coreboot.org/20305 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/mainboard/google/fizz/mainboard.c')
-rw-r--r--src/mainboard/google/fizz/mainboard.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/mainboard/google/fizz/mainboard.c b/src/mainboard/google/fizz/mainboard.c
index 1f6dc87c65..a925f084c7 100644
--- a/src/mainboard/google/fizz/mainboard.c
+++ b/src/mainboard/google/fizz/mainboard.c
@@ -18,13 +18,43 @@
#include <device/device.h>
#include <ec/ec.h>
#include <soc/pci_devs.h>
+#include <soc/nhlt.h>
#include <vendorcode/google/chromeos/chromeos.h>
+static const char *oem_id = "GOOGLE";
+static const char *oem_table_id = "FIZZ";
+
static void mainboard_init(device_t dev)
{
mainboard_ec_init();
}
+static unsigned long mainboard_write_acpi_tables(
+ device_t device, unsigned long current, acpi_rsdp_t *rsdp)
+{
+ uintptr_t start_addr;
+ uintptr_t end_addr;
+ struct nhlt *nhlt;
+
+ start_addr = current;
+
+ nhlt = nhlt_init();
+ if (!nhlt)
+ return start_addr;
+
+ /* RT5663 Headset codec */
+ if (nhlt_soc_add_rt5663(nhlt, AUDIO_LINK_SSP1))
+ printk(BIOS_ERR, "Couldn't add headset codec.\n");
+
+ end_addr = nhlt_soc_serialize_oem_overrides(nhlt, start_addr,
+ oem_id, oem_table_id, 0);
+
+ if (end_addr != start_addr)
+ acpi_add_table(rsdp, (void *)start_addr);
+
+ return end_addr;
+}
+
static void mainboard_enable(device_t dev)
{
device_t tpm;
@@ -44,6 +74,8 @@ static void mainboard_enable(device_t dev)
if (tpm)
tpm->enabled = 0;
}
+
+ dev->ops->write_acpi_tables = mainboard_write_acpi_tables;
}
struct chip_operations mainboard_ops = {