From patchwork Thu Aug 25 20:05:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 3689 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 ACBE523F27 for ; Thu, 25 Aug 2011 20:05:21 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 5E491A1845B for ; Thu, 25 Aug 2011 20:05:21 +0000 (UTC) Received: by ywo7 with SMTP id 7so2928651ywo.11 for ; Thu, 25 Aug 2011 13:05:20 -0700 (PDT) Received: by 10.151.122.13 with SMTP id z13mr1372229ybm.269.1314302720808; Thu, 25 Aug 2011 13:05:20 -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.151.27.20 with SMTP id e20cs253335ybj; Thu, 25 Aug 2011 13:05:20 -0700 (PDT) Received: by 10.216.230.6 with SMTP id i6mr997748weq.80.1314302718596; Thu, 25 Aug 2011 13:05:18 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk [81.2.115.146]) by mx.google.com with ESMTPS id z54si1927073wec.44.2011.08.25.13.05.17 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 25 Aug 2011 13:05:18 -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 1QwgAp-0005LN-Fb; Thu, 25 Aug 2011 21:05:11 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Andrzej Zaborowski Subject: [PATCH 10/17] omap_gpmc: Calculate revision from OMAP model Date: Thu, 25 Aug 2011 21:05:04 +0100 Message-Id: <1314302711-20498-11-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1314302711-20498-1-git-send-email-peter.maydell@linaro.org> References: <1314302711-20498-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 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;