From patchwork Sun Aug 28 16:57:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 111927 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 A411BB6F71 for ; Mon, 29 Aug 2011 03:39:11 +1000 (EST) Received: from localhost ([::1]:35017 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QxigT-0000Rs-L8 for incoming@patchwork.ozlabs.org; Sun, 28 Aug 2011 12:58:09 -0400 Received: from eggs.gnu.org ([140.186.70.92]:34944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qxifp-0006id-Vg for qemu-devel@nongnu.org; Sun, 28 Aug 2011 12:57:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qxifo-0001Kk-5U for qemu-devel@nongnu.org; Sun, 28 Aug 2011 12:57:29 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:38064) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qxifn-0001HJ-PL for qemu-devel@nongnu.org; Sun, 28 Aug 2011 12:57:28 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1QxifU-00070C-Px; Sun, 28 Aug 2011 17:57:08 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Sun, 28 Aug 2011 17:57:01 +0100 Message-Id: <1314550628-26869-13-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1314550628-26869-1-git-send-email-peter.maydell@linaro.org> References: <1314550628-26869-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 Cc: "Edgar E. Iglesias" , patches@linaro.org Subject: [Qemu-devel] [PATCH v2 11/18] omap_gpmc: Calculate revision from OMAP model 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 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_gpmc.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/hw/omap_gpmc.c b/hw/omap_gpmc.c index c86e7ed..5c1365c 100644 --- a/hw/omap_gpmc.c +++ b/hw/omap_gpmc.c @@ -29,6 +29,7 @@ struct omap_gpmc_s { qemu_irq irq; MemoryRegion iomem; + uint8_t revision; uint8_t sysconfig; uint16_t irqst; uint16_t irqen; @@ -163,7 +164,7 @@ static uint64_t omap_gpmc_read(void *opaque, target_phys_addr_t addr, switch (addr) { case 0x000: /* GPMC_REVISION */ - return 0x20; + return s->revision; case 0x010: /* GPMC_SYSCONFIG */ return s->sysconfig; @@ -409,6 +410,7 @@ struct omap_gpmc_s *omap_gpmc_init(struct omap_mpu_state_s *mpu, memory_region_add_subregion(get_system_memory(), base, &s->iomem); s->irq = irq; + s->revision = cpu_class_omap3(mpu) ? 0x50 : 0x20; omap_gpmc_reset(s); return s;