[openfirmware] Troubleshooting VGA under qemu? [patch]

Marcin Cieslak saper at saper.info
Thu Oct 1 21:26:02 CET 2015


On Thu, 1 Oct 2015, James Cameron wrote:

> >  -vga vmware -> VMWare (15ad:404) - DOES NOT WORK
> 
> For me, "-vga vmware" reproduces your problem.

I think I have this solved with the following patch:

Log:
Fix VMWare VGA adapter

* Send command to the PCI command port to inform
  the device that I/O port has been enabled.

* Issue a warning during PCI resouce allocation
  if "reg" property has not been provided
  (with diag-switch? true).

* Generate "reg" property for the PCI resource
  allocator:

ok dev /display
ok .properties
linebytes                00001000 
depth                    00000020 
height                   00000300 
width                    00000400 
assigned-addresses       81001010 00000000 00008010 00000000 00000010 
                         82001014 00000000 10000000 00000000 01000000 
                         82001018 00000000 11000000 00000000 00010000 
reg                      00001000 00000000 00000000 00000000 00000000 
                         01001010 00000000 00000000 00000000 00000010 
                         02001014 00000000 00000000 00000000 01000000 
                         02001018 00000000 00000000 00000000 00010000 
iso6429-1983-colors      
character-set            ISO8859-1
device_type              display
name                     display
devsel-speed             00000000 
class-code               00030000 
subsystem-vendor-id      000015ad 
subsystem-id             00000405 
max-latency              00000000 
min-grant                00000000 
revision-id              00000000 
device-id                00000405  
vendor-id                000015ad 

Index: dev/pcibus.fth
===================================================================
--- dev/pcibus.fth	(wersja 3784)
+++ dev/pcibus.fth	(kopia robocza)
@@ -1183,7 +1183,8 @@
             4                                               ( increment )
          then                                               ( increment )
       +loop
-
+   else
+      " reg property missing!" diag-type-cr
    then
    r> finish-aa-property
 ;
Index: dev/video/controlr/vmsvga.fth
===================================================================
--- dev/video/controlr/vmsvga.fth	(wersja 3784)
+++ dev/video/controlr/vmsvga.fth	(kopia robocza)
@@ -85,6 +85,9 @@
 h# 200.0000 instance value /mem
 : map-regs  ( -- )
    0 0 my-space h# 0100.0010 +  h# 10  " map-in" $call-parent to regs
+   my-space h# 04 + 
+   dup       " config-w@" $call-parent 
+   1 or swap " config-w!" $call-parent
 ;
 : map-mem  ( -- )
    my-space h# 14 +  " config-l@" $call-parent   if
@@ -116,6 +119,23 @@
    unmap-regs
    abort  \ We don't support version 0
 ;
+
+: int+  ( adr len n -- adr' len' )  encode-int encode+  ;
+
+: set-reg-property
+   my-address my-space encode-phys                        0 int+ h# 0    int+
+   my-address my-space h# 0100.0010 + encode-phys encode+ 0 int+ h# 10   int+
+   my-address my-space h# 0200.0014 + encode-phys encode+ 0 int+ /fb     int+
+   my-address my-space h# 0200.0018 + encode-phys encode+ 0 int+ /fifo   int+
+   " reg" property
+;
+
+: probe ( -- )
+   map-regs
+   set-reg-property
+   unmap-regs
+;
+
 : init-fb  ( -- )
    depth 7 reg!  7 reg@ depth <>  if  7 reg@  to depth  then
    
Index: dev/video/vmsvga.bth
===================================================================
--- dev/video/vmsvga.bth	(wersja 3784)
+++ dev/video/vmsvga.bth	(kopia robocza)
@@ -12,6 +12,7 @@
 " display" device-name
 
 fload ${BP}/dev/video/controlr/vmsvga.fth	\ VMware-specific words
+probe
 
 end0




More information about the openfirmware mailing list