cpu/x86/smm/pci_resource_store: Store DEV/VEN ID
[coreboot2.git] / src / mainboard / google / eve / mainboard.c
blobefe47a0b1230542d87c9e93661851adafb287d59
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <acpi/acpi.h>
4 #include <console/console.h>
5 #include <device/device.h>
6 #include <ec/ec.h>
7 #include <soc/nhlt.h>
9 #include "gpio.h"
11 #define SUBSYSTEM_ID 0x1AE0006B
13 static const char *oem_id_maxim = "GOOGLE";
14 static const char *oem_table_id_maxim = "EVEMAX";
16 static void mainboard_init(struct device *dev)
18 mainboard_ec_init();
21 static unsigned long mainboard_write_acpi_tables(
22 const struct device *device, unsigned long current, acpi_rsdp_t *rsdp)
24 uintptr_t start_addr;
25 uintptr_t end_addr;
26 struct nhlt *nhlt;
28 start_addr = current;
30 nhlt = nhlt_init();
31 if (!nhlt)
32 return start_addr;
34 nhlt->subsystem_id = SUBSYSTEM_ID;
36 /* 4 Channel DMIC array */
37 if (nhlt_soc_add_rt5514(nhlt, AUDIO_LINK_SSP0, 4, 1))
38 printk(BIOS_ERR, "Couldn't add rt5514.\n");
40 /* RT5663 Headset codec */
41 if (nhlt_soc_add_rt5663(nhlt, AUDIO_LINK_SSP1))
42 printk(BIOS_ERR, "Couldn't add headset codec.\n");
44 /* MAXIM98927 Smart Amps for left and right channel */
45 /* Render time_slot is 0 and feedback time_slot is 2 */
46 if (nhlt_soc_add_max98927(nhlt, AUDIO_LINK_SSP0, 0, 2))
47 printk(BIOS_ERR, "Couldn't add max98927\n");
49 end_addr = nhlt_soc_serialize_oem_overrides(nhlt, start_addr,
50 oem_id_maxim, oem_table_id_maxim, 0);
52 if (end_addr != start_addr)
53 acpi_add_table(rsdp, (void *)start_addr);
55 return end_addr;
58 static void mainboard_enable(struct device *dev)
60 dev->ops->init = mainboard_init;
61 dev->ops->write_acpi_tables = mainboard_write_acpi_tables;
64 static void mainboard_chip_init(void *chip_info)
66 gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table));
69 struct chip_operations mainboard_ops = {
70 .init = mainboard_chip_init,
71 .enable_dev = mainboard_enable,