[PATCH 0/2] 40p minor fixes

Here are a couple of 40p fixes I noticed whilst debugging the interrupt routing in QEMU's 40p PReP machine. Note that the IRQ changes in patch 2 are dependent upon my fix for the 40p PCI IRQ routing posted at https://lists.gnu.org/archive/html/qemu-devel/2018-08/msg05705.html. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Mark Cave-Ayland (2): 40p: fix up generation of interrupt properties 40p: update PReP configuration to match 40p machine arch/ppc/qemu/init.c | 4 ++-- drivers/pci.c | 15 +++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) -- 2.11.0

Since support for QEMU's 40p machine has been added there is now the possibility of having a PPC architecture where !is_newworld() and !is_oldworld() are both true. Fix up a couple of instances in this logic that were preventing the generation of interrupt properties in the device tree for 40p machines. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> --- drivers/pci.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/pci.c b/drivers/pci.c index 7a174b4..3423a92 100644 --- a/drivers/pci.c +++ b/drivers/pci.c @@ -1237,13 +1237,11 @@ static void ob_pci_add_properties(phandle_t phandle, set_int_property(dev, "class-code", class_code << 8 | class_prog); if (config->irq_pin) { - OLDWORLD(set_int_property(dev, "AAPL,interrupts", - config->irq_line)); -#if defined(CONFIG_SPARC64) - set_int_property(dev, "interrupts", config->irq_pin); -#else - NEWWORLD(set_int_property(dev, "interrupts", config->irq_pin)); -#endif + if (is_oldworld()) { + set_int_property(dev, "AAPL,interrupts", config->irq_line); + } else { + set_int_property(dev, "interrupts", config->irq_pin); + } } set_int_property(dev, "min-grant", pci_config_read8(addr, PCI_MIN_GNT)); @@ -1848,8 +1846,9 @@ static phandle_t ob_pci_host_set_interrupt_map(phandle_t host) char *path, buf[256]; /* Oldworld macs do interrupt maps differently */ - if (!is_newworld()) + if (is_oldworld()) { return 0; + } PCI_DPRINTF("setting up interrupt map for host %x\n", host); dnode = dt_iterate_type(0, "open-pic"); -- 2.11.0

Now that the QEMU PReP machine has been officially deprecated we should switch over the OpenBIOS PReP configuration to match the 40p machine instead. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> --- arch/ppc/qemu/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/ppc/qemu/init.c b/arch/ppc/qemu/init.c index af15682..c40b7df 100644 --- a/arch/ppc/qemu/init.c +++ b/arch/ppc/qemu/init.c @@ -113,7 +113,7 @@ int has_adb(void) static const pci_arch_t known_arch[] = { [ARCH_PREP] = { - .name = "PREP", + .name = "40P", .vendor_id = PCI_VENDOR_ID_MOTOROLA, .device_id = PCI_DEVICE_ID_MOTOROLA_RAVEN, .cfg_addr = 0x80000cf8, @@ -130,7 +130,7 @@ static const pci_arch_t known_arch[] = { { .type = MEMORY_SPACE_32, .parentaddr = 0, .childaddr = 0xc0100000, .len = 0x10000000 }, { .type = 0, .parentaddr = 0, .childaddr = 0, .len = 0 } }, - .irqs = { 9, 11, 9, 11 } + .irqs = { 15, 15, 15, 15 } }, [ARCH_MAC99] = { .name = "MAC99", -- 2.11.0

On Aug 27, 2018, at 8:24 AM, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> wrote:
Now that the QEMU PReP machine has been officially deprecated we should switch over the OpenBIOS PReP configuration to match the 40p machine instead.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> --- arch/ppc/qemu/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/ppc/qemu/init.c b/arch/ppc/qemu/init.c index af15682..c40b7df 100644 --- a/arch/ppc/qemu/init.c +++ b/arch/ppc/qemu/init.c @@ -113,7 +113,7 @@ int has_adb(void)
static const pci_arch_t known_arch[] = { [ARCH_PREP] = {
I just had a question about this constant. Should it be changed to ARCH_IBM40P?
- .name = "PREP", + .name = "40P", .vendor_id = PCI_VENDOR_ID_MOTOROLA, .device_id = PCI_DEVICE_ID_MOTOROLA_RAVEN, .cfg_addr = 0x80000cf8, @@ -130,7 +130,7 @@ static const pci_arch_t known_arch[] = { { .type = MEMORY_SPACE_32, .parentaddr = 0, .childaddr = 0xc0100000, .len = 0x10000000 }, { .type = 0, .parentaddr = 0, .childaddr = 0, .len = 0 } }, - .irqs = { 9, 11, 9, 11 } + .irqs = { 15, 15, 15, 15 } }, [ARCH_MAC99] = { .name = "MAC99", -- 2.11.0
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you

On 27/08/18 15:17, Programmingkid wrote:
On Aug 27, 2018, at 8:24 AM, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> wrote:
Now that the QEMU PReP machine has been officially deprecated we should switch over the OpenBIOS PReP configuration to match the 40p machine instead.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> --- arch/ppc/qemu/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/ppc/qemu/init.c b/arch/ppc/qemu/init.c index af15682..c40b7df 100644 --- a/arch/ppc/qemu/init.c +++ b/arch/ppc/qemu/init.c @@ -113,7 +113,7 @@ int has_adb(void)
static const pci_arch_t known_arch[] = { [ARCH_PREP] = {
I just had a question about this constant. Should it be changed to ARCH_IBM40P?
I did think about that, however it is an enum and will also be referenced as PReP throughout the related QEMU code (at least until -M prep is removed). Does anyone else feel particularly strongly about this? ATB, Mark.

Le 27/08/2018 à 14:24, Mark Cave-Ayland a écrit :
Here are a couple of 40p fixes I noticed whilst debugging the interrupt routing in QEMU's 40p PReP machine.
Note that the IRQ changes in patch 2 are dependent upon my fix for the 40p PCI IRQ routing posted at https://lists.gnu.org/archive/html/qemu-devel/2018-08/msg05705.html.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Mark Cave-Ayland (2): 40p: fix up generation of interrupt properties 40p: update PReP configuration to match 40p machine
arch/ppc/qemu/init.c | 4 ++-- drivers/pci.c | 15 +++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-)
Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>

On 27/08/18 13:24, Mark Cave-Ayland wrote:
Here are a couple of 40p fixes I noticed whilst debugging the interrupt routing in QEMU's 40p PReP machine.
Note that the IRQ changes in patch 2 are dependent upon my fix for the 40p PCI IRQ routing posted at https://lists.gnu.org/archive/html/qemu-devel/2018-08/msg05705.html.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Mark Cave-Ayland (2): 40p: fix up generation of interrupt properties 40p: update PReP configuration to match 40p machine
arch/ppc/qemu/init.c | 4 ++-- drivers/pci.c | 15 +++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-)
I've applied just the first patch in this series to master until we can get agreement on the corresponding IRQ-related QEMU patches - looks like they need a few modifications. ATB, Mark.
participants (3)
-
Hervé Poussineau
-
Mark Cave-Ayland
-
Programmingkid