Commit e42c20b41a698ceb51f90afb25f1062b333b1913

Authored by blueswir1
1 parent a4fc08ff

Give ECC controller an IRQ (Robert Reif)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3923 c046a42c-6fe2-441c-8c8c-71466251a162
hw/eccmemctl.c
@@ -68,7 +68,7 @@ @@ -68,7 +68,7 @@
68 #define ECC_FAR0_TYPE 0x000000f0 /* Transaction type */ 68 #define ECC_FAR0_TYPE 0x000000f0 /* Transaction type */
69 #define ECC_FAR0_SIZE 0x00000700 /* Transaction size */ 69 #define ECC_FAR0_SIZE 0x00000700 /* Transaction size */
70 #define ECC_FAR0_CACHE 0x00000800 /* Mapped cacheable */ 70 #define ECC_FAR0_CACHE 0x00000800 /* Mapped cacheable */
71 -#define ECC_FAR0_LOCK 0x00001000 /* Error occurred in attomic cycle */ 71 +#define ECC_FAR0_LOCK 0x00001000 /* Error occurred in atomic cycle */
72 #define ECC_FAR0_BMODE 0x00002000 /* Boot mode */ 72 #define ECC_FAR0_BMODE 0x00002000 /* Boot mode */
73 #define ECC_FAR0_VADDR 0x003fc000 /* VA[12-19] (superset bits) */ 73 #define ECC_FAR0_VADDR 0x003fc000 /* VA[12-19] (superset bits) */
74 #define ECC_FAR0_S 0x08000000 /* Supervisor mode */ 74 #define ECC_FAR0_S 0x08000000 /* Supervisor mode */
@@ -90,6 +90,7 @@ @@ -90,6 +90,7 @@
90 #define ECC_ADDR_MASK (ECC_SIZE - 1) 90 #define ECC_ADDR_MASK (ECC_SIZE - 1)
91 91
92 typedef struct ECCState { 92 typedef struct ECCState {
  93 + qemu_irq irq;
93 uint32_t regs[ECC_NREGS]; 94 uint32_t regs[ECC_NREGS];
94 } ECCState; 95 } ECCState;
95 96
@@ -222,7 +223,7 @@ static void ecc_reset(void *opaque) @@ -222,7 +223,7 @@ static void ecc_reset(void *opaque)
222 s->regs[i] = 0; 223 s->regs[i] = 0;
223 } 224 }
224 225
225 -void * ecc_init(target_phys_addr_t base, uint32_t version) 226 +void * ecc_init(target_phys_addr_t base, qemu_irq irq, uint32_t version)
226 { 227 {
227 int ecc_io_memory; 228 int ecc_io_memory;
228 ECCState *s; 229 ECCState *s;
@@ -232,6 +233,7 @@ void * ecc_init(target_phys_addr_t base, uint32_t version) @@ -232,6 +233,7 @@ void * ecc_init(target_phys_addr_t base, uint32_t version)
232 return NULL; 233 return NULL;
233 234
234 s->regs[0] = version; 235 s->regs[0] = version;
  236 + s->irq = irq;
235 237
236 ecc_io_memory = cpu_register_io_memory(0, ecc_mem_read, ecc_mem_write, s); 238 ecc_io_memory = cpu_register_io_memory(0, ecc_mem_read, ecc_mem_write, s);
237 cpu_register_physical_memory(base, ECC_SIZE, ecc_io_memory); 239 cpu_register_physical_memory(base, ECC_SIZE, ecc_io_memory);
hw/sun4m.c
@@ -91,7 +91,7 @@ struct hwdef { @@ -91,7 +91,7 @@ struct hwdef {
91 // IRQ numbers are not PIL ones, but master interrupt controller 91 // IRQ numbers are not PIL ones, but master interrupt controller
92 // register bit numbers 92 // register bit numbers
93 int intctl_g_intr, esp_irq, le_irq, clock_irq, clock1_irq; 93 int intctl_g_intr, esp_irq, le_irq, clock_irq, clock1_irq;
94 - int ser_irq, ms_kb_irq, fd_irq, me_irq, cs_irq; 94 + int ser_irq, ms_kb_irq, fd_irq, me_irq, cs_irq, ecc_irq;
95 int machine_id; // For NVRAM 95 int machine_id; // For NVRAM
96 uint32_t iommu_version; 96 uint32_t iommu_version;
97 uint32_t intbit_to_level[32]; 97 uint32_t intbit_to_level[32];
@@ -528,7 +528,8 @@ static void sun4m_hw_init(const struct hwdef *hwdef, int RAM_size, @@ -528,7 +528,8 @@ static void sun4m_hw_init(const struct hwdef *hwdef, int RAM_size,
528 graphic_height, graphic_depth, hwdef->machine_id, "Sun4m"); 528 graphic_height, graphic_depth, hwdef->machine_id, "Sun4m");
529 529
530 if (hwdef->ecc_base != (target_phys_addr_t)-1) 530 if (hwdef->ecc_base != (target_phys_addr_t)-1)
531 - ecc_init(hwdef->ecc_base, hwdef->ecc_version); 531 + ecc_init(hwdef->ecc_base, slavio_irq[hwdef->ecc_irq],
  532 + hwdef->ecc_version);
532 } 533 }
533 534
534 static void sun4c_hw_init(const struct hwdef *hwdef, int RAM_size, 535 static void sun4c_hw_init(const struct hwdef *hwdef, int RAM_size,
@@ -742,6 +743,7 @@ static const struct hwdef hwdefs[] = { @@ -742,6 +743,7 @@ static const struct hwdef hwdefs[] = {
742 .fd_irq = 22, 743 .fd_irq = 22,
743 .me_irq = 30, 744 .me_irq = 30,
744 .cs_irq = -1, 745 .cs_irq = -1,
  746 + .ecc_irq = 28,
745 .machine_id = 0x72, 747 .machine_id = 0x72,
746 .iommu_version = 0x03000000, 748 .iommu_version = 0x03000000,
747 .intbit_to_level = { 749 .intbit_to_level = {
@@ -783,6 +785,7 @@ static const struct hwdef hwdefs[] = { @@ -783,6 +785,7 @@ static const struct hwdef hwdefs[] = {
783 .fd_irq = 22, 785 .fd_irq = 22,
784 .me_irq = 30, 786 .me_irq = 30,
785 .cs_irq = -1, 787 .cs_irq = -1,
  788 + .ecc_irq = 28,
786 .machine_id = 0x71, 789 .machine_id = 0x71,
787 .iommu_version = 0x01000000, 790 .iommu_version = 0x01000000,
788 .intbit_to_level = { 791 .intbit_to_level = {
@@ -824,6 +827,7 @@ static const struct hwdef hwdefs[] = { @@ -824,6 +827,7 @@ static const struct hwdef hwdefs[] = {
824 .fd_irq = 22, 827 .fd_irq = 22,
825 .me_irq = 30, 828 .me_irq = 30,
826 .cs_irq = -1, 829 .cs_irq = -1,
  830 + .ecc_irq = 28,
827 .machine_id = 0x72, 831 .machine_id = 0x72,
828 .iommu_version = 0x13000000, 832 .iommu_version = 0x13000000,
829 .intbit_to_level = { 833 .intbit_to_level = {
hw/sun4m.h
@@ -81,6 +81,6 @@ void lance_init(NICInfo *nd, target_phys_addr_t leaddr, void *dma_opaque, @@ -81,6 +81,6 @@ void lance_init(NICInfo *nd, target_phys_addr_t leaddr, void *dma_opaque,
81 qemu_irq irq, qemu_irq *reset); 81 qemu_irq irq, qemu_irq *reset);
82 82
83 /* eccmemctl.c */ 83 /* eccmemctl.c */
84 -void *ecc_init(target_phys_addr_t base, uint32_t version); 84 +void *ecc_init(target_phys_addr_t base, qemu_irq irq, uint32_t version);
85 85
86 #endif 86 #endif