[OpenBIOS] [commit] r1194 - in trunk/openbios-devel: arch/amd64 arch/ppc arch/sparc64 arch/x86 config/examples drivers

repository service svn at openbios.org
Sat Jul 27 13:22:06 CEST 2013


Author: mcayland
Date: Sat Jul 27 13:22:06 2013
New Revision: 1194
URL: http://tracker.coreboot.org/trac/openbios/changeset/1194

Log:
x86/SPARC64/PPC/amd64: switch VGA driver over to FCode

Currently we cannot read the FCode from the card, so for the moment simply
execute the bytecode directly.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>

Modified:
   trunk/openbios-devel/arch/amd64/build.xml
   trunk/openbios-devel/arch/amd64/init.fs
   trunk/openbios-devel/arch/ppc/build.xml
   trunk/openbios-devel/arch/ppc/ppc.fs
   trunk/openbios-devel/arch/sparc64/build.xml
   trunk/openbios-devel/arch/sparc64/init.fs
   trunk/openbios-devel/arch/sparc64/tree.fs
   trunk/openbios-devel/arch/x86/build.xml
   trunk/openbios-devel/arch/x86/init.fs
   trunk/openbios-devel/config/examples/amd64_config.xml
   trunk/openbios-devel/drivers/build.xml
   trunk/openbios-devel/drivers/pci.c
   trunk/openbios-devel/drivers/vga.fs

Modified: trunk/openbios-devel/arch/amd64/build.xml
==============================================================================
--- trunk/openbios-devel/arch/amd64/build.xml	Sat Jul 27 13:22:02 2013	(r1193)
+++ trunk/openbios-devel/arch/amd64/build.xml	Sat Jul 27 13:22:06 2013	(r1194)
@@ -1,5 +1,6 @@
 <build condition="AMD64">
  <dictionary name="openbios-amd64" init="openbios" target="forth">
   <object source="init.fs"/>
+  <object source="QEMU,VGA.bin" target="fcode" condition="DRIVER_VGA" />
  </dictionary>
 </build>

Modified: trunk/openbios-devel/arch/amd64/init.fs
==============================================================================
--- trunk/openbios-devel/arch/amd64/init.fs	Sat Jul 27 13:22:02 2013	(r1193)
+++ trunk/openbios-devel/arch/amd64/init.fs	Sat Jul 27 13:22:06 2013	(r1194)
@@ -1,3 +1,5 @@
+include config.fs
+
 :noname 
   ."   Type 'help' for detailed information" cr
   \ ."   boot secondary slave cdrom: " cr
@@ -74,3 +76,8 @@
   " keyboard" input
 ; CONSOLE-IN-initializer
   
+\ Load VGA FCode driver blob
+[IFDEF] CONFIG_DRIVER_VGA
+  -1 value vga-driver-fcode
+  " QEMU,VGA.bin" $encode-file to vga-driver-fcode
+[THEN]

Modified: trunk/openbios-devel/arch/ppc/build.xml
==============================================================================
--- trunk/openbios-devel/arch/ppc/build.xml	Sat Jul 27 13:22:02 2013	(r1193)
+++ trunk/openbios-devel/arch/ppc/build.xml	Sat Jul 27 13:22:06 2013	(r1194)
@@ -5,24 +5,28 @@
   <object source="ppc.fs"/>
   <object source="briq/tree.fs"/>
   <object source="briq/briq.fs"/>
+  <object source="QEMU,VGA.bin" target="fcode" condition="DRIVER_VGA"/>
  </dictionary>
 
   <dictionary name="openbios-pearpc" init="openbios" target="forth" condition="PEARPC">
   <object source="ppc.fs"/>
   <object source="pearpc/tree.fs"/>
   <object source="pearpc/pearpc.fs"/>
+  <object source="QEMU,VGA.bin" target="fcode" condition="DRIVER_VGA"/>
  </dictionary>
 
   <dictionary name="openbios-qemu" init="openbios" target="forth" condition="QEMU">
   <object source="ppc.fs"/>
   <object source="qemu/tree.fs"/>
   <object source="qemu/qemu.fs"/>
+  <object source="QEMU,VGA.bin" target="fcode" condition="DRIVER_VGA"/>
  </dictionary>
 
  <dictionary name="openbios-mol" init="openbios" target="forth" condition="MOL">
   <object source="ppc.fs"/>
   <object source="mol/tree.fs"/>
   <object source="mol/mol.fs"/>
