Commit 35f1de319299f043132702c36ebaadfc4a15db69

Authored by ths
1 parent 451a4212

Fix GT-64xxx PCI mapping, by Aurelien Jarno.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2471 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 11 additions and 5 deletions
hw/gt64xxx.c
... ... @@ -222,18 +222,24 @@ typedef PCIHostState GT64120PCIState;
222 222 typedef struct GT64120State {
223 223 GT64120PCIState *pci;
224 224 uint32_t regs[GT_REGS];
  225 + target_phys_addr_t PCI0IO_start;
  226 + target_phys_addr_t PCI0IO_length;
225 227 } GT64120State;
226 228  
227 229 static void gt64120_pci_mapping(GT64120State *s)
228 230 {
229   - target_phys_addr_t start, length;
230   -
231 231 /* Update IO mapping */
232 232 if ((s->regs[GT_PCI0IOLD] & 0x7f) <= s->regs[GT_PCI0IOHD])
233 233 {
234   - start = s->regs[GT_PCI0IOLD] << 21;
235   - length = ((s->regs[GT_PCI0IOHD] + 1) - (s->regs[GT_PCI0IOLD] & 0x7f)) << 21;
236   - isa_mmio_init(start, length);
  234 + /* Unmap old IO address */
  235 + if (s->PCI0IO_length)
  236 + {
  237 + cpu_register_physical_memory(s->PCI0IO_start, s->PCI0IO_length, IO_MEM_UNASSIGNED);
  238 + }
  239 + /* Map new IO address */
  240 + s->PCI0IO_start = s->regs[GT_PCI0IOLD] << 21;
  241 + s->PCI0IO_length = ((s->regs[GT_PCI0IOHD] + 1) - (s->regs[GT_PCI0IOLD] & 0x7f)) << 21;
  242 + isa_mmio_init(s->PCI0IO_start, s->PCI0IO_length);
237 243 }
238 244 }
239 245  
... ...