Patchwork Re: option-rom (was cg14)

login
register
mail settings
Submitter Bob Breuer
Date June 5, 2010, 8:25 p.m.
Message ID <4C0AB2B8.2080906@mc.net>
Download mbox | patch
Permalink /patch/54781/
State New
Headers show

Comments

Bob Breuer - June 5, 2010, 8:25 p.m.
Blue Swirl wrote:
> On Fri, Jun 4, 2010 at 5:40 PM, Artyom Tarasenko
> <atar4qemu@googlemail.com> wrote:
>   
>>>>> 2010/5/27 Bob Breuer <breuerr@mc.net>:
>>>>> +    /* DBRI (audio) */
>>>>> +    cpu_register_physical_memory_offset(0xEE0001000ULL, 0x10000, bad_mem, 0xE0001000);
>>>>>           
>>>> Please add a new DBRI device ;-).
>>>>         
>>> Or maybe just a field in hwdef + empty_slot? :-)
>>>       
>> Or actually don't bother at all. What is expected at 0xee0001000 is
>> not the DBRI device, but its FCode driver.
>> I wrote a stub, but don't see that it helps to boot except one has a
>> nice device name (
>>
>> Probing /obio at 2,0  cgfourteen
>> Probing /iommu@f,e0000000/sbus@f,e0001000 at f,0  espdma esp sd st
>> ledma le SUNW,bpp
>> Probing /iommu@f,e0000000/sbus@f,e0001000 at e,0  qemu,device-stub
>> Probing /iommu@f,e0000000/sbus@f,e0001000 at 0,0  Nothing there
>>
>>  ) and switching off slot "e" probing is not necessary.
>>
>>
>> What would be nice is a generic '-option-rom' switch which would take
>> a rom address and rom file or contents
>> as params. Or do we have something like this? I mean for qemu-system-sparc.
>>     
>
> Maybe SysBusDeviceInfo should have something similar to PCI .romfile
> field, or we should rather have a SBusDeviceInfo. That way ROM
> handling would be automatic.
>   

With empty_slot SS-20 OBP accesses just 2 addresses for slot E:
    0xEE0001000 - 8bit read (FCode)
    0xEE0010000 - 32bit write (put DBRI into reset)

Did a little digging, slot E starts at 0xEE0000000 (0xE << 32 | slot <<
28).  On my SS-20, the DBRI FCode is only 48 bytes which is then
mirrored every 64 bytes within at least the first 8K, and the actual
registers are at offset 64K with a reported length of 256 bytes.

Besides hooking up DBRI (empty_slot or not), I would propose the
following additions to the sun4m_hwdef structure so that the other
missing pieces can then be hooked up to empty_slot.


Also, looks like OpenBIOS would need some additional ranges added under
obio and sbus.  From a SS-20:
ok cd /obio
ok .attributes
ranges                   00000000  00000000  0000000f  f1000000  01000000
                         00000001  00000000  00000000  90000000  04000000
                         00000002  00000000  00000000  9c000000  04000000
                         00000003  00000000  00000000  f0000000  04000000
                         00000004  00000000  00000000  fc000000  04000000
device_type              hierarchical
name                     obio
ok cd /iommu/sbus
ok .attributes
clock-frequency          017d7840
scsi-initiator-id        00000007
burst-sizes              00f8007f
ranges                   00000000  00000000  0000000e  00000000  10000000
                         00000001  00000000  0000000e  10000000  10000000
                         00000002  00000000  0000000e  20000000  10000000
                         00000003  00000000  0000000e  30000000  10000000
                         0000000e  00000000  0000000e  e0000000  10000000
                         0000000f  00000000  0000000e  f0000000  10000000
