From patchwork Wed May 8 02:33:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 16760 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f70.google.com (mail-qe0-f70.google.com [209.85.128.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9D98A25E02 for ; Wed, 8 May 2013 02:35:25 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id b10sf1777425qen.1 for ; Tue, 07 May 2013 19:35:05 -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=99NnBmfpIiejMU4N7GxSS0KzCoUbmsv2y/EY31/9UiI=; b=P1WOjm4e4EIEquMryPUmlH0nD0wbh9PittnF4PEV/bh+skDIlgR1ZIUiETz2FidZS5 5903nH+RJJl+2Jl7nK+IcLOyEzE+LYjnKUaB0IQPBiXGLlIR7FQEwCp4fAY3P0wgVyuF THCGEVd7m/fSw+yAUhfOnlIMjEoapduqfJTN4mJ3kjKcoF4DDMiy/1fH35tifX8hMFEX 8WKTggxEJ851d2JfkcmlNcR2sTK0y5eGdWurfKGLY6zAFVJt8TYoTXweyJbXpdIJSrlz llTYK4oZrnT4GvNxLp07xQluxCITM9bPt7v2gG+L1HvGGjgWnDfRJ+AsbdP2zyeSk5NK n9NA== X-Received: by 10.224.165.130 with SMTP id i2mr6520104qay.2.1367980505437; Tue, 07 May 2013 19:35:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.121.5 with SMTP id lg5ls665548qeb.21.gmail; Tue, 07 May 2013 19:35:05 -0700 (PDT) X-Received: by 10.52.22.4 with SMTP id z4mr2766181vde.53.1367980505203; Tue, 07 May 2013 19:35:05 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id sc6si14145273vdc.73.2013.05.07.19.35.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 May 2013 19:35:05 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lf10so1241134vcb.34 for ; Tue, 07 May 2013 19:35:05 -0700 (PDT) X-Received: by 10.52.69.109 with SMTP id d13mr2689973vdu.75.1367980505096; Tue, 07 May 2013 19:35:05 -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 nf2csp131027veb; Tue, 7 May 2013 19:35:04 -0700 (PDT) X-Received: by 10.180.160.200 with SMTP id xm8mr6936832wib.23.1367980503999; Tue, 07 May 2013 19:35:03 -0700 (PDT) Received: from mail-wg0-x235.google.com (mail-wg0-x235.google.com [2a00:1450:400c:c00::235]) by mx.google.com with ESMTPS id va9si8828116wjc.191.2013.05.07.19.35.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 May 2013 19:35:03 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::235 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=2a00:1450:400c:c00::235; Received: by mail-wg0-f53.google.com with SMTP id y10so1376092wgg.20 for ; Tue, 07 May 2013 19:35:03 -0700 (PDT) X-Received: by 10.180.183.139 with SMTP id em11mr18454752wic.16.1367980503526; Tue, 07 May 2013 19:35:03 -0700 (PDT) Received: from belegaer.uk.xensource.com. (firewall.ctxuk.citrix.com. [46.33.159.2]) by mx.google.com with ESMTPSA id v6sm6823630wiy.11.2013.05.07.19.35.02 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 May 2013 19:35:02 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: Stefano.Stabellini@eu.citrix.com, patches@linaro.org, ian.campbell@citrix.com, Julien Grall Subject: [PATCH V2 25/33] xen/arm: Add versatile express platform Date: Wed, 8 May 2013 03:33:45 +0100 Message-Id: <583cc7bdcb108ede5132bc45075ad9bb58dd7327.1367979526.git.julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: X-Gm-Message-State: ALoCoQkIhEKh8YkV3oelG/DRIR8jiuMNGBVNjCImRc2/PuLClpf17r2ucE2O/9KTqtFG1Pb+VtZ3 X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.175 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 Changes in v2: - Add TODO to retrieve reset base address in the DT --- xen/arch/arm/platforms/vexpress.c | 30 ++++++++++++++++++++++++++++++ xen/arch/arm/shutdown.c | 14 -------------- xen/include/asm-arm/config.h | 3 --- xen/include/asm-arm/platforms/vexpress.h | 3 +++ 4 files changed, 33 insertions(+), 17 deletions(-) diff --git a/xen/arch/arm/platforms/vexpress.c b/xen/arch/arm/platforms/vexpress.c index fd4ce74..c51abf2 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 @@ -91,6 +92,35 @@ out: } /* + * TODO: Get base address from the device tree + * See arm,vexpress-reset node + */ +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 * c-file-style: "BSD" diff --git a/xen/arch/arm/shutdown.c b/xen/arch/arm/shutdown.c index 0903842..767cc12 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 8ed72f5..7599202 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