hw/omap_l4.c: Add helper function omap_l4_region_base
authorJuha Riihimäki <juha.riihimaki@nokia.com>
Fri, 29 Jul 2011 15:35:14 +0000 (16:35 +0100)
committerAndrzej Zaborowski <andrew.zaborowski@intel.com>
Sat, 30 Jul 2011 04:00:33 +0000 (06:00 +0200)
Add helper function omap_l4_region_base() to return the base address
of a particular region of an L4 target agent.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
hw/omap.h
hw/omap_l4.c

index c227a82b2c12dac21854f01c1cdf78997ef0d1e9..00a0ea9042b13129f356162d442ebc80b6cac11e 100644 (file)
--- a/hw/omap.h
+++ b/hw/omap.h
@@ -93,6 +93,8 @@ struct omap_target_agent_s *omap_l4ta_get(
     int cs);
 target_phys_addr_t omap_l4_attach(struct omap_target_agent_s *ta, int region,
                 int iotype);
+target_phys_addr_t omap_l4_region_base(struct omap_target_agent_s *ta,
+                                       int region);
 int l4_register_io_memory(CPUReadMemoryFunc * const *mem_read,
                 CPUWriteMemoryFunc * const *mem_write, void *opaque);
 
index 4af0ca8ea611549151f61dfd686ec680d820f47e..59c84b19a2369a6ea5ba5c5315ea3508c0ff5d9a 100644 (file)
@@ -146,6 +146,12 @@ struct omap_l4_s *omap_l4_init(target_phys_addr_t base, int ta_num)
     return bus;
 }
 
+target_phys_addr_t omap_l4_region_base(struct omap_target_agent_s *ta,
+                                       int region)
+{
+    return ta->bus->base + ta->start[region].offset;
+}
+
 static uint32_t omap_l4ta_read(void *opaque, target_phys_addr_t addr)
 {
     struct omap_target_agent_s *s = (struct omap_target_agent_s *) opaque;