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>
25 #include <boot/tables.h>
27 #if CONFIG_PCI_OPTION_ROM_RUN_YABEL
28 #include <x86emu/x86emu.h>
30 #include <arch/coreboot_tables.h>
36 #define DUMP_RUNTIME_REGISTERS 0
38 static void backlight_enable(void)
41 // Disabled, don't let the X9511 burn out
44 /* P56 is Brightness Up, and it needs a Pulse instead of a
47 for (i=0; i < 28; i++) {
48 //m3885_gpio(M3885_GPIO_PULSE|M3885_GPIO_SET|M3885_GPIO_P56);
49 m3885_gpio(M3885_GPIO_PULSE|M3885_GPIO_TOGGLE|M3885_GPIO_P56);
52 printk(BIOS_DEBUG, "Display I/O: 0x%02x\n", inb(0x60f));
55 #if CONFIG_PCI_OPTION_ROM_RUN_YABEL
56 static int int15_handler(void)
59 #define BOOT_DISPLAY_DEFAULT 0
60 #define BOOT_DISPLAY_CRT (1 << 0)
61 #define BOOT_DISPLAY_TV (1 << 1)
62 #define BOOT_DISPLAY_EFP (1 << 2)
63 #define BOOT_DISPLAY_LCD (1 << 3)
64 #define BOOT_DISPLAY_CRT2 (1 << 4)
65 #define BOOT_DISPLAY_TV2 (1 << 5)
66 #define BOOT_DISPLAY_EFP2 (1 << 6)
67 #define BOOT_DISPLAY_LCD2 (1 << 7)
69 printk(BIOS_DEBUG, "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n",
70 __func__, M.x86.R_AX, M.x86.R_BX, M.x86.R_CX, M.x86.R_DX);
73 case 0x5f35: /* Boot Display */
74 M.x86.R_AX = 0x005f; // Success
75 M.x86.R_CL = BOOT_DISPLAY_DEFAULT;
77 case 0x5f40: /* Boot Panel Type */
78 /* LCD panel type is SIO GPIO40-43 */
79 // display_id = inb(0x60f) & 0x0f;
81 // M.x86.R_AX = 0x015f; // Supported but failed
82 M.x86.R_AX = 0x005f; // Success
83 M.x86.R_CL = display_id;
86 /* Interrupt was not handled */
90 /* Interrupt handled */
94 static void int15_install(void)
96 typedef int (* yabel_handleIntFunc)(void);
97 extern yabel_handleIntFunc yabel_intFuncArray[256];
98 yabel_intFuncArray[0x15] = int15_handler;
102 #if DUMP_RUNTIME_REGISTERS
103 static void dump_runtime_registers(void)
107 printk(BIOS_DEBUG, "SuperIO runtime register block:\n");
108 for (i=0; i<0x10; i++)
109 printk(BIOS_DEBUG, "%02x ", i);
110 printk(BIOS_DEBUG, "\n");
111 for (i=0; i<0x10; i++)
112 printk(BIOS_DEBUG, "%02x ", inb(0x600 +i));
113 printk(BIOS_DEBUG, "\n");
117 static void mainboard_enable(device_t dev)
119 /* Configure the MultiKey controller */
120 // m3885_configure_multikey();
122 /* Enable LCD Backlight */
125 /* Disable Dummy DCC -> GP45 = 1 */
126 outb(inb(0x60f) | (1 << 5), 0x60f);
128 #if CONFIG_PCI_OPTION_ROM_RUN_YABEL
129 /* Install custom int15 handler for VGA OPROM */
132 #if DUMP_RUNTIME_REGISTERS
133 dump_runtime_registers();
137 int add_mainboard_resources(struct lb_memory *mem)
139 return add_northbridge_resources(mem);
142 struct chip_operations mainboard_ops = {
143 CHIP_NAME("Roda Computer GmbH RK886EX Rugged Notebook (ROCKY3+)")
144 .enable_dev = mainboard_enable,