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>
35 #define DUMP_RUNTIME_REGISTERS 0
37 static void backlight_enable(void)
40 // Disabled, don't let the X9511 burn out
43 /* P56 is Brightness Up, and it needs a Pulse instead of a
46 for (i=0; i < 28; i++) {
47 //m3885_gpio(M3885_GPIO_PULSE|M3885_GPIO_SET|M3885_GPIO_P56);
48 m3885_gpio(M3885_GPIO_PULSE|M3885_GPIO_TOGGLE|M3885_GPIO_P56);
51 printk_debug("Display I/O: 0x%02x\n", inb(0x60f));
54 #if CONFIG_PCI_OPTION_ROM_RUN_YABEL
55 static int int15_handler(void)
58 #define BOOT_DISPLAY_DEFAULT 0
59 #define BOOT_DISPLAY_CRT (1 << 0)
60 #define BOOT_DISPLAY_TV (1 << 1)
61 #define BOOT_DISPLAY_EFP (1 << 2)
62 #define BOOT_DISPLAY_LCD (1 << 3)
63 #define BOOT_DISPLAY_CRT2 (1 << 4)
64 #define BOOT_DISPLAY_TV2 (1 << 5)
65 #define BOOT_DISPLAY_EFP2 (1 << 6)
66 #define BOOT_DISPLAY_LCD2 (1 << 7)
68 printk_debug("%s: AX=%04x BX=%04x CX=%04x DX=%04x\n",
69 __func__, M.x86.R_AX, M.x86.R_BX, M.x86.R_CX, M.x86.R_DX);
72 case 0x5f35: /* Boot Display */
73 M.x86.R_AX = 0x005f; // Success
74 M.x86.R_CL = BOOT_DISPLAY_DEFAULT;
76 case 0x5f40: /* Boot Panel Type */
77 /* LCD panel type is SIO GPIO40-43 */
78 // display_id = inb(0x60f) & 0x0f;
80 // M.x86.R_AX = 0x015f; // Supported but failed
81 M.x86.R_AX = 0x005f; // Success
82 M.x86.R_CL = display_id;
85 /* Interrupt was not handled */
89 /* Interrupt handled */
93 static void int15_install(void)
95 typedef int (* yabel_handleIntFunc)(void);
96 extern yabel_handleIntFunc yabel_intFuncArray[256];
97 yabel_intFuncArray[0x15] = int15_handler;
101 #if DUMP_RUNTIME_REGISTERS
102 static void dump_runtime_registers(void)
106 printk_debug("SuperIO runtime register block:\n");
107 for (i=0; i<0x10; i++)
108 printk_debug("%02x ", i);
110 for (i=0; i<0x10; i++)
111 printk_debug("%02x ", inb(0x600 +i));
116 static void mainboard_enable(device_t dev)
118 /* Configure the MultiKey controller */
119 // m3885_configure_multikey();
121 /* Enable LCD Backlight */
124 /* Disable Dummy DCC -> GP45 = 1 */
125 outb(inb(0x60f) | (1 << 5), 0x60f);
127 #if CONFIG_PCI_OPTION_ROM_RUN_YABEL
128 /* Install custom int15 handler for VGA OPROM */
131 #if DUMP_RUNTIME_REGISTERS
132 dump_runtime_registers();
136 int add_northbridge_resources(struct lb_memory *mem);
138 int add_mainboard_resources(struct lb_memory *mem)
140 return add_northbridge_resources(mem);
143 struct chip_operations mainboard_ops = {
144 CHIP_NAME("Roda Computer GmbH RK886EX Rugged Notebook (ROCKY3+)")
145 .enable_dev = mainboard_enable,