From patchwork Wed Jun 29 18:53:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 2373 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 9E18D23F08 for ; Wed, 29 Jun 2011 18:53:17 +0000 (UTC) Received: from mail-qw0-f52.google.com (mail-qw0-f52.google.com [209.85.216.52]) by fiordland.canonical.com (Postfix) with ESMTP id 61BECA1803B for ; Wed, 29 Jun 2011 18:53:17 +0000 (UTC) Received: by qwb8 with SMTP id 8so1080376qwb.11 for ; Wed, 29 Jun 2011 11:53:16 -0700 (PDT) Received: by 10.229.102.98 with SMTP id f34mr903214qco.42.1309373596749; Wed, 29 Jun 2011 11:53:16 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.48.135 with SMTP id r7cs50089qcf; Wed, 29 Jun 2011 11:53:16 -0700 (PDT) Received: by 10.227.55.67 with SMTP id t3mr987772wbg.90.1309373595168; Wed, 29 Jun 2011 11:53:15 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk [81.2.115.146]) by mx.google.com with ESMTPS id ff9si3103610wbb.122.2011.06.29.11.53.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 29 Jun 2011 11:53:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1Qbzst-0007uT-TQ; Wed, 29 Jun 2011 19:53:11 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Riku Voipio , =?UTF-8?q?Juha=20Riihim=C3=A4ki?= Subject: [PATCH 1/3] hw/omap_l4.c: Add helper function omap_l4_base Date: Wed, 29 Jun 2011 19:53:09 +0100 Message-Id: <1309373591-30380-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1309373591-30380-1-git-send-email-peter.maydell@linaro.org> References: <1309373591-30380-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 From: Juha Riihimäki Add helper function omap_l4_base() to return the base address of a particular region of an L4 target agent. Signed-off-by: Juha Riihimäki [Riku Voipio: Fixes and restructuring patchset] Signed-off-by: Riku Voipio [Peter Maydell: More fixes and cleanups for upstream submission] Signed-off-by: Peter Maydell --- hw/omap.h | 1 + hw/omap_l4.c | 5 +++++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/hw/omap.h b/hw/omap.h index c227a82..339cc00 100644 --- a/hw/omap.h +++ b/hw/omap.h @@ -93,6 +93,7 @@ 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_base(struct omap_target_agent_s *ta, int region); int l4_register_io_memory(CPUReadMemoryFunc * const *mem_read, CPUWriteMemoryFunc * const *mem_write, void *opaque); diff --git a/hw/omap_l4.c b/hw/omap_l4.c index 4af0ca8..8ab811d 100644 --- a/hw/omap_l4.c +++ b/hw/omap_l4.c @@ -146,6 +146,11 @@ struct omap_l4_s *omap_l4_init(target_phys_addr_t base, int ta_num) return bus; } +target_phys_addr_t omap_l4_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;