address                  ffeec000
reg                      0000000f  e0001000  00000020
slot-address-bits        0000001c
up-burst-sizes           0000003f
device_type              hierarchical
name                     sbus
Blue Swirl - June 5, 2010, 8:35 p.m.
On Sat, Jun 5, 2010 at 8:25 PM, Bob Breuer <breuerr@mc.net> wrote:
> Blue Swirl wrote:
>> On Fri, Jun 4, 2010 at 5:40 PM, Artyom Tarasenko
>> <atar4qemu@googlemail.com> wrote:
>>
>>>>>> 2010/5/27 Bob Breuer <breuerr@mc.net>:
>>>>>> +    /* DBRI (audio) */
>>>>>> +    cpu_register_physical_memory_offset(0xEE0001000ULL, 0x10000, bad_mem, 0xE0001000);
>>>>>>
>>>>> Please add a new DBRI device ;-).
>>>>>
>>>> Or maybe just a field in hwdef + empty_slot? :-)
>>>>
>>> Or actually don't bother at all. What is expected at 0xee0001000 is
>>> not the DBRI device, but its FCode driver.
>>> I wrote a stub, but don't see that it helps to boot except one has a
>>> nice device name (
>>>
>>> Probing /obio at 2,0  cgfourteen
>>> Probing /iommu@f,e0000000/sbus@f,e0001000 at f,0  espdma esp sd st
>>> ledma le SUNW,bpp
>>> Probing /iommu@f,e0000000/sbus@f,e0001000 at e,0  qemu,device-stub
>>> Probing /iommu@f,e0000000/sbus@f,e0001000 at 0,0  Nothing there
>>>
>>>  ) and switching off slot "e" probing is not necessary.
>>>
>>>
>>> What would be nice is a generic '-option-rom' switch which would take
>>> a rom address and rom file or contents
>>> as params. Or do we have something like this? I mean for qemu-system-sparc.
>>>
>>
>> Maybe SysBusDeviceInfo should have something similar to PCI .romfile
>> field, or we should rather have a SBusDeviceInfo. That way ROM
>> handling would be automatic.
>>
>
> With empty_slot SS-20 OBP accesses just 2 addresses for slot E:
>    0xEE0001000 - 8bit read (FCode)
>    0xEE0010000 - 32bit write (put DBRI into reset)
>
> Did a little digging, slot E starts at 0xEE0000000 (0xE << 32 | slot <<
> 28).  On my SS-20, the DBRI FCode is only 48 bytes which is then
> mirrored every 64 bytes within at least the first 8K, and the actual
> registers are at offset 64K with a reported length of 256 bytes.
>
> Besides hooking up DBRI (empty_slot or not), I would propose the
> following additions to the sun4m_hwdef structure so that the other
> missing pieces can then be hooked up to empty_slot.
>
> --- a/hw/sun4m.c
> +++ b/hw/sun4m.c
> @@ -98,6 +98,10 @@ struct sun4m_hwdef {
>     target_phys_addr_t serial_base, fd_base;
>     target_phys_addr_t afx_base, idreg_base, dma_base, esp_base, le_base;
>     target_phys_addr_t tcx_base, cs_base, apc_base, aux1_base, aux2_base;
> +    target_phys_addr_t dbri_base, sx_base;
> +    struct {
> +        target_phys_addr_t reg_base, vram_base;
> +    } vsimm[4];

OK by itself, but again: should we have a new machine with cg14 or
some switch to select TCX vs. cg14?

Maybe the recently proposed machine subtype patches could help here.

>     target_phys_addr_t ecc_base;
>     uint32_t ecc_version;
>     uint8_t nvram_machine_id;
>
> Also, looks like OpenBIOS would need some additional ranges added under
> obio and sbus.  From a SS-20:
> ok cd /obio
> ok .attributes
> ranges                   00000000  00000000  0000000f  f1000000  01000000
>                         00000001  00000000  00000000  90000000  04000000
>                         00000002  00000000  00000000  9c000000  04000000
>                         00000003  00000000  00000000  f0000000  04000000
>                         00000004  00000000  00000000  fc000000  04000000
> device_type              hierarchical
> name                     obio
> ok cd /iommu/sbus
> ok .attributes
> clock-frequency          017d7840
> scsi-initiator-id        00000007
> burst-sizes              00f8007f
> ranges                   00000000  00000000  0000000e  00000000  10000000
>                         00000001  00000000  0000000e  10000000  10000000
>                         00000002  00000000  0000000e  20000000  10000000
>                         00000003  00000000  0000000e  30000000  10000000
>                         0000000e  00000000  0000000e  e0000000  10000000
>                         0000000f  00000000  0000000e  f0000000  10000000
> address                  ffeec000
> reg                      0000000f  e0001000  00000020
> slot-address-bits        0000001c
> up-burst-sizes           0000003f
> device_type              hierarchical
> name                     sbus

Again, the question is how to pass cg14 vs. TCX info to OpenBIOS.
Bob Breuer - June 5, 2010, 11:10 p.m.
Blue Swirl wrote:
>  but again: should we have a new machine with cg14 or
> some switch to select TCX vs. cg14?
>
> Maybe the recently proposed machine subtype patches could help here.
>   
Well, let's try to figure out a method of selecting the framebuffer
type.  I'll try to list some of the options, even if they might be
ridiculous.

1) Use the -vga option.  I know TCX and cg14 are not vga, but I think
it's the closest existing command line option available.

