From patchwork Fri Jul 29 15:35:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 107418 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 42015B6F57 for ; Sat, 30 Jul 2011 02:14:51 +1000 (EST) Received: from localhost ([::1]:35180 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qmp6j-0001Rl-Im for incoming@patchwork.ozlabs.org; Fri, 29 Jul 2011 11:36:13 -0400 Received: from eggs.gnu.org ([140.186.70.92]:47810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qmp6E-0008BE-AQ for qemu-devel@nongnu.org; Fri, 29 Jul 2011 11:35:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qmp6C-00023A-FI for qemu-devel@nongnu.org; Fri, 29 Jul 2011 11:35:42 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:36200) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qmp6C-0001zI-4A for qemu-devel@nongnu.org; Fri, 29 Jul 2011 11:35:40 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1Qmp60-0007ZZ-2L; Fri, 29 Jul 2011 16:35:28 +0100 From: Peter Maydell To: qemu-devel@nongnu.org, Anthony Liguori Date: Fri, 29 Jul 2011 16:35:14 +0100 Message-Id: <1311953728-29084-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1311953728-29084-1-git-send-email-peter.maydell@linaro.org> References: <1311953728-29084-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Subject: [Qemu-devel] [PATCH 01/15] hw/omap_l4.c: Add helper function omap_l4_region_base X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Juha Riihimäki 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 [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 | 2 ++ hw/omap_l4.c | 6 ++++++ 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/hw/omap.h b/hw/omap.h index c227a82..00a0ea9 100644 --- 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); diff --git a/hw/omap_l4.c b/hw/omap_l4.c index 4af0ca8..59c84b1 100644 --- a/hw/omap_l4.c +++ b/hw/omap_l4.c @@ -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;