+  <object source="QEMU,VGA.bin" target="fcode" condition="DRIVER_VGA"/>
  </dictionary>
 
  <!-- HACK ALERT -->

Modified: trunk/openbios-devel/arch/ppc/ppc.fs
==============================================================================
--- trunk/openbios-devel/arch/ppc/ppc.fs	Sat Jul 27 13:22:02 2013	(r1193)
+++ trunk/openbios-devel/arch/ppc/ppc.fs	Sat Jul 27 13:22:06 2013	(r1194)
@@ -1,3 +1,5 @@
+include config.fs
+
 \ -------------------------------------------------------------------------
 \ registers 
 \ -------------------------------------------------------------------------
@@ -50,6 +52,15 @@
 0 value %sprg3
 
 \ -------------------------------------------------------------------------
+\ Load VGA FCode driver blob
+\ -------------------------------------------------------------------------
+
+[IFDEF] CONFIG_DRIVER_VGA
+  -1 value vga-driver-fcode
+  " QEMU,VGA.bin" $encode-file to vga-driver-fcode
+[THEN]
+
+\ -------------------------------------------------------------------------
 \ other
 \ -------------------------------------------------------------------------
 

Modified: trunk/openbios-devel/arch/sparc64/build.xml
==============================================================================
--- trunk/openbios-devel/arch/sparc64/build.xml	Sat Jul 27 13:22:02 2013	(r1193)
+++ trunk/openbios-devel/arch/sparc64/build.xml	Sat Jul 27 13:22:06 2013	(r1194)
@@ -3,6 +3,7 @@
  <dictionary name="openbios-sparc64" init="openbios">
   <object source="tree.fs" target="forth"/>
   <object source="init.fs" target="forth"/>
+  <object source="QEMU,VGA.bin" target="fcode" condition="DRIVER_VGA"/>
  </dictionary>
 
  <library name="sparc64" type="static" target="target">

Modified: trunk/openbios-devel/arch/sparc64/init.fs
==============================================================================
--- trunk/openbios-devel/arch/sparc64/init.fs	Sat Jul 27 13:22:02 2013	(r1193)
+++ trunk/openbios-devel/arch/sparc64/init.fs	Sat Jul 27 13:22:06 2013	(r1194)
@@ -53,3 +53,9 @@
 : rmap@    ( virt -- rmentry )
   drop 0
   ;
+
+\ Load VGA FCode driver blob
+[IFDEF] CONFIG_DRIVER_VGA
+  -1 value vga-driver-fcode
+  " QEMU,VGA.bin" $encode-file to vga-driver-fcode
+[THEN]

Modified: trunk/openbios-devel/arch/sparc64/tree.fs
==============================================================================
--- trunk/openbios-devel/arch/sparc64/tree.fs	Sat Jul 27 13:22:02 2013	(r1193)
+++ trunk/openbios-devel/arch/sparc64/tree.fs	Sat Jul 27 13:22:06 2013	(r1194)
@@ -1,3 +1,5 @@
+include config.fs
+
 \ -------------------------------------------------------------------------
 \ UPA encode/decode unit
 \ -------------------------------------------------------------------------

Modified: trunk/openbios-devel/arch/x86/build.xml
==============================================================================
--- trunk/openbios-devel/arch/x86/build.xml	Sat Jul 27 13:22:02 2013	(r1193)
+++ trunk/openbios-devel/arch/x86/build.xml	Sat Jul 27 13:22:06 2013	(r1194)
@@ -2,6 +2,7 @@
 
  <dictionary name="openbios-x86" init="openbios">
   <object source="init.fs" target="forth"/>
+  <object source="QEMU,VGA.bin" target="fcode" condition="DRIVER_VGA"/>
  </dictionary>
 
  <library name="x86" type="static" target="target">

Modified: trunk/openbios-devel/arch/x86/init.fs
==============================================================================
--- trunk/openbios-devel/arch/x86/init.fs	Sat Jul 27 13:22:02 2013	(r1193)
+++ trunk/openbios-devel/arch/x86/init.fs	Sat Jul 27 13:22:06 2013	(r1194)
@@ -1,3 +1,5 @@
+include config.fs
+
 :noname 
   ."   Type 'help' for detailed information" cr
   \ ."   boot secondary slave cdrom: " cr