2) Switch based on the -g WxH option.  At the moment, the TCX emulation
doesn't really handle anything other than 1024x768, so switch to cg14
for other resolutions if supported.

3) Use some other existing command line option, -device, -set or
-global?  Might work, but the syntax may not be easy to remember.

4) Machine subtype.

5) New command line option.  Anything above might be better.

6) New machine type.  Is it a big enough feature to demand it's own
machine type?  Maybe, but see next option.

7) Select as default video for SS-20.  The SS-10 and SS-600MP are
already very similar.  This would allow for some differentiation between
the machines, but there could still be an option to switch back to TCX. 
Note that TCX was really only available for the SS-4 and SS-5.


Is there anything else that I missed?

I'm going to go ahead with option 2 in the short term.  I'm inclined to
narrow it down to options 1, 4, and 7.  I know that 7 would have
backwards compatibility concerns.  The cg14 seems to have at least the
same capabilities as TCX so there shouldn't be any loss of
functionality.  Even though SS-20 is not the default machine, do you
know of any OS that works with the sun4m implementation today but
doesn't have a cg14 driver?  Possible downside to cg14 for video is that
any "acceleration" is handled by the SX pixel processor which has no
available documentation.  TCX also has some amount of unimplemented
acceleration.

Bob
Blue Swirl - June 6, 2010, 7:32 a.m.
On Sat, Jun 5, 2010 at 11:10 PM, Bob Breuer <breuerr@mc.net> wrote:
> Blue Swirl wrote:
>>  but again: should we have a new machine with cg14 or
>> some switch to select TCX vs. cg14?
>>
>> Maybe the recently proposed machine subtype patches could help here.
>>
> Well, let's try to figure out a method of selecting the framebuffer
> type.  I'll try to list some of the options, even if they might be
> ridiculous.
>
> 1) Use the -vga option.  I know TCX and cg14 are not vga, but I think
> it's the closest existing command line option available.
>
> 2) Switch based on the -g WxH option.  At the moment, the TCX emulation
> doesn't really handle anything other than 1024x768, so switch to cg14
> for other resolutions if supported.
>
> 3) Use some other existing command line option, -device, -set or
> -global?  Might work, but the syntax may not be easy to remember.

We don't have an equivalent of -chardev, -netdev and -drive for displays.

> 4) Machine subtype.
>
> 5) New command line option.  Anything above might be better.
>
> 6) New machine type.  Is it a big enough feature to demand it's own
> machine type?  Maybe, but see next option.
>
> 7) Select as default video for SS-20.  The SS-10 and SS-600MP are
> already very similar.  This would allow for some differentiation between
> the machines, but there could still be an option to switch back to TCX.
> Note that TCX was really only available for the SS-4 and SS-5.
>
>
> Is there anything else that I missed?

Combined 7 & 6: make cg14 default for SS-20, add a deprecated
compatibility machine for SS-20 with TCX.

