diff mbox series

[v4,09/20] macfb: don't register declaration ROM

Message ID 20210917075057.20924-10-mark.cave-ayland@ilande.co.uk (mailing list archive)
State New, archived
Headers show
Series nubus: bus, device, bridge, IRQ and address space improvements | expand

Commit Message

Mark Cave-Ayland Sept. 17, 2021, 7:50 a.m. UTC
The macfb device is an on-board framebuffer and so is initialised by the
system declaration ROM included within the MacOS toolbox ROM.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/display/macfb.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

Laurent Vivier Sept. 20, 2021, 8:01 p.m. UTC | #1
Le 17/09/2021 à 09:50, Mark Cave-Ayland a écrit :
> The macfb device is an on-board framebuffer and so is initialised by the
> system declaration ROM included within the MacOS toolbox ROM.
> 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> ---
>  hw/display/macfb.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/hw/display/macfb.c b/hw/display/macfb.c
> index d8183b9bbd..76808b69cc 100644
> --- a/hw/display/macfb.c
> +++ b/hw/display/macfb.c
> @@ -383,10 +383,6 @@ static void macfb_sysbus_realize(DeviceState *dev, Error **errp)
>      sysbus_init_mmio(SYS_BUS_DEVICE(s), &ms->mem_vram);
>  }
>  
> -const uint8_t macfb_rom[] = {
> -    255, 0, 0, 0,
> -};
> -
>  static void macfb_nubus_realize(DeviceState *dev, Error **errp)
>  {
>      NubusDevice *nd = NUBUS_DEVICE(dev);
> @@ -399,8 +395,6 @@ static void macfb_nubus_realize(DeviceState *dev, Error **errp)
>      macfb_common_realize(dev, ms, errp);
>      memory_region_add_subregion(&nd->slot_mem, DAFB_BASE, &ms->mem_ctrl);
>      memory_region_add_subregion(&nd->slot_mem, VIDEO_BASE, &ms->mem_vram);
> -
> -    nubus_register_rom(nd, macfb_rom, sizeof(macfb_rom), 1, 9, 0xf);
>  }
>  
>  static void macfb_sysbus_reset(DeviceState *d)
> 

Will macfb continue to work with "-kernel" and without providing any MacOS ROM?

Thanks,
Laurent
Laurent Vivier Sept. 20, 2021, 9:44 p.m. UTC | #2
Le 20/09/2021 à 22:01, Laurent Vivier a écrit :
> Le 17/09/2021 à 09:50, Mark Cave-Ayland a écrit :
>> The macfb device is an on-board framebuffer and so is initialised by the
>> system declaration ROM included within the MacOS toolbox ROM.
>>
>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>> ---
>>  hw/display/macfb.c | 6 ------
>>  1 file changed, 6 deletions(-)
>>
>> diff --git a/hw/display/macfb.c b/hw/display/macfb.c
>> index d8183b9bbd..76808b69cc 100644
>> --- a/hw/display/macfb.c
>> +++ b/hw/display/macfb.c
>> @@ -383,10 +383,6 @@ static void macfb_sysbus_realize(DeviceState *dev, Error **errp)
>>      sysbus_init_mmio(SYS_BUS_DEVICE(s), &ms->mem_vram);
>>  }
>>  
>> -const uint8_t macfb_rom[] = {
>> -    255, 0, 0, 0,
>> -};
>> -
>>  static void macfb_nubus_realize(DeviceState *dev, Error **errp)
>>  {
>>      NubusDevice *nd = NUBUS_DEVICE(dev);
>> @@ -399,8 +395,6 @@ static void macfb_nubus_realize(DeviceState *dev, Error **errp)
>>      macfb_common_realize(dev, ms, errp);
>>      memory_region_add_subregion(&nd->slot_mem, DAFB_BASE, &ms->mem_ctrl);
>>      memory_region_add_subregion(&nd->slot_mem, VIDEO_BASE, &ms->mem_vram);
>> -
>> -    nubus_register_rom(nd, macfb_rom, sizeof(macfb_rom), 1, 9, 0xf);
>>  }
>>  
>>  static void macfb_sysbus_reset(DeviceState *d)
>>
> 
> Will macfb continue to work with "-kernel" and without providing any MacOS ROM?

My Quadra doesn't seem to report any ROM on boot, so it must be fine

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Mark Cave-Ayland Sept. 22, 2021, 10:28 a.m. UTC | #3
On 20/09/2021 21:01, Laurent Vivier wrote:

