payloads/edk2: Disable the CPU Timer Lib unless supported
[coreboot.git] / src / mainboard / roda / rk886ex / mainboard.c
blob457f87ea175064a26f1039c89bf51b1ea215a9d0
1 /* SPDX-License-Identifier: GPL-2.0-only */
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>
9 #include "m3885.h"
11 #define DUMP_RUNTIME_REGISTERS 0
13 static void backlight_enable(void)
15 printk(BIOS_DEBUG, "Display I/O: 0x%02x\n", inb(0x60f));
18 #if DUMP_RUNTIME_REGISTERS
19 static void dump_runtime_registers(void)
21 int i;
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");
31 #endif
33 static void mainboard_final(struct device *dev)
35 /* Enable Dummy DCC ON# for DVI */
36 printk(BIOS_DEBUG, "Laptop handling...\n");
37 outb(inb(0x60f) & ~(1 << 5), 0x60f);
40 static void mainboard_enable(struct device *dev)
42 /* Configure the MultiKey controller */
44 /* Enable LCD Backlight */
45 backlight_enable();
47 /* Disable Dummy DCC -> GP45 = 1 */
48 outb(inb(0x60f) | (1 << 5), 0x60f);
50 /* LCD panel type is SIO GPIO40-43 */
51 install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 3);
53 #if DUMP_RUNTIME_REGISTERS
54 dump_runtime_registers();
55 #endif
57 dev->ops->final = mainboard_final;
60 struct chip_operations mainboard_ops = {
61 .enable_dev = mainboard_enable,