>
> I'm going to go ahead with option 2 in the short term.  I'm inclined to
> narrow it down to options 1, 4, and 7.  I know that 7 would have
> backwards compatibility concerns.  The cg14 seems to have at least the
> same capabilities as TCX so there shouldn't be any loss of
> functionality.  Even though SS-20 is not the default machine, do you
> know of any OS that works with the sun4m implementation today but
> doesn't have a cg14 driver?  Possible downside to cg14 for video is that
> any "acceleration" is handled by the SX pixel processor which has no
> available documentation.  TCX also has some amount of unimplemented
> acceleration.

It would be nice to use some basic device with well defined
acceleration or just a frame buffer as default.
Artyom Tarasenko - June 6, 2010, 4:28 p.m.
2010/6/6 Blue Swirl <blauwirbel@gmail.com>:
> On Sat, Jun 5, 2010 at 11:10 PM, Bob Breuer <breuerr@mc.net> wrote:
>> Blue Swirl wrote:
>>>  but again: should we have a new machine with cg14 or
>>> some switch to select TCX vs. cg14?
>>>

Why not just probe for both devices? OpenBIOS has the intention
to run one day on a real hardware, doesn't it?

>>> Maybe the recently proposed machine subtype patches could help here.

How is the graphic card different from cpu or a disk drive?

>> Well, let's try to figure out a method of selecting the framebuffer
>> type.  I'll try to list some of the options, even if they might be
>> ridiculous.
>>
>> 1) Use the -vga option.  I know TCX and cg14 are not vga, but I think
>> it's the closest existing command line option available.
>>
>> 2) Switch based on the -g WxH option.  At the moment, the TCX emulation
>> doesn't really handle anything other than 1024x768, so switch to cg14
>> for other resolutions if supported.
>>
>> 3) Use some other existing command line option, -device, -set or
>> -global?  Might work, but the syntax may not be easy to remember.
>
> We don't have an equivalent of -chardev, -netdev and -drive for displays.

I guess only cause the other emulated platforms don't have that much
of choice (yet).
Why not use just the generic -device option?

>> 4) Machine subtype.
>>
>> 5) New command line option.  Anything above might be better.
>>
>> 6) New machine type.  Is it a big enough feature to demand it's own
>> machine type?  Maybe, but see next option.
>>
>> 7) Select as default video for SS-20.  The SS-10 and SS-600MP are
>> already very similar.  This would allow for some differentiation between
>> the machines, but there could still be an option to switch back to TCX.
>> Note that TCX was really only available for the SS-4 and SS-5.
>>

They are similar in qemu. But it's rather a bug than a feature. The
real SS-600 is much more complex VME-bus machine.

>>
>> Is there anything else that I missed?
>
> Combined 7 & 6: make cg14 default for SS-20, add a deprecated
> compatibility machine for SS-20 with TCX.
>
>>
>> I'm going to go ahead with option 2 in the short term.  I'm inclined to
>> narrow it down to options 1, 4, and 7.  I know that 7 would have
>> backwards compatibility concerns.  The cg14 seems to have at least the
>> same capabilities as TCX so there shouldn't be any loss of
>> functionality.  Even though SS-20 is not the default machine, do you
>> know of any OS that works with the sun4m implementation today but
>> doesn't have a cg14 driver?  Possible downside to cg14 for video is that
>> any "acceleration" is handled by the SX pixel processor which has no
>> available documentation.  TCX also has some amount of unimplemented
>> acceleration.
>
> It would be nice to use some basic device with well defined
> acceleration or just a frame buffer as default.
>

AFAIK the open source OSes don't use the cg14 acceleration anyway. So
we'll only have potential problems with Solaris and NeXTStep here.
Blue Swirl - June 9, 2010, 7:43 p.m.
On Sun, Jun 6, 2010 at 4:28 PM, Artyom Tarasenko
<atar4qemu@googlemail.com> wrote:
> 2010/6/6 Blue Swirl <blauwirbel@gmail.com>:
>> On Sat, Jun 5, 2010 at 11:10 PM, Bob Breuer <breuerr@mc.net> wrote:
>>> Blue Swirl wrote:
>>>>  but again: should we have a new machine with cg14 or
>>>> some switch to select TCX vs. cg14?
>>>>
>
> Why not just probe for both devices? OpenBIOS has the intention
> to run one day on a real hardware, doesn't it?

