void omap_tap_init(struct omap_target_agent_s *ta, struct omap_mpu_state_s *mpu) { memory_region_init_io(&mpu->tap_iomem, &omap_tap_ops, mpu, "omap.tap", omap_l4_region_size(ta, 0)); omap_l4_attach(ta, 0, &mpu->tap_iomem); }
struct omap_target_agent_s *omap2_l4ta_init(struct omap_l4_s *bus, const struct omap_l4_region_s *regions, const struct omap2_l4_agent_info_s *agents, int cs) { int i; struct omap_target_agent_s *ta = NULL; const struct omap2_l4_agent_info_s *info = NULL; for (i = 0; i < bus->ta_num; i ++) if (agents[i].ta == cs) { ta = &bus->ta[i]; info = &agents[i]; break; } if (!ta) { fprintf(stderr, "%s: bad target agent (%i)\n", __FUNCTION__, cs); exit(-1); } ta->bus = bus; ta->start = ®ions[info->region]; ta->regions = info->regions; ta->component = ('Q' << 24) | ('E' << 16) | ('M' << 8) | ('U' << 0); ta->status = 0x00000000; ta->control = 0x00000200; /* XXX 01000200 for L4TAO */ memory_region_init_io(&ta->iomem, NULL, &omap_l4ta_ops, ta, "omap.l4ta", omap_l4_region_size(ta, info->ta_region)); omap_l4_attach(ta, info->ta_region, &ta->iomem); return ta; }
struct omap_target_agent_s *omap3_l4ta_init( struct omap_l4_s *bus, const struct omap_l4_region_s *regions, const struct omap3_l4_agent_info_s *agents, int cs) { #if defined(L4_MUX_HACK) || !defined(OMAP3_REDUCE_IOREGIONS) int iomemtype; #endif int i; struct omap_target_agent_s *ta = NULL; const struct omap3_l4_agent_info_s *info = NULL; for (i = 0; i < bus->ta_num; i++) if (agents[i].agent_id == cs) { ta = &bus->ta[i]; info = &agents[i]; break; } if (!ta) { hw_error("%s: invalid agent id (%i)", __FUNCTION__, cs); } if (ta->bus) { hw_error("%s: target agent (%d) already initialized", __FUNCTION__, cs); } ta->bus = bus; ta->start = ®ions[info->first_region_id]; ta->regions = info->region_count; ta->component = ('Q' << 24) | ('E' << 16) | ('M' << 8) | ('U' << 0); ta->status = 0x00000000; ta->control = 0x00000200; for (i = 0; i < info->region_count; i++) if (regions[info->first_region_id + i].access == L4TYPE_TA) break; if (i >= info->region_count) { hw_error("%s: specified agent (%d) has no TA region", __FUNCTION__, cs); } #if defined(L4_MUX_HACK) || !defined(OMAP3_REDUCE_IOREGIONS) iomemtype = l4_register_io_memory(0, omap3_l4ta_readfn, omap3_l4ta_writefn, ta); ta->base = omap_l4_attach(ta, i, iomemtype); register_savevm("omap3_l4ta", ta->base >> 8, 0, omap3_l4ta_save_state, omap3_l4ta_load_state, ta); #else ta->base = ta->bus->base + ta->start[i].offset; #endif return ta; }
struct omap_synctimer_s *omap_synctimer_init(struct omap_target_agent_s *ta, struct omap_mpu_state_s *mpu, omap_clk fclk, omap_clk iclk) { struct omap_synctimer_s *s = g_malloc0(sizeof(*s)); omap_synctimer_reset(s); omap_l4_attach(ta, 0, l4_register_io_memory( omap_synctimer_readfn, omap_synctimer_writefn, s)); return s; }
struct omap_synctimer_s *omap_synctimer_init(struct omap_target_agent_s *ta, struct omap_mpu_state_s *mpu, omap_clk fclk, omap_clk iclk) { struct omap_synctimer_s *s = g_malloc0(sizeof(*s)); omap_synctimer_reset(s); memory_region_init_io(&s->iomem, NULL, &omap_synctimer_ops, s, "omap.synctimer", omap_l4_region_size(ta, 0)); omap_l4_attach(ta, 0, &s->iomem); return s; }
struct omap_uart_s *omap2_uart_init(struct omap_target_agent_s *ta, qemu_irq irq, omap_clk fclk, omap_clk iclk, qemu_irq txdma, qemu_irq rxdma, CharDriverState *chr) { target_phys_addr_t base = omap_l4_attach(ta, 0, 0); struct omap_uart_s *s = omap_uart_init(base, irq, fclk, iclk, txdma, rxdma, chr); int iomemtype = cpu_register_io_memory(omap_uart_readfn, omap_uart_writefn, s); s->ta = ta; cpu_register_physical_memory(base + 0x20, 0x100, iomemtype); return s; }
struct omap_uart_s *omap2_uart_init(MemoryRegion *sysmem, struct omap_target_agent_s *ta, qemu_irq irq, omap_clk fclk, omap_clk iclk, qemu_irq txdma, qemu_irq rxdma, const char *label, CharDriverState *chr) { hwaddr base = omap_l4_attach(ta, 0, NULL); struct omap_uart_s *s = omap_uart_init(base, irq, fclk, iclk, txdma, rxdma, label, chr); memory_region_init_io(&s->iomem, &omap_uart_ops, s, "omap.uart", 0x100); s->ta = ta; memory_region_add_subregion(sysmem, base + 0x20, &s->iomem); return s; }
struct omap_target_agent_s *omap2_l4ta_init( struct omap_l4_s *bus, const struct omap_l4_region_s *regions, const struct omap2_l4_agent_info_s *agents, int cs) { int i, iomemtype; struct omap_target_agent_s *ta = NULL; const struct omap2_l4_agent_info_s *info = NULL; for (i = 0; i < bus->ta_num; i ++) { if (agents[i].ta == cs) { ta = &bus->ta[i]; info = &agents[i]; break; } } if (!ta) { fprintf(stderr, "%s: bad target agent (%i)\n", __FUNCTION__, cs); exit(-1); } ta->bus = bus; ta->start = ®ions[info->region]; ta->regions = info->regions; ta->component = ('Q' << 24) | ('E' << 16) | ('M' << 8) | ('U' << 0); ta->status = 0x00000000; ta->control = 0x00000200; /* XXX 01000200 for L4TAO */ iomemtype = l4_register_io_memory(omap2_l4ta_readfn, omap2_l4ta_writefn, ta); ta->base = omap_l4_attach(ta, info->ta_region, iomemtype); return ta; }
void omap_tap_init(struct omap_target_agent_s *ta, struct omap_mpu_state_s *mpu) { omap_l4_attach(ta, 0, l4_register_io_memory( omap_tap_readfn, omap_tap_writefn, mpu)); }