Hi,

I'd like to replace the lenovo x60(supported by coreboot)
non-free VGA option rom: I don't use it right now but that has
serious drawbacks:
* No graphics at all until the i915 kernel module is loaded (really
  user unfriendly), my main motivation to replace it...
* No backlight control
* nvramtool doesn't work anymore without using the -y option (not
  really important).

I've created stub in SeaBIOS(there is an attached patch for that) for
the i915 driver(it will be filled in later), however I don't know how to
run the code:
* I guess it creates an option rom that is in out/vgabios.bin and that
  I've to include it trough one of the various ways(let seabios pick
  it, run it in coreboot, run it in coreboot trough YABEL for
  debugging etc...)? right? romheaders seem to think that the option
  rom is valid(more on it later). I guess YABEL also thinks it's valid.
  I guess SeaBIOS out/bios.bin.elf doesn't link that option rom inside
  SeaBIOS...
* it doesn't print a thing, I've CONFIG_DEBUG_LEVEL=2 and there is the
  following in the driver stub:
  dprintf(1, "i915vga_setup: VGA init...\n");

So I've tried the YABEL way with debugging enabled and here's the
result:
[...]
Normal boot.
PCI: 00:02.0 init
CBFS: Looking for 'pci8086,27a2.rom' starting from 0x0.
CBFS:  (unmatched file @0x0: cmos_layout.bin)
CBFS:  (unmatched file @0x640: fallback/romstage)
CBFS:  (unmatched file @0xb500: fallback/coreboot_ram)
CBFS:  (unmatched file @0x2d200: fallback/payload)
CBFS:  (unmatched file @0x39a80: config)
CBFS:  (unmatched file @0x3a9c0: )
CBFS:  (unmatched file @0x3ff80: normal/romstage)
CBFS:  (unmatched file @0x4ae80: normal/coreboot_ram)
CBFS:  (unmatched file @0x6cb80: normal/payload)
CBFS: Found file (offset=0x79af8, len=33280).
In CBFS, ROM address for PCI: 00:02.0 = ffe79af8
PCI expansion ROM, signature 0xaa55, INIT size 0x8200, data ptr 0x4930
PCI ROM image, vendor ID 8086, device ID 27a2,
PCI ROM image, Class Code 030000, Code Type 00
Copying VGA ROM Image from ffe79af8 to 0xc0000, 0x8200 bytes
[long wait]
PCI: 00:02.1 init
CBFS: Looking for 'cmos_layout.bin' starting from 0x0.
CBFS: Found file (offset=0x28, len=1560).
PCI: 00:1b.0 init
[...]

It doesn't seem to print a thing...and YABEL is pretty silent and
should really not be that silent according to the YABEL debug options:
CONFIG_X86EMU_DEBUG=y
CONFIG_X86EMU_DEBUG_JMP=y
# CONFIG_X86EMU_DEBUG_TRACE is not set
CONFIG_X86EMU_DEBUG_PNP=y
CONFIG_X86EMU_DEBUG_DISK=y
CONFIG_X86EMU_DEBUG_PMM=y
CONFIG_X86EMU_DEBUG_VBE=y
CONFIG_X86EMU_DEBUG_INT10=y
CONFIG_X86EMU_DEBUG_INTERRUPTS=y
CONFIG_X86EMU_DEBUG_CHECK_VMEM_ACCESS=y
CONFIG_X86EMU_DEBUG_MEM=y
CONFIG_X86EMU_DEBUG_IO=y

Denis.
>From 6b60197d2fe62391a722f6fd23ff753cd2c37717 Mon Sep 17 00:00:00 2001
From: Denis 'GNUtoo' Carikli <gnu...@no-log.org>
Date: Sat, 16 Feb 2013 17:34:09 +0100
Subject: [PATCH] Add i915 VGA Stub.

Signed-off-by: Denis 'GNUtoo' Carikli <gnu...@no-log.org>
---
 Makefile         |  2 +-
 vgasrc/Kconfig   |  4 ++++
 vgasrc/i915vga.c | 36 ++++++++++++++++++++++++++++++++++++
 vgasrc/vgahw.h   |  2 ++
 4 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 vgasrc/i915vga.c

diff --git a/Makefile b/Makefile
index fb0c89b..3438492 100644
--- a/Makefile
+++ b/Makefile
@@ -177,7 +177,7 @@ $(OUT)bios.bin.elf $(OUT)bios.bin: $(OUT)rom.o tools/checkrom.py
 SRCVGA=src/output.c src/util.c src/pci.c \
     vgasrc/vgabios.c vgasrc/vgafb.c vgasrc/vgafonts.c vgasrc/vbe.c \
     vgasrc/stdvga.c vgasrc/stdvgamodes.c vgasrc/stdvgaio.c \
-    vgasrc/clext.c vgasrc/bochsvga.c vgasrc/geodevga.c
+    vgasrc/clext.c vgasrc/bochsvga.c vgasrc/geodevga.c vgasrc/i915vga.c
 
 CFLAGS16VGA = $(CFLAGS16INC) -Isrc
 
diff --git a/vgasrc/Kconfig b/vgasrc/Kconfig
index 0901c04..24eacc7 100644
--- a/vgasrc/Kconfig
+++ b/vgasrc/Kconfig
@@ -41,6 +41,10 @@ menu "VGA ROM"
             bool "GeodeLX"
             help
                 Build support for Geode LX vga.
+        config VGA_I915
+            bool "I915"
+            help
+                Build support for Intel i915 vga.
     endchoice
 
     choice
diff --git a/vgasrc/i915vga.c b/vgasrc/i915vga.c
new file mode 100644
index 0000000..bbf2d22
--- /dev/null
+++ b/vgasrc/i915vga.c
@@ -0,0 +1,36 @@
+// Intel i915 VGA functions
+//
+// Copyright (C) 2013 Denis 'GNUtoo' Carikli
+//
+// This file may be distributed under the terms of the GNU LGPLv3 license.
+
+#include "farptr.h" // SET_FARVAR
+#include "biosvar.h" // GET_BDA
+#include "vgabios.h" // VGAREG_*
+#include "util.h" // memset
+#include "stdvga.h" // stdvga_crtc_write
+#include "pci.h" // pci_config_readl
+#include "pci_regs.h" // PCI_BASE_ADDRESS_0
+
+
+/****************************************************************
+ * Helper functions
+ ****************************************************************/
+
+/****************************************************************
+* Init Functions
+****************************************************************/
+
+int i915vga_setup(void)
+{
+    int ret = stdvga_setup();
+    if (ret)
+        return ret;
+
+    dprintf(1, "i915vga_setup: VGA init...\n");
+    /*
+     *  insert initialization here 
+     */
+
+    return 0;
+}
diff --git a/vgasrc/vgahw.h b/vgasrc/vgahw.h
index f69a5ac..60feed3 100644
--- a/vgasrc/vgahw.h
+++ b/vgasrc/vgahw.h
@@ -41,6 +41,8 @@ static inline int vgahw_setup(void) {
         return bochsvga_setup();
     if (CONFIG_VGA_GEODEGX2 || CONFIG_VGA_GEODELX)
         return geodevga_setup();
+    if (CONFIG_VGA_I915)
+        return i915vga_setup();
     return stdvga_setup();
 }
 
-- 
1.8.1.3

_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
http://www.seabios.org/mailman/listinfo/seabios

Reply via email to