1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <baseboard/variants.h>
5 #include <device/device.h>
7 #include <soc/pci_devs.h>
10 #include <variant/gpio.h>
12 static void mainboard_init(struct device
*dev
)
17 static unsigned long mainboard_write_acpi_tables(const struct device
*device
,
18 unsigned long current
, acpi_rsdp_t
*rsdp
)
23 const char *oem_id
= NULL
;
24 const char *oem_table_id
= NULL
;
25 uint32_t oem_revision
= 0;
34 variant_nhlt_init(nhlt
);
35 variant_nhlt_oem_overrides(&oem_id
, &oem_table_id
, &oem_revision
);
37 end_addr
= nhlt_soc_serialize_oem_overrides(nhlt
, start_addr
,
38 oem_id
, oem_table_id
, oem_revision
);
40 if (end_addr
!= start_addr
)
41 acpi_add_table(rsdp
, (void *)start_addr
);
46 static void mainboard_enable(struct device
*dev
)
48 dev
->ops
->init
= mainboard_init
;
49 dev
->ops
->write_acpi_tables
= mainboard_write_acpi_tables
;
52 static void mainboard_chip_init(void *chip_info
)
54 const struct pad_config
*pads
;
57 pads
= variant_gpio_table(&num
);
58 gpio_configure_pads(pads
, num
);
59 pads
= variant_sku_gpio_table(&num
);
60 gpio_configure_pads(pads
, num
);
63 void __weak
variant_final(void)
68 static void mainboard_final(void *chip_info
)
73 struct chip_operations mainboard_ops
= {
74 .init
= mainboard_chip_init
,
75 .enable_dev
= mainboard_enable
,
76 .final
= mainboard_final