@@ -74,3 +76,9 @@
 :noname
   " keyboard" input
 ; CONSOLE-IN-initializer
+
+\ Load VGA FCode driver blob
+[IFDEF] CONFIG_DRIVER_VGA
+  -1 value vga-driver-fcode
+  " QEMU,VGA.bin" $encode-file to vga-driver-fcode
+[THEN]

Modified: trunk/openbios-devel/config/examples/amd64_config.xml
==============================================================================
--- trunk/openbios-devel/config/examples/amd64_config.xml	Sat Jul 27 13:22:02 2013	(r1193)
+++ trunk/openbios-devel/config/examples/amd64_config.xml	Sat Jul 27 13:22:06 2013	(r1194)
@@ -58,3 +58,4 @@
   <option name="CONFIG_DRIVER_IDE" type="boolean" value="true"/>
   <option name="CONFIG_IDE_NUM_CHANNELS" type="integer" value="4"/>
   <option name="CONFIG_DEBUG_IDE" type="boolean" value="false"/>
+  <option name="CONFIG_DRIVER_VGA" type="boolean" value="false"/>

Modified: trunk/openbios-devel/drivers/build.xml
==============================================================================
--- trunk/openbios-devel/drivers/build.xml	Sat Jul 27 13:22:02 2013	(r1193)
+++ trunk/openbios-devel/drivers/build.xml	Sat Jul 27 13:22:06 2013	(r1194)
@@ -29,9 +29,9 @@
   <object source="pci.fs" condition="DRIVER_PCI"/>
   <object source="sbus.fs" condition="DRIVER_SBUS"/>
   <object source="esp.fs" condition="DRIVER_ESP"/>
-  <object source="vga.fs" condition="DRIVER_VGA"/>
  </dictionary>
 
  <fcode source="tcx.fs" name="QEMU,tcx.bin" condition="DRIVER_SBUS" />
+ <fcode source="vga.fs" name="QEMU,VGA.bin" condition="DRIVER_VGA" />
 
 </build>

Modified: trunk/openbios-devel/drivers/pci.c
==============================================================================
--- trunk/openbios-devel/drivers/pci.c	Sat Jul 27 13:22:02 2013	(r1193)
+++ trunk/openbios-devel/drivers/pci.c	Sat Jul 27 13:22:06 2013	(r1194)
@@ -771,7 +771,8 @@
                          pci_bus_addr_to_host_addr(config->assigned[1] & ~0x0000000F),
                          config->sizes[1]);
 
-            feval("['] qemu-vga-driver-init is-install");
+	    /* Currently we don't read FCode from the hardware but execute it directly */
+	    feval("['] vga-driver-fcode 2 cells + 1 byte-load");
         }
 
 	return 0;

Modified: trunk/openbios-devel/drivers/vga.fs
==============================================================================
--- trunk/openbios-devel/drivers/vga.fs	Sat Jul 27 13:22:02 2013	(r1193)
+++ trunk/openbios-devel/drivers/vga.fs	Sat Jul 27 13:22:06 2013	(r1194)
@@ -5,9 +5,42 @@
 \ the QEMU VGA graphics card.
 \
 
-: qemu-vga-driver-init ( -- )
+fcode-version3
+
+\
+\ Instead of using fixed values for the framebuffer address and the width
+\ and height, grab the ones passed in by QEMU/generated by OpenBIOS
+\
+
+: qemu-video-addr
+  " qemu-video-addr" $find if
+    cell+ @
+  then
+;
+
+: qemu-video-width
+  " qemu-video-width" $find if
+    cell+ @
+  then
+;
+
+: qemu-video-height
+  " qemu-video-height" $find if
+    cell+ @
+  then
+;
+
+: qemu-vga-driver-install ( -- )
   qemu-video-addr to frame-buffer-adr
   default-font set-font
   qemu-video-width qemu-video-height over char-width / over char-height /
   fb8-install
 ;
+
+: qemu-vga-driver-init
+  ['] qemu-vga-driver-install is-install
+  ;
+
+qemu-vga-driver-init
+
+end0



More information about the OpenBIOS mailing list