Angel Pons | 7544e2f | 2020-04-03 01:23:10 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Patrick Georgi | 021b703 | 2012-11-06 11:05:38 +0100 | [diff] [blame] | 2 | |
Patrick Georgi | 021b703 | 2012-11-06 11:05:38 +0100 | [diff] [blame] | 3 | #include <arch/io.h> |
Patrick Georgi | 021b703 | 2012-11-06 11:05:38 +0100 | [diff] [blame] | 4 | #include <device/device.h> |
Vladimir Serbinenko | a2a906e | 2014-09-01 01:41:37 +0200 | [diff] [blame] | 5 | #include <drivers/intel/gma/int15.h> |
Patrick Georgi | 021b703 | 2012-11-06 11:05:38 +0100 | [diff] [blame] | 6 | #include <pc80/keyboard.h> |
| 7 | #include <ec/acpi/ec.h> |
Patrick Georgi | 021b703 | 2012-11-06 11:05:38 +0100 | [diff] [blame] | 8 | |
Patrick Georgi | 021b703 | 2012-11-06 11:05:38 +0100 | [diff] [blame] | 9 | static void ec_setup(void) |
| 10 | { |
Elyes HAOUAS | 8ab989e | 2016-07-30 17:46:17 +0200 | [diff] [blame] | 11 | /* Thermal limits? Values are from ectool's RAM dump. */ |
Patrick Georgi | 021b703 | 2012-11-06 11:05:38 +0100 | [diff] [blame] | 12 | ec_write(0xd1, 0x57); /* CPUH */ |
| 13 | ec_write(0xd2, 0xc9); /* CPUL */ |
| 14 | ec_write(0xd4, 0x64); /* SYSH */ |
| 15 | ec_write(0xd5, 0xc9); /* SYSL */ |
| 16 | |
| 17 | send_ec_command(0x04); /* Set_SMI_Enable */ |
| 18 | send_ec_command(0xab); /* Set_ACPI_Disable */ |
| 19 | send_ec_command(0xac); /* Clr_SYS_Flag? well, why not? */ |
| 20 | send_ec_command(0xad); /* Set_Thml_Value */ |
| 21 | } |
| 22 | |
Elyes HAOUAS | c4c2d4e | 2018-05-05 08:50:02 +0200 | [diff] [blame] | 23 | static void mainboard_enable(struct device *dev) |
Patrick Georgi | 021b703 | 2012-11-06 11:05:38 +0100 | [diff] [blame] | 24 | { |
| 25 | ec_setup(); |
Vladimir Serbinenko | a2a906e | 2014-09-01 01:41:37 +0200 | [diff] [blame] | 26 | /* LCD panel type is SIO GPIO40-43. |
| 27 | It's controlled by a DIP switch but was always |
| 28 | set to 4 while only values of 5 and 6 worked. */ |
| 29 | install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, (inb(0x60f) & 0x0f) + 1); |
Patrick Georgi | 021b703 | 2012-11-06 11:05:38 +0100 | [diff] [blame] | 30 | |
| 31 | /* We have no driver for the embedded controller since the firmware |
| 32 | does most of the job. Hence, initialize keyboards here. */ |
Timothy Pearson | 448e386 | 2015-11-24 14:12:01 -0600 | [diff] [blame] | 33 | pc_keyboard_init(NO_AUX_DEVICE); |
Patrick Georgi | 021b703 | 2012-11-06 11:05:38 +0100 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | struct chip_operations mainboard_ops = { |
| 37 | .enable_dev = mainboard_enable, |
| 38 | }; |