diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2009-07-21 19:25:59 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2009-07-21 19:25:59 +0000 |
commit | 7fc067350cb5a9218c607fce0a29af612ba48324 (patch) | |
tree | b0065cdcd7128d4b62c680ab63432be6a8bcc042 /hw/sun4m.c | |
parent | 871e6c3507b34c584739cadde13885e11db0b3ce (diff) |
Sparc32: convert SBI to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/sun4m.c')
-rw-r--r-- | hw/sun4m.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/hw/sun4m.c b/hw/sun4m.c index 9e4bfac9fe..1e240179bb 100644 --- a/hw/sun4m.c +++ b/hw/sun4m.c @@ -1322,12 +1322,13 @@ static void sun4d_hw_init(const struct sun4d_hwdef *hwdef, ram_addr_t RAM_size, { CPUState *envs[MAX_CPUS]; unsigned int i; - void *iounits[MAX_IOUNITS], *espdma, *ledma, *nvram, *sbi; - qemu_irq *cpu_irqs[MAX_CPUS], *sbi_irq, *sbi_cpu_irq, + void *iounits[MAX_IOUNITS], *espdma, *ledma, *nvram; + qemu_irq *cpu_irqs[MAX_CPUS], sbi_irq[32], sbi_cpu_irq[MAX_CPUS], espdma_irq, ledma_irq; qemu_irq *esp_reset, *le_reset; unsigned long kernel_size; void *fw_cfg; + DeviceState *dev; /* init CPUs */ if (!cpu_model) @@ -1345,7 +1346,14 @@ static void sun4d_hw_init(const struct sun4d_hwdef *hwdef, ram_addr_t RAM_size, prom_init(hwdef->slavio_base, bios_name); - sbi = sbi_init(hwdef->sbi_base, &sbi_irq, &sbi_cpu_irq, cpu_irqs); + dev = sbi_init(hwdef->sbi_base, cpu_irqs); + + for (i = 0; i < 32; i++) { + sbi_irq[i] = qdev_get_gpio_in(dev, i); + } + for (i = 0; i < MAX_CPUS; i++) { + sbi_cpu_irq[i] = qdev_get_gpio_in(dev, 32 + i); + } for (i = 0; i < MAX_IOUNITS; i++) if (hwdef->iounit_bases[i] != (target_phys_addr_t)-1) |