| 1 |
|
| 2 |
|
| 3 |
#include <arch/io.h> |
| 4 |
#include <device/device.h> |
| 5 |
#include <ec/lenovo/pmh7/pmh7.h> |
| 6 |
#include <ec/lenovo/h8/h8.h> |
| 7 |
#include <ec/acpi/ec.h> |
| 8 |
#include <northbridge/intel/i945/i945.h> |
| 9 |
#include <southbridge/intel/i82801gx/chip.h> |
| 10 |
#include <drivers/intel/gma/int15.h> |
| 11 |
#include <acpi/acpigen.h> |
| 12 |
|
| 13 |
#define PANEL INT15_5F35_CL_DISPLAY_DEFAULT |
| 14 |
|
| 15 |
static void mainboard_init(struct device *dev) |
| 16 |
{ |
| 17 |
struct southbridge_intel_i82801gx_config *config; |
| 18 |
struct device *idedev; |
| 19 |
|
| 20 |
install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, |
| 21 |
GMA_INT15_PANEL_FIT_DEFAULT, |
| 22 |
PANEL, 3); |
| 23 |
|
| 24 |
|
| 25 |
if (acpi_is_wakeup_s3()) |
| 26 |
ec_write(0x0c, 0xc7); |
| 27 |
|
| 28 |
idedev = pcidev_on_root(0x1f, 1); |
| 29 |
|
| 30 |
if (!(inb(DEFAULT_GPIOBASE + 0x0c) & 0x40)) { |
| 31 |
|
| 32 |
pmh7_ultrabay_power_enable(1); |
| 33 |
ec_write(0x0c, 0x84); |
| 34 |
} else if (idedev && idedev->chip_info && |
| 35 |
h8_ultrabay_device_present()) { |
| 36 |
config = idedev->chip_info; |
| 37 |
config->ide_enable_primary = true; |
| 38 |
pmh7_ultrabay_power_enable(1); |
| 39 |
ec_write(0x0c, 0x84); |
| 40 |
} else { |
| 41 |
pmh7_ultrabay_power_enable(0); |
| 42 |
ec_write(0x0c, 0x04); |
| 43 |
} |
| 44 |
|
| 45 |
|
| 46 |
ec_write(0x0c, 0x08); |
| 47 |
ec_write(0x0c, inb(0x164c) & 8 ? 0x89 : 0x09); |
| 48 |
} |
| 49 |
|
| 50 |
static void mainboard_enable(struct device *dev) |
| 51 |
{ |
| 52 |
dev->ops->init = mainboard_init; |
| 53 |
} |
| 54 |
|
| 55 |
struct chip_operations mainboard_ops = { |
| 56 |
.enable_dev = mainboard_enable, |
| 57 |
}; |