* [PATCH 1/3] ppc/pegasos2: Fix reset state of USB functions
2023-07-19 0:32 [PATCH 0/3] pegasos2 fixes for 8.1 BALATON Zoltan
@ 2023-07-19 0:32 ` BALATON Zoltan
2023-07-19 0:32 ` [PATCH 2/3] ppc/pegasos2: Fix reg property of ROM BARs BALATON Zoltan
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: BALATON Zoltan @ 2023-07-19 0:32 UTC (permalink / raw)
To: qemu-devel, qemu-ppc; +Cc: Daniel Henrique Barboza
The original non-free board firmware sets the command register of the
USB functions to 7 and some guests rely on this for working USB. Match
what the board firmware does when using VOF instead.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
hw/ppc/pegasos2.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c
index 4447bbe8ec..4a2ab35f19 100644
--- a/hw/ppc/pegasos2.c
+++ b/hw/ppc/pegasos2.c
@@ -324,9 +324,13 @@ static void pegasos2_machine_reset(MachineState *machine, ShutdownCause reason)
pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 2) << 8) |
PCI_INTERRUPT_LINE, 2, 0x409);
+ pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 2) << 8) |
+ PCI_COMMAND, 2, 0x7);
pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 3) << 8) |
PCI_INTERRUPT_LINE, 2, 0x409);
+ pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 3) << 8) |
+ PCI_COMMAND, 2, 0x7);
pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 4) << 8) |
PCI_INTERRUPT_LINE, 2, 0x9);
--
2.30.9
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] ppc/pegasos2: Fix reg property of ROM BARs
2023-07-19 0:32 [PATCH 0/3] pegasos2 fixes for 8.1 BALATON Zoltan
2023-07-19 0:32 ` [PATCH 1/3] ppc/pegasos2: Fix reset state of USB functions BALATON Zoltan
@ 2023-07-19 0:32 ` BALATON Zoltan
2023-07-19 0:32 ` [PATCH 3/3] ppc/pegasos2: Fix naming of device tree nodes BALATON Zoltan
2023-07-21 20:37 ` [PATCH 0/3] pegasos2 fixes for 8.1 Daniel Henrique Barboza
3 siblings, 0 replies; 7+ messages in thread
From: BALATON Zoltan @ 2023-07-19 0:32 UTC (permalink / raw)
To: qemu-devel, qemu-ppc; +Cc: Daniel Henrique Barboza
The register offset of the ROM BAR is 0x30 not 0x28. This fixes the
reg property entry of the ROM region in the device tree.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
hw/ppc/pegasos2.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c
index 4a2ab35f19..8ed13a42a2 100644
--- a/hw/ppc/pegasos2.c
+++ b/hw/ppc/pegasos2.c
@@ -766,7 +766,11 @@ static void add_pci_device(PCIBus *bus, PCIDevice *d, void *opaque)
if (!d->io_regions[i].size) {
continue;
}
- cells[j] = cpu_to_be32(d->devfn << 8 | (PCI_BASE_ADDRESS_0 + i * 4));
+ cells[j] = PCI_BASE_ADDRESS_0 + i * 4;
+ if (cells[j] == 0x28) {
+ cells[j] = 0x30;
+ }
+ cells[j] = cpu_to_be32(d->devfn << 8 | cells[j]);
if (d->io_regions[i].type & PCI_BASE_ADDRESS_SPACE_IO) {
cells[j] |= cpu_to_be32(1 << 24);
} else {
--
2.30.9
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] ppc/pegasos2: Fix naming of device tree nodes
2023-07-19 0:32 [PATCH 0/3] pegasos2 fixes for 8.1 BALATON Zoltan
2023-07-19 0:32 ` [PATCH 1/3] ppc/pegasos2: Fix reset state of USB functions BALATON Zoltan
2023-07-19 0:32 ` [PATCH 2/3] ppc/pegasos2: Fix reg property of ROM BARs BALATON Zoltan
@ 2023-07-19 0:32 ` BALATON Zoltan
2023-07-21 20:37 ` [PATCH 0/3] pegasos2 fixes for 8.1 Daniel Henrique Barboza
3 siblings, 0 replies; 7+ messages in thread
From: BALATON Zoltan @ 2023-07-19 0:32 UTC (permalink / raw)
To: qemu-devel, qemu-ppc; +Cc: Daniel Henrique Barboza
The board firmware names devices by their class so match that for
common devices. Also make sure the /rtas node has a name. This is
needed because VOF otherwise does not include it in results got by
nextprop which is how AmigaOS queries it and fails if no name property
is found.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
hw/ppc/pegasos2.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c
index 8ed13a42a2..6475acfbed 100644
--- a/hw/ppc/pegasos2.c
+++ b/hw/ppc/pegasos2.c
@@ -739,6 +739,13 @@ static void add_pci_device(PCIBus *bus, PCIDevice *d, void *opaque)
pci_get_word(&d->config[PCI_VENDOR_ID]),
pci_get_word(&d->config[PCI_DEVICE_ID]));
+ if (pci_get_word(&d->config[PCI_CLASS_DEVICE]) ==
+ PCI_CLASS_NETWORK_ETHERNET) {
+ name = "ethernet";
+ } else if (pci_get_word(&d->config[PCI_CLASS_DEVICE]) >> 8 ==
+ PCI_BASE_CLASS_DISPLAY) {
+ name = "display";
+ }
for (i = 0; device_map[i].id; i++) {
if (!strcmp(pn, device_map[i].id)) {
name = device_map[i].name;
@@ -929,6 +936,7 @@ static void *build_fdt(MachineState *machine, int *fdt_size)
qemu_fdt_setprop_cell(fdt, "/rtas", "rtas-display-device", 0);
qemu_fdt_setprop_cell(fdt, "/rtas", "rtas-size", 20);
qemu_fdt_setprop_cell(fdt, "/rtas", "rtas-version", 1);
+ qemu_fdt_setprop_string(fdt, "/rtas", "name", "rtas");
/* cpus */
qemu_fdt_add_subnode(fdt, "/cpus");
--
2.30.9
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 0/3] pegasos2 fixes for 8.1
2023-07-19 0:32 [PATCH 0/3] pegasos2 fixes for 8.1 BALATON Zoltan
` (2 preceding siblings ...)
2023-07-19 0:32 ` [PATCH 3/3] ppc/pegasos2: Fix naming of device tree nodes BALATON Zoltan
@ 2023-07-21 20:37 ` Daniel Henrique Barboza
2023-07-21 22:17 ` BALATON Zoltan
3 siblings, 1 reply; 7+ messages in thread
From: Daniel Henrique Barboza @ 2023-07-21 20:37 UTC (permalink / raw)
To: BALATON Zoltan, qemu-devel, qemu-ppc
On 7/18/23 21:32, BALATON Zoltan wrote:
> These are some small fixes when using pegasos2 with the QEMU built in
> VOF instead of the non-free board firmware that fix bugs in the
> generated device tree and matches the board firmware in the reset
> state of on-board USB devices. This fixes booting AmigaOS with VOF and
> only touches parts that are used with VOF only so I'd like these to be
> merged for 8.1.
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
And pushed to ppc-next. Thanks,
Daniel
>
> Regards,
>
> BALATON Zoltan (3):
> ppc/pegasos2: Fix reset state of USB functions
> ppc/pegasos2: Fix reg property of ROM BARs
> ppc/pegasos2: Fix naming of device tree nodes
>
> hw/ppc/pegasos2.c | 18 +++++++++++++++++-
> 1 file changed, 17 insertions(+), 1 deletion(-)
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/3] pegasos2 fixes for 8.1
2023-07-21 20:37 ` [PATCH 0/3] pegasos2 fixes for 8.1 Daniel Henrique Barboza
@ 2023-07-21 22:17 ` BALATON Zoltan
2023-07-22 18:11 ` Daniel Henrique Barboza
0 siblings, 1 reply; 7+ messages in thread
From: BALATON Zoltan @ 2023-07-21 22:17 UTC (permalink / raw)
To: Daniel Henrique Barboza; +Cc: qemu-devel, qemu-ppc
On Fri, 21 Jul 2023, Daniel Henrique Barboza wrote:
> On 7/18/23 21:32, BALATON Zoltan wrote:
>> These are some small fixes when using pegasos2 with the QEMU built in
>> VOF instead of the non-free board firmware that fix bugs in the
>> generated device tree and matches the board firmware in the reset
>> state of on-board USB devices. This fixes booting AmigaOS with VOF and
>> only touches parts that are used with VOF only so I'd like these to be
>> merged for 8.1.
>
> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
>
>
> And pushed to ppc-next. Thanks,
Thank you. I've just sent another similar one I've found later so was
missed from this series but I hope this can still get in. This should be
the last one from me for 8.1 now, sorry for sending it so late.
Regards,
BALATON Zoltan
> Daniel
>
>>
>> Regards,
>>
>> BALATON Zoltan (3):
>> ppc/pegasos2: Fix reset state of USB functions
>> ppc/pegasos2: Fix reg property of ROM BARs
>> ppc/pegasos2: Fix naming of device tree nodes
>>
>> hw/ppc/pegasos2.c | 18 +++++++++++++++++-
>> 1 file changed, 17 insertions(+), 1 deletion(-)
>>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/3] pegasos2 fixes for 8.1
2023-07-21 22:17 ` BALATON Zoltan
@ 2023-07-22 18:11 ` Daniel Henrique Barboza
0 siblings, 0 replies; 7+ messages in thread
From: Daniel Henrique Barboza @ 2023-07-22 18:11 UTC (permalink / raw)
To: BALATON Zoltan; +Cc: qemu-devel, qemu-ppc
On 7/21/23 19:17, BALATON Zoltan wrote:
> On Fri, 21 Jul 2023, Daniel Henrique Barboza wrote:
>> On 7/18/23 21:32, BALATON Zoltan wrote:
>>> These are some small fixes when using pegasos2 with the QEMU built in
>>> VOF instead of the non-free board firmware that fix bugs in the
>>> generated device tree and matches the board firmware in the reset
>>> state of on-board USB devices. This fixes booting AmigaOS with VOF and
>>> only touches parts that are used with VOF only so I'd like these to be
>>> merged for 8.1.
>>
>> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
>>
>>
>> And pushed to ppc-next. Thanks,
>
> Thank you. I've just sent another similar one I've found later so was missed from this series but I hope this can still get in. This should be the last one from me for 8.1 now, sorry for sending it so late.
It's fine. It's still a good time to push this kind of fixes. I'll take
a look at that one.
Daniel
>
> Regards,
> BALATON Zoltan
>
>> Daniel
>>
>>>
>>> Regards,
>>>
>>> BALATON Zoltan (3):
>>> ppc/pegasos2: Fix reset state of USB functions
>>> ppc/pegasos2: Fix reg property of ROM BARs
>>> ppc/pegasos2: Fix naming of device tree nodes
>>>
>>> hw/ppc/pegasos2.c | 18 +++++++++++++++++-
>>> 1 file changed, 17 insertions(+), 1 deletion(-)
>>>
>>
>>
^ permalink raw reply [flat|nested] 7+ messages in thread