> Le 17/09/2021 à 09:50, Mark Cave-Ayland a écrit :
>> The macfb device is an on-board framebuffer and so is initialised by the
>> system declaration ROM included within the MacOS toolbox ROM.
>>
>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>> ---
>>   hw/display/macfb.c | 6 ------
>>   1 file changed, 6 deletions(-)
>>
>> diff --git a/hw/display/macfb.c b/hw/display/macfb.c
>> index d8183b9bbd..76808b69cc 100644
>> --- a/hw/display/macfb.c
>> +++ b/hw/display/macfb.c
>> @@ -383,10 +383,6 @@ static void macfb_sysbus_realize(DeviceState *dev, Error **errp)
>>       sysbus_init_mmio(SYS_BUS_DEVICE(s), &ms->mem_vram);
>>   }
>>   
>> -const uint8_t macfb_rom[] = {
>> -    255, 0, 0, 0,
>> -};
>> -
>>   static void macfb_nubus_realize(DeviceState *dev, Error **errp)
>>   {
>>       NubusDevice *nd = NUBUS_DEVICE(dev);
>> @@ -399,8 +395,6 @@ static void macfb_nubus_realize(DeviceState *dev, Error **errp)
>>       macfb_common_realize(dev, ms, errp);
>>       memory_region_add_subregion(&nd->slot_mem, DAFB_BASE, &ms->mem_ctrl);
>>       memory_region_add_subregion(&nd->slot_mem, VIDEO_BASE, &ms->mem_vram);
>> -
>> -    nubus_register_rom(nd, macfb_rom, sizeof(macfb_rom), 1, 9, 0xf);
>>   }
>>   
>>   static void macfb_sysbus_reset(DeviceState *d)
>>
> 
> Will macfb continue to work with "-kernel" and without providing any MacOS ROM?

Yes indeed, since on the Quadra 800 the declaration ROM for the framebuffer is 
embedded within the MacOS toolbox ROM.


ATB,

Mark.
BALATON Zoltan Sept. 22, 2021, 11:15 a.m. UTC | #4
On Wed, 22 Sep 2021, Mark Cave-Ayland wrote:
> On 20/09/2021 21:01, Laurent Vivier wrote:
>> Le 17/09/2021 à 09:50, Mark Cave-Ayland a écrit :
>>> The macfb device is an on-board framebuffer and so is initialised by the
>>> system declaration ROM included within the MacOS toolbox ROM.
>>> 
>>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>>> ---
>>>   hw/display/macfb.c | 6 ------
>>>   1 file changed, 6 deletions(-)
>>> 
>>> diff --git a/hw/display/macfb.c b/hw/display/macfb.c
>>> index d8183b9bbd..76808b69cc 100644
>>> --- a/hw/display/macfb.c
>>> +++ b/hw/display/macfb.c
>>> @@ -383,10 +383,6 @@ static void macfb_sysbus_realize(DeviceState *dev, 
>>> Error **errp)
>>>       sysbus_init_mmio(SYS_BUS_DEVICE(s), &ms->mem_vram);
>>>   }
>>>   -const uint8_t macfb_rom[] = {
>>> -    255, 0, 0, 0,
>>> -};
>>> -
>>>   static void macfb_nubus_realize(DeviceState *dev, Error **errp)
>>>   {
>>>       NubusDevice *nd = NUBUS_DEVICE(dev);
>>> @@ -399,8 +395,6 @@ static void macfb_nubus_realize(DeviceState *dev, 
>>> Error **errp)
>>>       macfb_common_realize(dev, ms, errp);
>>>       memory_region_add_subregion(&nd->slot_mem, DAFB_BASE, 
>>> &ms->mem_ctrl);
>>>       memory_region_add_subregion(&nd->slot_mem, VIDEO_BASE, 
>>> &ms->mem_vram);
>>> -
>>> -    nubus_register_rom(nd, macfb_rom, sizeof(macfb_rom), 1, 9, 0xf);
>>>   }
>>>     static void macfb_sysbus_reset(DeviceState *d)
>>> 
>> 
>> Will macfb continue to work with "-kernel" and without providing any MacOS 
>> ROM?
>
> Yes indeed, since on the Quadra 800 the declaration ROM for the framebuffer 
> is embedded within the MacOS toolbox ROM.

