| 1 |
|
| 2 |
|
| 3 |
#include <console/console.h> |
| 4 |
#include <device/device.h> |
| 5 |
#include <arch/io.h> |
| 6 |
#include <drivers/intel/gma/int15.h> |
| 7 |
#include <ec/acpi/ec.h> |
| 8 |
|
| 9 |
#include "m3885.h" |
| 10 |
|
| 11 |
#define DUMP_RUNTIME_REGISTERS 0 |
| 12 |
|
| 13 |
static void backlight_enable(void) |
| 14 |
{ |
| 15 |
printk(BIOS_DEBUG, "Display I/O: 0x%02x\n", inb(0x60f)); |
| 16 |
} |
| 17 |
|
| 18 |
#if DUMP_RUNTIME_REGISTERS |
| 19 |
static void dump_runtime_registers(void) |
| 20 |
{ |
| 21 |
int i; |
| 22 |
|
| 23 |
printk(BIOS_DEBUG, "SuperIO runtime register block:\n"); |
| 24 |
for (i = 0; i < 0x10; i++) |
| 25 |
printk(BIOS_DEBUG, "%02x ", i); |
| 26 |
printk(BIOS_DEBUG, "\n"); |
| 27 |
for (i = 0; i < 0x10; i++) |
| 28 |
printk(BIOS_DEBUG, "%02x ", inb(0x600 +i)); |
| 29 |
printk(BIOS_DEBUG, "\n"); |
| 30 |
} |
| 31 |
#endif |
| 32 |
|
| 33 |
static void mainboard_final(struct device *dev) |
| 34 |
{ |
| 35 |
|
| 36 |
printk(BIOS_DEBUG, "Laptop handling...\n"); |
| 37 |
outb(inb(0x60f) & ~(1 << 5), 0x60f); |
| 38 |
} |
| 39 |
|
| 40 |
static void mainboard_enable(struct device *dev) |
| 41 |
{ |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
backlight_enable(); |
| 46 |
|
| 47 |
|
| 48 |
outb(inb(0x60f) | (1 << 5), 0x60f); |
| 49 |
|
| 50 |
|
| 51 |
install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 3); |
| 52 |
|
| 53 |
#if DUMP_RUNTIME_REGISTERS |
| 54 |
dump_runtime_registers(); |
| 55 |
#endif |
| 56 |
|
| 57 |
dev->ops->final = mainboard_final; |
| 58 |
} |
| 59 |
|
| 60 |
struct chip_operations mainboard_ops = { |
| 61 |
.enable_dev = mainboard_enable, |
| 62 |
}; |