Author: laurent Date: 2009-12-19 00:38:08 +0100 (Sat, 19 Dec 2009) New Revision: 646
Modified: trunk/openbios-devel/drivers/escc.c trunk/openbios-devel/drivers/macio.c Log: When running qemu in -M mac99 mode, interrupts failed on me all the time.
I finally managed to track things down and it seems like we're missing some properties in several devices.
While at it, I also bumped the ESCC IRQs to 0x24 / 0x25, as that's what qemu now maps them on.
This patch (plus the qemu set) gets PPC64 Linux booting with console=ttyPZ0.
Signed-off-by: Alexander Graf agraf@suse.de
Modified: trunk/openbios-devel/drivers/escc.c =================================================================== --- trunk/openbios-devel/drivers/escc.c 2009-12-18 20:41:51 UTC (rev 645) +++ trunk/openbios-devel/drivers/escc.c 2009-12-18 23:38:08 UTC (rev 646) @@ -418,6 +418,11 @@ OLDWORLD(set_property(dnode, "AAPL,interrupts", (char *)&props, 1 * sizeof(cell)));
+ props[0] = 0; + props[0] = (0x24) + offset; + NEWWORLD(set_property(dnode, "interrupts", + (char *)&props, 2 * sizeof(cell))); + device_end();
uart_init_line((unsigned char*)addr + IO_ESCC_OFFSET + offset * 0x20,
Modified: trunk/openbios-devel/drivers/macio.c =================================================================== --- trunk/openbios-devel/drivers/macio.c 2009-12-18 20:41:51 UTC (rev 645) +++ trunk/openbios-devel/drivers/macio.c 2009-12-18 23:38:08 UTC (rev 646) @@ -145,6 +145,7 @@ static void openpic_init(const char *path, uint32_t addr) { + phandle_t target_node; phandle_t dnode; int props[2]; char buf[128]; @@ -154,7 +155,6 @@ fword("new-device"); push_str("interrupt-controller"); fword("device-name"); - fword("finish-device");
snprintf(buf, sizeof(buf), "%s/interrupt-controller", path); dnode = find_dev(buf); @@ -168,6 +168,21 @@ set_int_property(dnode, "#address-cells", 0); set_property(dnode, "interrupt-controller", "", 0); set_int_property(dnode, "clock-frequency", 4166666); + + fword("finish-device"); + + if (is_newworld()) { + /* patch in interrupt parent */ + dnode = find_dev(buf); + target_node = find_dev("/pci"); + set_int_property(target_node, "interrupt-parent", dnode); + + target_node = find_dev("/pci/mac-io/escc/ch-a"); + set_int_property(target_node, "interrupt-parent", dnode); + + target_node = find_dev("/pci/mac-io/escc/ch-b"); + set_int_property(target_node, "interrupt-parent", dnode); + } }
DECLARE_NODE(ob_macio, INSTALL_OPEN, sizeof(int), "Tmac-io");