summaryrefslogtreecommitdiffstats
path: root/hw/axis_dev88.c
diff options
context:
space:
mode:
authorEdgar E. Iglesias <edgar.iglesias@gmail.com>2009-05-16 00:23:15 +0200
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2009-05-16 02:13:08 +0200
commit73cfd29fb34568f926386c2f43811362f2c22154 (patch)
tree1c49809001b05a8871fb462e7e717163075d439d /hw/axis_dev88.c
parentdf84e4f34504ffc2d9daaa0238fcf67f3dbbf681 (diff)
downloadhqemu-73cfd29fb34568f926386c2f43811362f2c22154.zip
hqemu-73cfd29fb34568f926386c2f43811362f2c22154.tar.gz
ETRAX: Simplify PIC interface.
Instead of exporting a custom structure to represent different interrupt types, just export the irq array and have the top elements point to the NMI lines. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'hw/axis_dev88.c')
-rw-r--r--hw/axis_dev88.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/hw/axis_dev88.c b/hw/axis_dev88.c
index 8df536d..3ed2066 100644
--- a/hw/axis_dev88.c
+++ b/hw/axis_dev88.c
@@ -257,7 +257,7 @@ void axisdev88_init (ram_addr_t ram_size,
const char *initrd_filename, const char *cpu_model)
{
CPUState *env;
- struct etraxfs_pic *pic;
+ qemu_irq *irq, *nmi;
void *etraxfs_dmac;
struct etraxfs_dma_client *eth[2] = {NULL, NULL};
int kernel_size;
@@ -295,18 +295,20 @@ void axisdev88_init (ram_addr_t ram_size,
cpu_register_physical_memory(0x3001a000, 0x5c, gpio_regs);
- pic = etraxfs_pic_init(env, 0x3001c000);
+ irq = etraxfs_pic_init(env, 0x3001c000);
+ nmi = irq + 30;
+
etraxfs_dmac = etraxfs_dmac_init(env, 0x30000000, 10);
for (i = 0; i < 10; i++) {
/* On ETRAX, odd numbered channels are inputs. */
- etraxfs_dmac_connect(etraxfs_dmac, i, pic->irq + 7 + i, i & 1);
+ etraxfs_dmac_connect(etraxfs_dmac, i, irq + 7 + i, i & 1);
}
/* Add the two ethernet blocks. */
- eth[0] = etraxfs_eth_init(&nd_table[0], env, pic->irq + 25, 0x30034000, 1);
+ eth[0] = etraxfs_eth_init(&nd_table[0], env, irq + 25, 0x30034000, 1);
if (nb_nics > 1)
eth[1] = etraxfs_eth_init(&nd_table[1], env,
- pic->irq + 26, 0x30036000, 2);
+ irq + 26, 0x30036000, 2);
/* The DMA Connector block is missing, hardwire things for now. */
etraxfs_dmac_connect_client(etraxfs_dmac, 0, eth[0]);
@@ -317,12 +319,12 @@ void axisdev88_init (ram_addr_t ram_size,
}
/* 2 timers. */
- etraxfs_timer_init(env, pic->irq + 0x1b, pic->nmi + 1, 0x3001e000);
- etraxfs_timer_init(env, pic->irq + 0x1b, pic->nmi + 1, 0x3005e000);
+ etraxfs_timer_init(env, irq + 0x1b, nmi + 1, 0x3001e000);
+ etraxfs_timer_init(env, irq + 0x1b, nmi + 1, 0x3005e000);
for (i = 0; i < 4; i++) {
if (serial_hds[i]) {
- etraxfs_ser_init(env, pic->irq + 0x14 + i,
+ etraxfs_ser_init(env, irq + 0x14 + i,
serial_hds[i], 0x30026000 + i * 0x2000);
}
}
OpenPOWER on IntegriCloud