2 * This file is part of the coreboot project.
4 * Copyright (C) 2007-2009 coresystems GmbH
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
22 #include <console/console.h>
23 #include <device/device.h>
24 #include <device/pci_def.h>
26 #include <boot/tables.h>
33 #define MAX_LCD_BRIGHTNESS 0xd8
35 static void ec_enable(void)
38 /* Enable Hotkey SCI */
40 /* Fn key map; F1 = [0] ... F12 = [11] */
42 send_ec_oem_command(0x45);
43 send_ec_oem_data(0x09); // SCI
44 // send_ec_oem_data(0x08); // SMI#
45 send_ec_oem_data(keymap >> 8);
46 send_ec_oem_data(keymap & 0xff);
48 /* Enable Backlight */
49 ec_write(0x17, MAX_LCD_BRIGHTNESS);
51 /* Notify EC system is in ACPI mode */
52 send_ec_oem_command(0x5e);
53 send_ec_oem_data(0xea);
54 send_ec_oem_data(0x0c);
55 send_ec_oem_data(0x01);
58 static void pcie_limit_power(void)
61 // This piece of code needs further debugging as it crashes the
62 // machine. It should set the slot numbers and enable power
63 // limitation for the PCIe slots.
67 dev = dev_find_slot(0, PCI_DEVFN(28,0));
68 if (dev) pci_write_config32(dev, 0x54, 0x0010a0e0);
70 dev = dev_find_slot(0, PCI_DEVFN(28,1));
71 if (dev) pci_write_config32(dev, 0x54, 0x0018a0e0);
73 dev = dev_find_slot(0, PCI_DEVFN(28,2));
74 if (dev) pci_write_config32(dev, 0x54, 0x0020a0e0);
76 dev = dev_find_slot(0, PCI_DEVFN(28,3));
77 if (dev) pci_write_config32(dev, 0x54, 0x0028a0e0);
81 static void verb_setup(void)
83 cim_verb_data = mainboard_cim_verb_data;
84 cim_verb_data_size = sizeof(mainboard_cim_verb_data);
87 static void mainboard_init(device_t dev)
92 // mainboard_enable is executed as first thing after
93 // enumerate_buses(). Is there no mainboard_init()?
94 static void mainboard_enable(device_t dev)
96 dev->ops->init = mainboard_init;
101 struct chip_operations mainboard_ops = {
102 CHIP_NAME("Getac P470 Rugged Notebook")
103 .enable_dev = mainboard_enable,