From patchwork Sun Apr 28 23:02:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 16489 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 087442395E for ; Sun, 28 Apr 2013 23:03:50 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id w16sf10149898vbb.6 for ; Sun, 28 Apr 2013 16:02:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=DFsU0ixd6TnhLh0jsfo4X084/i245cTgBcKOst68K4c=; b=Dc3uZOD1Mc4mpQTuqNS13RiE+ht5w+dp9CG0A/vPsXbhj8PYa+6WWciSyN/VUJrwp7 7kAOEcPUWXd/d/vP4pYdYveUO8DsQ5t/S9aWuWLbZqy+IC/ByogyvNzHZFudhP4ZlED8 /O0WIviA4CfUfoxCWm9znO4bb++aDQghn2Aakl71ZzTLt1+PvVDUpWWGLYah+wp8rw0h 5KXDU8EAwDGpPbHhruZEDoK+YTEKxnklznVu7whdJJCP9F8sJXOYR1LAD+pUJbZJwlSr r2CD238xtVi9s3ITJgzzaib+Uqqfl1IRZHB2A8sD/UCFRZOsv5Xlvrlkl0TyydLEdpAJ 8aSA== X-Received: by 10.224.217.195 with SMTP id hn3mr38793100qab.5.1367190168886; Sun, 28 Apr 2013 16:02:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.88.6 with SMTP id bc6ls2560042qeb.85.gmail; Sun, 28 Apr 2013 16:02:48 -0700 (PDT) X-Received: by 10.220.188.70 with SMTP id cz6mr32199030vcb.20.1367190168697; Sun, 28 Apr 2013 16:02:48 -0700 (PDT) Received: from mail-ve0-x236.google.com (mail-ve0-x236.google.com [2607:f8b0:400c:c01::236]) by mx.google.com with ESMTPS id ij9si8992456vdb.4.2013.04.28.16.02.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Apr 2013 16:02:48 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::236 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::236; Received: by mail-ve0-f182.google.com with SMTP id da11so2707575veb.13 for ; Sun, 28 Apr 2013 16:02:48 -0700 (PDT) X-Received: by 10.58.144.231 with SMTP id sp7mr2125650veb.34.1367190168541; Sun, 28 Apr 2013 16:02:48 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp33807veb; Sun, 28 Apr 2013 16:02:48 -0700 (PDT) X-Received: by 10.194.59.208 with SMTP id b16mr9747589wjr.15.1367190167883; Sun, 28 Apr 2013 16:02:47 -0700 (PDT) Received: from mail-wi0-x230.google.com (mail-wi0-x230.google.com [2a00:1450:400c:c05::230]) by mx.google.com with ESMTPS id bo1si6580930wjb.60.2013.04.28.16.02.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Apr 2013 16:02:47 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::230 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=2a00:1450:400c:c05::230; Received: by mail-wi0-f176.google.com with SMTP id hj19so2197948wib.9 for ; Sun, 28 Apr 2013 16:02:47 -0700 (PDT) X-Received: by 10.180.212.46 with SMTP id nh14mr3619748wic.26.1367190167364; Sun, 28 Apr 2013 16:02:47 -0700 (PDT) Received: from belegaer.uk.xensource.com. (firewall.ctxuk.citrix.com. [46.33.159.2]) by mx.google.com with ESMTPSA id k5sm18711393wiy.5.2013.04.28.16.02.45 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Apr 2013 16:02:46 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: ian.campbell@citrix.com, patches@linaro.org, anthony.perard@citrix.com, stefano.stabellini@eu.citrix.com, Julien Grall Subject: [RFC 23/29] xen/arm: Add versatile express platform Date: Mon, 29 Apr 2013 00:02:06 +0100 Message-Id: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: X-Gm-Message-State: ALoCoQlzWKmW0Gk4h3RbdXVrj7s85mLxwA/XYDiy6uXKOP5B9wtdmY5pE1aPDmMv+FDWfVAeuvhR X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::236 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This platform contains nearly nothing specific except the reset function. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- xen/arch/arm/platforms/vexpress.c | 26 ++++++++++++++++++++++++++ xen/arch/arm/shutdown.c | 14 -------------- xen/include/asm-arm/config.h | 3 --- xen/include/asm-arm/platforms/vexpress.h | 3 +++ 4 files changed, 29 insertions(+), 17 deletions(-) diff --git a/xen/arch/arm/platforms/vexpress.c b/xen/arch/arm/platforms/vexpress.c index fd4ce74..7a9cfec 100644 --- a/xen/arch/arm/platforms/vexpress.c +++ b/xen/arch/arm/platforms/vexpress.c @@ -18,6 +18,7 @@ */ #include +#include #include #define DCC_SHIFT 26 @@ -90,6 +91,31 @@ out: return ret; } +static void vexpress_reset(void) +{ + /* Use the SP810 system controller to force a reset */ + volatile uint32_t *sp810; + set_fixmap(FIXMAP_MISC, SP810_ADDRESS >> PAGE_SHIFT, DEV_SHARED); + sp810 = ((uint32_t *) + (FIXMAP_ADDR(FIXMAP_MISC) + (SP810_ADDRESS & ~PAGE_MASK))); + sp810[0] = 0x3; /* switch to slow mode */ + dsb(); isb(); + sp810[1] = 0x1; /* writing any value to SCSYSSTAT reg will reset system */ + dsb(); isb(); + clear_fixmap(FIXMAP_MISC); +} + +static const char const *vexpress_dt_compat[] __initdata = +{ + "arm,vexpress", + NULL +}; + +PLATFORM_START(vexpress, "VERSATILE EXPRESS") + .compatible = vexpress_dt_compat, + .reset = vexpress_reset, +PLATFORM_END + /* * Local variables: * mode: C diff --git a/xen/arch/arm/shutdown.c b/xen/arch/arm/shutdown.c index a5c2085..cf42902 100644 --- a/xen/arch/arm/shutdown.c +++ b/xen/arch/arm/shutdown.c @@ -3,25 +3,11 @@ #include #include #include -#include #include #include static void raw_machine_reset(void) { - /* XXX get this from device tree */ -#ifdef SP810_ADDRESS - /* Use the SP810 system controller to force a reset */ - volatile uint32_t *sp810; - set_fixmap(FIXMAP_MISC, SP810_ADDRESS >> PAGE_SHIFT, DEV_SHARED); - sp810 = ((uint32_t *) - (FIXMAP_ADDR(FIXMAP_MISC) + (SP810_ADDRESS & ~PAGE_MASK))); - sp810[0] = 0x3; /* switch to slow mode */ - dsb(); isb(); - sp810[1] = 0x1; /* writing any value to SCSYSSTAT reg will reset system */ - dsb(); isb(); - clear_fixmap(FIXMAP_MISC); -#endif platform_reset(); } diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h index e49aac1..1f327c7 100644 --- a/xen/include/asm-arm/config.h +++ b/xen/include/asm-arm/config.h @@ -149,9 +149,6 @@ extern unsigned long frametable_virt_end; #define GIC_CR_OFFSET 0x2000 #define GIC_HR_OFFSET 0x4000 /* Guess work http://lists.infradead.org/pipermail/linux-arm-kernel/2011-September/064219.html */ #define GIC_VR_OFFSET 0x6000 /* Virtual Machine CPU interface) */ -/* Board-specific: base address of system controller */ -#define SP810_ADDRESS 0x1C020000 - #endif /* __ARM_CONFIG_H__ */ /* diff --git a/xen/include/asm-arm/platforms/vexpress.h b/xen/include/asm-arm/platforms/vexpress.h index 67f8fef..5cf3aba 100644 --- a/xen/include/asm-arm/platforms/vexpress.h +++ b/xen/include/asm-arm/platforms/vexpress.h @@ -23,6 +23,9 @@ #define V2M_SYS_CFG_OSC4 4 #define V2M_SYS_CFG_OSC5 5 +/* Board-specific: base address of system controller */ +#define SP810_ADDRESS 0x1C020000 + #ifndef __ASSEMBLY__ #include