[openfirmware] Troubleshooting VGA under qemu? [patch]

James Cameron quozl at laptop.org
Thu Oct 1 22:06:08 CET 2015


Thanks.

Some quick thoughts;

On Thu, Oct 01, 2015 at 09:26:02PM +0000, Marcin Cieslak wrote:
> --- 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
>  ;

Suggest borrowing my-w@ and my-w! from other drivers instead

: my-w@  ( offset -- w )  my-space +  " config-w@" $call-parent  ;
: my-w!  ( w offset -- )  my-space +  " config-w!" $call-parent  ;

: 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!
;

Several other drivers also impose a symmetry and undo in unmap-regs

  4 my-w@  1 invert and  4 my-w!

Is needed?

>  : 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
> +;

Most other drivers set this property at load time outside the colon
definitions; is there a reason for doing it after map-regs?

> +
> +: probe ( -- )
> +   map-regs
> +   set-reg-property
> +   unmap-regs
> +;
> +
>  : init-fb  ( -- )
>     depth 7 reg!  7 reg@ depth <>  if  7 reg@  to depth  then
>     

-- 
James Cameron
http://quozl.linux.org.au/



More information about the openfirmware mailing list