payloads/edk2: Disable the CPU Timer Lib unless supported
[coreboot.git] / src / mainboard / intel / glkrvp / mainboard.c
blob1cfa4e06d56e10728828c5990945d21f70eab7a9
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <acpi/acpi.h>
4 #include <baseboard/variants.h>
5 #include <boardid.h>
6 #include <console/console.h>
7 #include <device/device.h>
8 #include <ec/ec.h>
9 #include <nhlt.h>
10 #include <soc/gpio.h>
11 #include <soc/nhlt.h>
12 #include <variant/ec.h>
13 #include <variant/gpio.h>
15 static void mainboard_init(void *chip_info)
17 int boardid;
18 const struct pad_config *pads;
19 size_t num;
21 boardid = board_id();
22 printk(BIOS_INFO, "Board ID: %d\n", boardid);
24 pads = variant_gpio_table(&num);
25 gpio_configure_pads(pads, num);
27 mainboard_ec_init();
30 static unsigned long mainboard_write_acpi_tables(
31 const struct device *device, unsigned long current, acpi_rsdp_t *rsdp)
33 uintptr_t start_addr;
34 uintptr_t end_addr;
35 struct nhlt *nhlt;
37 start_addr = current;
39 nhlt = nhlt_init();
41 if (nhlt == NULL)
42 return start_addr;
44 variant_nhlt_init(nhlt);
46 end_addr = nhlt_soc_serialize(nhlt, start_addr);
48 if (end_addr != start_addr)
49 acpi_add_table(rsdp, (void *)start_addr);
51 return end_addr;
54 static void mainboard_enable(struct device *dev)
56 dev->ops->write_acpi_tables = mainboard_write_acpi_tables;
59 struct chip_operations mainboard_ops = {
60 .init = mainboard_init,
61 .enable_dev = mainboard_enable,