Even if you want to boot Linux but have no toolbox ROM? (As the ROM is not 
free and thus not included with QEMU one can assume that's a common use 
case to boot Linux with -kernel but without -bios; I think that's what 
Laurent was asking about).

Regards,
BALATON Zoltan
Mark Cave-Ayland Sept. 22, 2021, 11:31 a.m. UTC | #5
On 22/09/2021 12:15, BALATON Zoltan wrote:

> On Wed, 22 Sep 2021, Mark Cave-Ayland wrote:
>> On 20/09/2021 21:01, Laurent Vivier wrote:
>>> Le 17/09/2021 à 09:50, Mark Cave-Ayland a écrit :
>>>> The macfb device is an on-board framebuffer and so is initialised by the
>>>> system declaration ROM included within the MacOS toolbox ROM.
>>>>
>>>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>>>> ---
>>>>   hw/display/macfb.c | 6 ------
>>>>   1 file changed, 6 deletions(-)
>>>>
>>>> diff --git a/hw/display/macfb.c b/hw/display/macfb.c
>>>> index d8183b9bbd..76808b69cc 100644
>>>> --- a/hw/display/macfb.c
>>>> +++ b/hw/display/macfb.c
>>>> @@ -383,10 +383,6 @@ static void macfb_sysbus_realize(DeviceState *dev, Error 
>>>> **errp)
>>>>       sysbus_init_mmio(SYS_BUS_DEVICE(s), &ms->mem_vram);
>>>>   }
>>>>   -const uint8_t macfb_rom[] = {
>>>> -    255, 0, 0, 0,
>>>> -};
>>>> -
>>>>   static void macfb_nubus_realize(DeviceState *dev, Error **errp)
>>>>   {
>>>>       NubusDevice *nd = NUBUS_DEVICE(dev);
>>>> @@ -399,8 +395,6 @@ static void macfb_nubus_realize(DeviceState *dev, Error **errp)
>>>>       macfb_common_realize(dev, ms, errp);
>>>>       memory_region_add_subregion(&nd->slot_mem, DAFB_BASE, &ms->mem_ctrl);
>>>>       memory_region_add_subregion(&nd->slot_mem, VIDEO_BASE, &ms->mem_vram);
>>>> -
>>>> -    nubus_register_rom(nd, macfb_rom, sizeof(macfb_rom), 1, 9, 0xf);
>>>>   }
>>>>     static void macfb_sysbus_reset(DeviceState *d)
>>>>
>>>
>>> Will macfb continue to work with "-kernel" and without providing any MacOS ROM?
>>
>> Yes indeed, since on the Quadra 800 the declaration ROM for the framebuffer is 
>> embedded within the MacOS toolbox ROM.
> 
> Even if you want to boot Linux but have no toolbox ROM? (As the ROM is not free and 
> thus not included with QEMU one can assume that's a common use case to boot Linux 
> with -kernel but without -bios; I think that's what Laurent was asking about).

Yes, correct. If you check earlier in the thread you can see Laurent confirms that no 
declaration ROM is present on a real Quadra 800. In the -kernel case all that happens 
is that the physical address of the framebuffer is passed to the kernel using 
bootinfo ready for use.


ATB,

Mark.
diff mbox series

Patch

diff --git a/hw/display/macfb.c b/hw/display/macfb.c
index d8183b9bbd..76808b69cc 100644
--- a/hw/display/macfb.c
+++ b/hw/display/macfb.c
@@ -383,10 +383,6 @@  static void macfb_sysbus_realize(DeviceState *dev, Error **errp)
     sysbus_init_mmio(SYS_BUS_DEVICE(s), &ms->mem_vram);
 }
 
-const uint8_t macfb_rom[] = {
-    255, 0, 0, 0,
-};
-
 static void macfb_nubus_realize(DeviceState *dev, Error **errp)
 {
     NubusDevice *nd = NUBUS_DEVICE(dev);
@@ -399,8 +395,6 @@  static void macfb_nubus_realize(DeviceState *dev, Error **errp)
     macfb_common_realize(dev, ms, errp);
     memory_region_add_subregion(&nd->slot_mem, DAFB_BASE, &ms->mem_ctrl);
     memory_region_add_subregion(&nd->slot_mem, VIDEO_BASE, &ms->mem_vram);
-
-    nubus_register_rom(nd, macfb_rom, sizeof(macfb_rom), 1, 9, 0xf);
 }
 
 static void macfb_sysbus_reset(DeviceState *d)