Hi,

Current versions of Qemu (with the attached PCI patch) and OpenBIOS
get this far:
OpenBIOS for Sparc64
boot arg = 0x0

00000000-08000000
RAM 128 MB
forth started.
initializing memory...done
Initializing PCI devices...
0:0.0 - 108e:a000 - /pci/pci108e,a000 - host
0:1.0 - 108e:5000 - /pci/pci108e,5000 - pci
0:1.1 - 108e:5000 - /pci/pci108e,5000 - pci
0:2.0 - 1013:b8 - /pci/pci1013,b8 - display
0:3.0 - 10ec:8029 - /pci/pci10ec,8029 - ethernet
0:4.0 - 1095:646 - /pci/pci1095,646 - ide
floppy_init
FDC is a S82078B
floppy_reset
floppy_motor_off
SENSEI 20 00
status = 80, reply_buffer= 20 0
fdc_specify
FD_SPECIFY(c1, 11)
set_drive status = 80, new_dor = 10
floppy_recalibrate
fdc_state.version = 0062
invalid nvram partition length
nvram error detected, zapping pram
falling off...
Unhandled Exception 0x0000000000000008
PC = 0x0000000000000008 NPC = 0x000000000000000c
Stopping execution

For some reason some C functions do not get called from Forth, so the
booting does not start and execution falls off the main function.

The PCI patch is just a quick hack to get PCI probing succeed, I won't
commit it in yet.
Index: qemu/hw/apb_pci.c
===================================================================
--- qemu.orig/hw/apb_pci.c	2007-07-08 19:25:40.000000000 +0000
+++ qemu/hw/apb_pci.c	2007-07-08 19:42:03.000000000 +0000
@@ -36,13 +36,11 @@
                                          uint32_t val)
 {
     APBState *s = opaque;
-    int i;
 
-    for (i = 11; i < 32; i++) {
-        if ((val & (1 << i)) != 0)
-            break;
-    }
-    s->config_reg = (1 << 16) | (val & 0x7FC) | (i << 11);
+#ifdef TARGET_WORDS_BIGENDIAN
+    val = bswap32(val);
+#endif
+    s->config_reg = val;
 }
 
 static uint32_t pci_apb_config_readl (void *opaque,
@@ -54,6 +52,9 @@
 
     devfn = (s->config_reg >> 8) & 0xFF;
     val = (1 << (devfn >> 3)) | ((devfn & 0x07) << 8) | (s->config_reg & 0xFC);
+#ifdef TARGET_WORDS_BIGENDIAN
+    val = bswap32(val);
+#endif
     return val;
 }
 
@@ -253,7 +254,7 @@
     /* APB secondary busses */
     secondary = pci_bridge_init(s->bus, 8, 0x108e5000, pci_apb_map_irq, "Advanced PCI Bus secondary bridge 1");
     pci_bridge_init(s->bus, 9, 0x108e5000, pci_apb_map_irq, "Advanced PCI Bus secondary bridge 2");
-    return secondary;
+    return s->bus;
 }
 
 

Reply via email to