payloads/edk2: Disable the CPU Timer Lib unless supported
[coreboot.git] / src / mainboard / intel / coffeelake_rvp / mainboard.c
blobeb9a316a34b60639d0ee7e45839cf12897f3ba72
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <acpi/acpi.h>
4 #include <baseboard/variants.h>
5 #include <device/device.h>
6 #include <nhlt.h>
7 #include <soc/gpio.h>
8 #include <soc/nhlt.h>
10 static void mainboard_init(void *chip_info)
12 const struct pad_config *pads;
13 size_t num;
15 pads = variant_gpio_table(&num);
16 gpio_configure_pads(pads, num);
19 static unsigned long mainboard_write_acpi_tables(const struct device *device,
20 unsigned long current,
21 acpi_rsdp_t *rsdp)
23 uintptr_t start_addr;
24 uintptr_t end_addr;
25 struct nhlt *nhlt;
27 start_addr = current;
29 nhlt = nhlt_init();
31 if (nhlt == NULL)
32 return start_addr;
34 variant_nhlt_init(nhlt);
36 end_addr = nhlt_soc_serialize(nhlt, start_addr);
38 if (end_addr != start_addr)
39 acpi_add_table(rsdp, (void *)start_addr);
41 return end_addr;
44 static void mainboard_enable(struct device *dev)
46 dev->ops->write_acpi_tables = mainboard_write_acpi_tables;
49 struct chip_operations mainboard_ops = {
50 .init = mainboard_init,
51 .enable_dev = mainboard_enable,