Author: quozl Date: Thu Oct 22 03:08:55 2015 New Revision: 3785 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3785
Log: Emulator ROM build - fix VMWare VGA adapter, from Marcin Cieslak
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.
Known to work with qemu-2.4.0. Does not rewrite all changed rectangles on qemu-2.0.0
Modified: dev/pcibus.fth dev/video/controlr/vmsvga.fth dev/video/vmsvga.bth
Modified: dev/pcibus.fth ============================================================================== --- dev/pcibus.fth Thu Oct 1 09:17:25 2015 (r3784) +++ dev/pcibus.fth Thu Oct 22 03:08:55 2015 (r3785) @@ -1183,7 +1183,8 @@ 4 ( increment ) then ( increment ) +loop - + else + " reg property missing!" diag-type-cr then r> finish-aa-property ;
Modified: dev/video/controlr/vmsvga.fth ============================================================================== --- dev/video/controlr/vmsvga.fth Thu Oct 1 09:17:25 2015 (r3784) +++ dev/video/controlr/vmsvga.fth Thu Oct 22 03:08:55 2015 (r3785) @@ -39,6 +39,9 @@ : reg@ ( index -- value ) regs rl! regs 1+ rl@ ; : reg! ( value index -- ) regs rl! regs 1+ rl! ;
+: my-w@ ( offset -- w ) my-space + " config-w@" $call-parent ; +: my-w! ( w offset -- ) my-space + " config-w!" $call-parent ; + \ Here are the register numbers. Most of these registers are \ accessed only once, so I don't define access words for many of them. \ (W) means that it is meaningful for you to write to this register @@ -85,6 +88,7 @@ h# 200.0000 instance value /mem : map-regs ( -- ) 0 0 my-space h# 0100.0010 + h# 10 " map-in" $call-parent to regs + 4 my-w@ 1 or 4 my-w! ; : map-mem ( -- ) my-space h# 14 + " config-l@" $call-parent if @@ -94,12 +98,16 @@ 0 0 my-space h# 0200.0018 + /fb " map-in" $call-parent to frame-buffer-adr /fb 0 my-space h# 0200.0018 + /fifo " map-in" $call-parent to fifo then - 3 my-space h# 04 + " config-w!" $call-parent + 4 my-w@ 2 or 4 my-w! +; +: unmap-regs ( -- ) + regs h# 10 " map-out" $call-parent + 4 my-w@ 1 invert and 4 my-w! ; -: unmap-regs ( -- ) regs h# 10 " map-out" $call-parent ; : unmap-mem ( -- ) fifo /fifo " map-out" $call-parent frame-buffer-adr /fb " map-out" $call-parent + 4 my-w@ 2 invert and 4 my-w! ;
\ Min and Max are the static limits of the FIFO area. @@ -116,6 +124,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
Modified: dev/video/vmsvga.bth ============================================================================== --- dev/video/vmsvga.bth Thu Oct 1 09:17:25 2015 (r3784) +++ dev/video/vmsvga.bth Thu Oct 22 03:08:55 2015 (r3785) @@ -12,6 +12,7 @@ " display" device-name
fload ${BP}/dev/video/controlr/vmsvga.fth \ VMware-specific words +probe
end0
openfirmware@openfirmware.info