From 80496f09670095acce4c7a002c28af5d6bc9198c Mon Sep 17 00:00:00 2001 From: David Wu Date: Fri, 14 Sep 2018 21:30:39 +0800 Subject: mb/google/fizz: Provide nhlt variant API Move current NHLT configuration implementation to baseboard so that variants can leverage it or provide their own configuration. BUG=b:117066935 BRANCH=Fizz TEST=emerge-fizz coreboot Change-Id: I30d93babb6fc09e8642b3740f1f7638fa33f0ade Signed-off-by: David Wu Reviewed-on: https://review.coreboot.org/28965 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Furquan Shaikh --- .../google/fizz/variants/baseboard/Makefile.inc | 1 + .../baseboard/include/baseboard/variants.h | 5 +++ .../google/fizz/variants/baseboard/nhlt.c | 36 ++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 src/mainboard/google/fizz/variants/baseboard/nhlt.c (limited to 'src/mainboard/google/fizz/variants') diff --git a/src/mainboard/google/fizz/variants/baseboard/Makefile.inc b/src/mainboard/google/fizz/variants/baseboard/Makefile.inc index 9fb63f5f43..0ad298b5f4 100644 --- a/src/mainboard/google/fizz/variants/baseboard/Makefile.inc +++ b/src/mainboard/google/fizz/variants/baseboard/Makefile.inc @@ -1,3 +1,4 @@ bootblock-y += gpio.c ramstage-y += gpio.c +ramstage-y += nhlt.c diff --git a/src/mainboard/google/fizz/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/fizz/variants/baseboard/include/baseboard/variants.h index ceef7fb755..50e7ee37c3 100644 --- a/src/mainboard/google/fizz/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/fizz/variants/baseboard/include/baseboard/variants.h @@ -29,4 +29,9 @@ const struct pad_config *variant_early_gpio_table(size_t *num); const struct cros_gpio *variant_cros_gpios(size_t *num); +struct nhlt; +void variant_nhlt_init(struct nhlt *nhlt); +void variant_nhlt_oem_overrides(const char **oem_id, const char **oem_table_id, + uint32_t *oem_revision); + #endif /* __BASEBOARD_VARIANTS_H__ */ diff --git a/src/mainboard/google/fizz/variants/baseboard/nhlt.c b/src/mainboard/google/fizz/variants/baseboard/nhlt.c new file mode 100644 index 0000000000..6918d9a5f1 --- /dev/null +++ b/src/mainboard/google/fizz/variants/baseboard/nhlt.c @@ -0,0 +1,36 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2018 Google Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ +#include +#include +#include +#include + +void __weak variant_nhlt_init(struct nhlt *nhlt) +{ + + /* RT5663 Headset codec */ + if (nhlt_soc_add_rt5663(nhlt, AUDIO_LINK_SSP1)) + printk(BIOS_ERR, "Couldn't add headset codec.\n"); + +} + +void __weak variant_nhlt_oem_overrides(const char **oem_id, + const char **oem_table_id, + uint32_t *oem_revision) +{ + *oem_id = "GOOGLE"; + *oem_table_id = "FIZZ"; + *oem_revision = 0; +} -- cgit v1.2.3