With the corresponding QEMU patches applied, it is now possible to change the
reported firmware name to that of a real 40p machine and boot to a working
userspace with the Linux sandalfoot zImage.
Note that whilst guest OSs should be relying on residual data rather than the
OF device tree to determine the hardware, we still update the interrupt
properties to match the new code in QEMU for consistency.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)ilande.co.uk>
---
arch/ppc/qemu/context.c | 2 +-
drivers/pci.c | 24 ++++++++++++++++++++----
2 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/arch/ppc/qemu/context.c b/arch/ppc/qemu/context.c
index 06e0122..5815895 100644
--- a/arch/ppc/qemu/context.c
+++ b/arch/ppc/qemu/context.c
@@ -111,7 +111,7 @@ static void *
residual_build(uint32_t memsize, uint32_t load_base, uint32_t load_size)
{
residual_t *res;
- const unsigned char model[] = "Qemu\0PPC\0";
+ const unsigned char model[] = "IBM PPS Model 6015\0";
int i;
res = malloc(sizeof(residual_t));
diff --git a/drivers/pci.c b/drivers/pci.c
index 8f97ae1..df6d9d0 100644
--- a/drivers/pci.c
+++ b/drivers/pci.c
@@ -1986,10 +1986,26 @@ static phandle_t ob_pci_host_set_interrupt_map(phandle_t host)
static void ob_pci_host_bus_interrupt(ucell dnode, u32 *props, int *ncells, u32 addr, u32 intno)
{
*ncells += pci_encode_phys_addr(props + *ncells, 0, 0, addr, 0, 0);
- props[(*ncells)++] = intno;
- props[(*ncells)++] = dnode;
- props[(*ncells)++] = arch->irqs[((intno - 1) + (addr >> 11)) & 3];
- props[(*ncells)++] = 1;
+
+ if (is_oldworld() || is_newworld()) {
+ /* Mac machines */
+ props[(*ncells)++] = intno;
+ props[(*ncells)++] = dnode;
+ props[(*ncells)++] = arch->irqs[((intno - 1) + (addr >> 11)) & 3];
+ props[(*ncells)++] = 1;
+ } else {
+ /* PReP machines */
+ props[(*ncells)++] = intno;
+ props[(*ncells)++] = dnode;
+
+ if (PCI_DEV(addr) == 1 && PCI_FN(addr) == 0) {
+ /* LSI SCSI has fixed routing */
+ props[(*ncells)++] = 2;
+ } else {
+ props[(*ncells)++] = arch->irqs[((intno - 1) + (addr >> 11)) & 1];
+ }
+ props[(*ncells)++] = 1;
+ }
}
#elif defined(CONFIG_SPARC64)
--
2.11.0