• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
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>
13 
mainboard_suspend_resume(void)14 void mainboard_suspend_resume(void)
15 {
16 	/* Enable ACPI mode before OS resume */
17 	apm_control(APM_CNT_ACPI_ENABLE);
18 }
19 
mainboard_init(struct device * dev)20 static void mainboard_init(struct device *dev)
21 {
22 	/* Initialize the Embedded Controller */
23 	parrot_ec_init();
24 }
25 
parrot_onboard_smbios_data(struct device * dev,int * handle,unsigned long * current)26 static int parrot_onboard_smbios_data(struct device *dev, int *handle,
27 				     unsigned long *current)
28 {
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 */
51 	}
52 
53 	return len;
54 }
55 
mainboard_enable(struct device * dev)56 static void mainboard_enable(struct device *dev)
57 {
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);
61 }
62 
63 struct chip_operations mainboard_ops = {
64 	.enable_dev = mainboard_enable,
65 };
66