I don't think it's very interesting for old hardware. Also coreboot
may be a better platform (with OpenBIOS as a payload).

>>>> Maybe the recently proposed machine subtype patches could help here.
>
> How is the graphic card different from cpu or a disk drive?

It isn't.

>>> Well, let's try to figure out a method of selecting the framebuffer
>>> type.  I'll try to list some of the options, even if they might be
>>> ridiculous.
>>>
>>> 1) Use the -vga option.  I know TCX and cg14 are not vga, but I think
>>> it's the closest existing command line option available.
>>>
>>> 2) Switch based on the -g WxH option.  At the moment, the TCX emulation
>>> doesn't really handle anything other than 1024x768, so switch to cg14
>>> for other resolutions if supported.
>>>
>>> 3) Use some other existing command line option, -device, -set or
>>> -global?  Might work, but the syntax may not be easy to remember.
>>
>> We don't have an equivalent of -chardev, -netdev and -drive for displays.
>
> I guess only cause the other emulated platforms don't have that much
> of choice (yet).
> Why not use just the generic -device option?

Then there would be two graphics devices. There should be something
like -displaydev SDL,id=1 -displaydev SDL,id=2 -device cg14,display=1
-device TCX,display=2.

>
>>> 4) Machine subtype.
>>>
>>> 5) New command line option.  Anything above might be better.
>>>
>>> 6) New machine type.  Is it a big enough feature to demand it's own
>>> machine type?  Maybe, but see next option.
>>>
>>> 7) Select as default video for SS-20.  The SS-10 and SS-600MP are
>>> already very similar.  This would allow for some differentiation between
>>> the machines, but there could still be an option to switch back to TCX.
>>> Note that TCX was really only available for the SS-4 and SS-5.
>>>
>
> They are similar in qemu. But it's rather a bug than a feature. The
> real SS-600 is much more complex VME-bus machine.
>
>>>
>>> Is there anything else that I missed?
>>
>> Combined 7 & 6: make cg14 default for SS-20, add a deprecated
>> compatibility machine for SS-20 with TCX.
>>
>>>
>>> I'm going to go ahead with option 2 in the short term.  I'm inclined to
>>> narrow it down to options 1, 4, and 7.  I know that 7 would have
>>> backwards compatibility concerns.  The cg14 seems to have at least the
>>> same capabilities as TCX so there shouldn't be any loss of
>>> functionality.  Even though SS-20 is not the default machine, do you
>>> know of any OS that works with the sun4m implementation today but
>>> doesn't have a cg14 driver?  Possible downside to cg14 for video is that
>>> any "acceleration" is handled by the SX pixel processor which has no
>>> available documentation.  TCX also has some amount of unimplemented
>>> acceleration.
>>
>> It would be nice to use some basic device with well defined
>> acceleration or just a frame buffer as default.
>>
>
> AFAIK the open source OSes don't use the cg14 acceleration anyway. So
> we'll only have potential problems with Solaris and NeXTStep here.
>
>
> --
> Regards,
> Artyom Tarasenko
>
> solaris/sparc under qemu blog: http://tyom.blogspot.com/
>

Patch

--- a/hw/sun4m.c
+++ b/hw/sun4m.c
@@ -98,6 +98,10 @@  struct sun4m_hwdef {
     target_phys_addr_t serial_base, fd_base;
     target_phys_addr_t afx_base, idreg_base, dma_base, esp_base, le_base;
     target_phys_addr_t tcx_base, cs_base, apc_base, aux1_base, aux2_base;
+    target_phys_addr_t dbri_base, sx_base;
+    struct {
+        target_phys_addr_t reg_base, vram_base;
+    } vsimm[4];
     target_phys_addr_t ecc_base;
     uint32_t ecc_version;
     uint8_t nvram_machine_id;