struct pxa2xx_pcmcia_s {
struct pcmcia_socket_s slot;
struct pcmcia_card_s *card;
- target_phys_addr_t common_base;
- target_phys_addr_t attr_base;
- target_phys_addr_t io_base;
qemu_irq irq;
qemu_irq cd_irq;
struct pxa2xx_pcmcia_s *s = (struct pxa2xx_pcmcia_s *) opaque;
if (s->slot.attached) {
- offset -= s->common_base;
return s->card->common_read(s->card->state, offset);
}
struct pxa2xx_pcmcia_s *s = (struct pxa2xx_pcmcia_s *) opaque;
if (s->slot.attached) {
- offset -= s->common_base;
s->card->common_write(s->card->state, offset, value);
}
}
struct pxa2xx_pcmcia_s *s = (struct pxa2xx_pcmcia_s *) opaque;
if (s->slot.attached) {
- offset -= s->attr_base;
return s->card->attr_read(s->card->state, offset);
}
struct pxa2xx_pcmcia_s *s = (struct pxa2xx_pcmcia_s *) opaque;
if (s->slot.attached) {
- offset -= s->attr_base;
s->card->attr_write(s->card->state, offset, value);
}
}
struct pxa2xx_pcmcia_s *s = (struct pxa2xx_pcmcia_s *) opaque;
if (s->slot.attached) {
- offset -= s->io_base;
return s->card->io_read(s->card->state, offset);
}
struct pxa2xx_pcmcia_s *s = (struct pxa2xx_pcmcia_s *) opaque;
if (s->slot.attached) {
- offset -= s->io_base;
s->card->io_write(s->card->state, offset, value);
}
}
qemu_mallocz(sizeof(struct pxa2xx_pcmcia_s));
/* Socket I/O Memory Space */
- s->io_base = base | 0x00000000;
iomemtype = cpu_register_io_memory(0, pxa2xx_pcmcia_io_readfn,
pxa2xx_pcmcia_io_writefn, s);
- cpu_register_physical_memory(s->io_base, 0x04000000, iomemtype);
+ cpu_register_physical_memory(base | 0x00000000, 0x04000000, iomemtype);
/* Then next 64 MB is reserved */
/* Socket Attribute Memory Space */
- s->attr_base = base | 0x08000000;
iomemtype = cpu_register_io_memory(0, pxa2xx_pcmcia_attr_readfn,
pxa2xx_pcmcia_attr_writefn, s);
- cpu_register_physical_memory(s->attr_base, 0x04000000, iomemtype);
+ cpu_register_physical_memory(base | 0x08000000, 0x04000000, iomemtype);
/* Socket Common Memory Space */
- s->common_base = base | 0x0c000000;
iomemtype = cpu_register_io_memory(0, pxa2xx_pcmcia_common_readfn,
pxa2xx_pcmcia_common_writefn, s);
- cpu_register_physical_memory(s->common_base, 0x04000000, iomemtype);
+ cpu_register_physical_memory(base | 0x0c000000, 0x04000000, iomemtype);
if (base == 0x30000000)
s->slot.slot_string = "PXA PC Card Socket 1";