Author: agraf Date: Mon Feb 22 19:52:28 2010 New Revision: 680 URL: http://tracker.coreboot.org/trac/openbios/changeset/680
Log: PPC: Fix interrupt numbers
We changed several interrupt numbers in Qemu to better reflect real world hardware. Also, since we're now using proper interrupt maps, we need to make sure we specify interrupts in the way the respective map requires it.
Signed-off-by: Alexander Graf agraf@suse.de
Modified: trunk/openbios-devel/drivers/cuda.c trunk/openbios-devel/drivers/ide.c
Modified: trunk/openbios-devel/drivers/cuda.c ============================================================================== --- trunk/openbios-devel/drivers/cuda.c Mon Feb 22 19:52:26 2010 (r679) +++ trunk/openbios-devel/drivers/cuda.c Mon Feb 22 19:52:28 2010 (r680) @@ -197,7 +197,12 @@
set_property(ph, "reg", (char *)&props, sizeof(props));
- set_int_property(ph, "interrupts", 0x12); + /* on newworld machines the cuda is on interrupt 0x19 */ + + props[0] = 0x19; + props[1] = 0; + NEWWORLD(set_property(ph, "interrupts", (char *)props, sizeof(props))); + NEWWORLD(set_int_property(ph, "#interrupt-cells", 2));
/* we emulate an oldworld hardware, so we must use * non-standard oldworld property (needed by linux 2.6.18)
Modified: trunk/openbios-devel/drivers/ide.c ============================================================================== --- trunk/openbios-devel/drivers/ide.c Mon Feb 22 19:52:26 2010 (r679) +++ trunk/openbios-devel/drivers/ide.c Mon Feb 22 19:52:28 2010 (r680) @@ -1421,9 +1421,11 @@
dnode = find_dev(nodebuff);
+#ifndef CONFIG_PPC props[0]=14; props[1]=0; set_property(dnode, "interrupts", (char *)&props, 2*sizeof(cell)); +#endif
props[0] = __cpu_to_be32(chan->io_regs[0]); props[1] = __cpu_to_be32(1); props[2] = __cpu_to_be32(8); @@ -1578,10 +1580,31 @@ OLDWORLD(set_property(dnode, "AAPL,pio-timing", (char *)&props, 8*sizeof(cell)));
- props[0] = 0x0000000d; - props[1] = 0x00000000; + /* The first interrupt entry is the ide interrupt, the second + the dbdma interrupt */ + switch (current_channel) { + case 1: + props[0] = 0x0000000d; + props[2] = 0x00000002; + break; + case 2: + props[0] = 0x0000000e; + props[2] = 0x00000003; + break; + case 3: + props[0] = 0x0000000f; + props[2] = 0x00000004; + break; + default: + props[0] = 0x00000000; + props[2] = 0x00000000; + break; + } + props[1] = 0x00000000; /* XXX level triggered on real hw */ + props[3] = 0x00000000; set_property(dnode, "interrupts", - (char *)&props, 2*sizeof(cell)); + (char *)&props, 4*sizeof(cell)); + set_int_property(dnode, "#interrupt-cells", 2); OLDWORLD(set_property(dnode, "AAPL,interrupts", (char *)&props, 2*sizeof(cell)));