cpu/x86/smm/pci_resource_store: Store DEV/VEN ID
[coreboot2.git] / src / mainboard / google / parrot / mainboard.c
blobf921812687ff850843fba31772c1ae84e2b4be2d
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <types.h>
4 #include <cpu/x86/smm.h>
5 #include <device/device.h>
6 #include <drivers/intel/gma/int15.h>
7 #include <acpi/acpi.h>
8 #include "onboard.h"
9 #include "ec.h"
10 #include <southbridge/intel/bd82x6x/pch.h>
11 #include <smbios.h>
12 #include <ec/compal/ene932/ec.h>
14 void mainboard_suspend_resume(void)
16 /* Enable ACPI mode before OS resume */
17 apm_control(APM_CNT_ACPI_ENABLE);
20 static void mainboard_init(struct device *dev)
22 /* Initialize the Embedded Controller */
23 parrot_ec_init();
26 static int parrot_onboard_smbios_data(struct device *dev, int *handle,
27 unsigned long *current)
29 int len = 0;
30 u8 hardware_version = parrot_rev();
31 if (hardware_version < 0x2) { /* DVT vs PVT */
32 len += smbios_write_type41(
33 current, handle,
34 BOARD_TRACKPAD_NAME, /* name */
35 BOARD_TRACKPAD_IRQ_DVT, /* instance */
36 0, /* segment */
37 BOARD_TRACKPAD_I2C_ADDR, /* bus */
38 0, /* device */
39 0, /* function */
40 SMBIOS_DEVICE_TYPE_OTHER); /* device type */
41 } else {
42 len += smbios_write_type41(
43 current, handle,
44 BOARD_TRACKPAD_NAME, /* name */
45 BOARD_TRACKPAD_IRQ_PVT, /* instance */
46 0, /* segment */
47 BOARD_TRACKPAD_I2C_ADDR, /* bus */
48 0, /* device */
49 0, /* function */
50 SMBIOS_DEVICE_TYPE_OTHER); /* device type */
53 return len;
56 static void mainboard_enable(struct device *dev)
58 dev->ops->init = mainboard_init;
59 dev->ops->get_smbios_data = parrot_onboard_smbios_data;
60 install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
63 struct chip_operations mainboard_ops = {
64 .enable_dev = mainboard_enable,