diff options
author | Paul Brook <paul@codesourcery.com> | 2009-05-14 22:35:07 +0100 |
---|---|---|
committer | Paul Brook <paul@codesourcery.com> | 2009-05-14 22:35:07 +0100 |
commit | b3816c298655ec7bdbc5650ee8dde88c4b0003f7 (patch) | |
tree | 082fc9ead002d62b270d240f4f1eecb25c5572c1 /hw/sun4m.c | |
parent | 1fb605c85328f7ce8af87e18abf0057dc27ce2e9 (diff) | |
download | qemu-b3816c298655ec7bdbc5650ee8dde88c4b0003f7.tar.gz qemu-b3816c298655ec7bdbc5650ee8dde88c4b0003f7.tar.bz2 qemu-b3816c298655ec7bdbc5650ee8dde88c4b0003f7.zip |
ESP SCSI qdev conversion
Signed-off-by: Paul Brook <paul@codesourcery.com>
Diffstat (limited to 'hw/sun4m.c')
-rw-r--r-- | hw/sun4m.c | 47 |
1 files changed, 12 insertions, 35 deletions
diff --git a/hw/sun4m.c b/hw/sun4m.c index 28491104f9..ec933786ef 100644 --- a/hw/sun4m.c +++ b/hw/sun4m.c @@ -391,7 +391,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size, { CPUState *env, *envs[MAX_CPUS]; unsigned int i; - void *iommu, *espdma, *ledma, *main_esp, *nvram; + void *iommu, *espdma, *ledma, *nvram; qemu_irq *cpu_irqs[MAX_CPUS], *slavio_irq, *slavio_cpu_irq, *espdma_irq, *ledma_irq; qemu_irq *esp_reset, *le_reset; @@ -533,16 +533,9 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size, exit(1); } - main_esp = esp_init(hwdef->esp_base, 2, - espdma_memory_read, espdma_memory_write, - espdma, *espdma_irq, esp_reset); - - for (i = 0; i < ESP_MAX_DEVS; i++) { - drive_index = drive_get_index(IF_SCSI, 0, i); - if (drive_index == -1) - continue; - esp_scsi_attach(main_esp, drives_table[drive_index].bdrv, i); - } + esp_init(hwdef->esp_base, 2, + espdma_memory_read, espdma_memory_write, + espdma, *espdma_irq, esp_reset); if (hwdef->cs_base) cs_init(hwdef->cs_base, hwdef->cs_irq, slavio_intctl); @@ -1184,7 +1177,7 @@ static void sun4d_hw_init(const struct sun4d_hwdef *hwdef, ram_addr_t RAM_size, { CPUState *env, *envs[MAX_CPUS]; unsigned int i; - void *iounits[MAX_IOUNITS], *espdma, *ledma, *main_esp, *nvram, *sbi; + void *iounits[MAX_IOUNITS], *espdma, *ledma, *nvram, *sbi; qemu_irq *cpu_irqs[MAX_CPUS], *sbi_irq, *sbi_cpu_irq, *espdma_irq, *ledma_irq; qemu_irq *esp_reset, *le_reset; @@ -1192,7 +1185,6 @@ static void sun4d_hw_init(const struct sun4d_hwdef *hwdef, ram_addr_t RAM_size, unsigned long kernel_size; int ret; char buf[1024]; - int drive_index; void *fw_cfg; /* init CPUs */ @@ -1292,16 +1284,9 @@ static void sun4d_hw_init(const struct sun4d_hwdef *hwdef, ram_addr_t RAM_size, exit(1); } - main_esp = esp_init(hwdef->esp_base, 2, - espdma_memory_read, espdma_memory_write, - espdma, *espdma_irq, esp_reset); - - for (i = 0; i < ESP_MAX_DEVS; i++) { - drive_index = drive_get_index(IF_SCSI, 0, i); - if (drive_index == -1) - continue; - esp_scsi_attach(main_esp, drives_table[drive_index].bdrv, i); - } + esp_init(hwdef->esp_base, 2, + espdma_memory_read, espdma_memory_write, + espdma, *espdma_irq, esp_reset); kernel_size = sun4m_load_kernel(kernel_filename, initrd_filename, RAM_size); @@ -1406,8 +1391,7 @@ static void sun4c_hw_init(const struct sun4c_hwdef *hwdef, ram_addr_t RAM_size, const char *initrd_filename, const char *cpu_model) { CPUState *env; - unsigned int i; - void *iommu, *espdma, *ledma, *main_esp, *nvram; + void *iommu, *espdma, *ledma, *nvram; qemu_irq *cpu_irqs, *slavio_irq, *espdma_irq, *ledma_irq; qemu_irq *esp_reset, *le_reset; qemu_irq *fdc_tc; @@ -1518,16 +1502,9 @@ static void sun4c_hw_init(const struct sun4c_hwdef *hwdef, ram_addr_t RAM_size, exit(1); } - main_esp = esp_init(hwdef->esp_base, 2, - espdma_memory_read, espdma_memory_write, - espdma, *espdma_irq, esp_reset); - - for (i = 0; i < ESP_MAX_DEVS; i++) { - drive_index = drive_get_index(IF_SCSI, 0, i); - if (drive_index == -1) - continue; - esp_scsi_attach(main_esp, drives_table[drive_index].bdrv, i); - } + esp_init(hwdef->esp_base, 2, + espdma_memory_read, espdma_memory_write, + espdma, *espdma_irq, esp_reset); kernel_size = sun4m_load_kernel(kernel_filename, initrd_filename, RAM_size); |