From patchwork Fri Oct 3 14:16:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Suthikulpanit, Suravee" X-Patchwork-Id: 38321 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7D7F92057C for ; Fri, 3 Oct 2014 14:18:33 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id hi2sf875236wib.1 for ; Fri, 03 Oct 2014 07:18:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id :mime-version:cc:subject:precedence:list-id:list-unsubscribe :list-post:list-help:list-subscribe:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :list-archive:content-type:content-transfer-encoding; bh=hs5rB3bIzd1pmw80QRtNGgKwUfcWjq15rAx13rbmFMA=; b=CKAszU+I6lMnV+pXwFIvdl88Pm42jj0mXdWBVbkMFivGeaeDYX/UZ814e1jx3LDzuC WNIohtUia+gysEYXj7RTM4aExuY4YxTDRw9Q3TeX/36Qo0bw6a32XGIIh/jrXQERA+cO XmAHobPaWV1Z4MheWeOlOS0pn/uiNYVxp8wzl1Nn7IXFPokT39CHKiJgmLBkj2FgAXju 5xUpTKolfuXpfynJ6Z/jZ3GPAa5EKpXPhF2cKIGSKyRS4MFOoZHLClNVfJEhtYSBiCZa AR5jDfZ5ZnnLo2MXf0pj0tABy/JfDZVVkDBHvY+xvZzF4YsI67dkFA/dYodp0hAMkmBn y3Ug== X-Gm-Message-State: ALoCoQmjFyYw1CkK0cC9BgzNW3jepln4PtT+thhIhExuncbZtAVCthg8wUvB8N1zadjCuIdiIRo7 X-Received: by 10.112.137.230 with SMTP id ql6mr460662lbb.13.1412345912593; Fri, 03 Oct 2014 07:18:32 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.161.234 with SMTP id xv10ls391588lab.13.gmail; Fri, 03 Oct 2014 07:18:32 -0700 (PDT) X-Received: by 10.112.125.131 with SMTP id mq3mr2993588lbb.20.1412345912454; Fri, 03 Oct 2014 07:18:32 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com [209.85.217.178]) by mx.google.com with ESMTPS id l1si11412400lbj.70.2014.10.03.07.18.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Oct 2014 07:18:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by mail-lb0-f178.google.com with SMTP id w7so1066828lbi.23 for ; Fri, 03 Oct 2014 07:18:32 -0700 (PDT) X-Received: by 10.153.7.73 with SMTP id da9mr4904588lad.56.1412345912161; Fri, 03 Oct 2014 07:18:32 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp235058lbb; Fri, 3 Oct 2014 07:18:31 -0700 (PDT) X-Received: by 10.52.165.212 with SMTP id za20mr2070818vdb.23.1412345910812; Fri, 03 Oct 2014 07:18:30 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id op4si4503920vcb.43.2014.10.03.07.18.30 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 03 Oct 2014 07:18:30 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xa3ee-0000mF-VY; Fri, 03 Oct 2014 14:16:20 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xa3ed-0000mA-Q0 for xen-devel@lists.xen.org; Fri, 03 Oct 2014 14:16:19 +0000 Received: from [193.109.254.147:26937] by server-5.bemta-14.messagelabs.com id E5/3D-28255-3BFAE245; Fri, 03 Oct 2014 14:16:19 +0000 X-Env-Sender: Suravee.Suthikulpanit@amd.com X-Msg-Ref: server-4.tower-27.messagelabs.com!1412345777!13254860!1 X-Originating-IP: [157.56.110.141] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.12.2; banners=-,-,- X-VirusChecked: Checked Received: (qmail 5649 invoked from network); 3 Oct 2014 14:16:18 -0000 Received: from mail-bn1on0141.outbound.protection.outlook.com (HELO na01-bn1-obe.outbound.protection.outlook.com) (157.56.110.141) by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP; 3 Oct 2014 14:16:18 -0000 Received: from BY2PR02CA0045.namprd02.prod.outlook.com (10.141.216.35) by BN1PR02MB197.namprd02.prod.outlook.com (10.242.214.146) with Microsoft SMTP Server (TLS) id 15.0.1044.10; Fri, 3 Oct 2014 14:16:14 +0000 Received: from BL2FFO11FD017.protection.gbl (2a01:111:f400:7c09::166) by BY2PR02CA0045.outlook.office365.com (2a01:111:e400:2c40::35) with Microsoft SMTP Server (TLS) id 15.0.1044.10 via Frontend Transport; Fri, 3 Oct 2014 14:16:13 +0000 Received: from atltwp01.amd.com (165.204.84.221) by BL2FFO11FD017.mail.protection.outlook.com (10.173.161.35) with Microsoft SMTP Server id 15.0.1029.15 via Frontend Transport; Fri, 3 Oct 2014 14:16:13 +0000 X-WSS-ID: 0NCVGYZ-07-AEO-02 X-M-MSG: Received: from satlvexedge01.amd.com (satlvexedge01.amd.com [10.177.96.28]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by atltwp01.amd.com (Axway MailGate 5.3.1) with ESMTPS id 2F19A12C0005; Fri, 3 Oct 2014 09:16:10 -0500 (CDT) Received: from SATLEXDAG04.amd.com (10.181.40.9) by satlvexedge01.amd.com (10.177.96.28) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 3 Oct 2014 09:16:36 -0500 Received: from ssuthiku-fedora-lt.amd.com (10.180.168.240) by satlexdag04.amd.com (10.181.40.9) with Microsoft SMTP Server id 14.3.195.1; Fri, 3 Oct 2014 10:16:10 -0400 From: To: , , , Date: Fri, 3 Oct 2014 09:16:08 -0500 Message-ID: <1412345768-10812-1-git-send-email-suravee.suthikulpanit@amd.com> X-Mailer: git-send-email 1.9.3 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.221; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(428002)(199003)(189002)(104166001)(93916002)(21056001)(31966008)(77156001)(36756003)(62966002)(102836001)(87286001)(85852003)(89996001)(88136002)(87936001)(92726001)(64706001)(95666004)(84676001)(229853001)(33646002)(85306004)(53416004)(107046002)(4396001)(48376002)(19580405001)(68736004)(76482002)(101416001)(99396003)(92566001)(46102003)(2201001)(44976005)(19580395003)(86362001)(80022003)(10300001)(47776003)(97736003)(120916001)(20776003)(86152002)(77096002)(105586002)(50466002)(50986999)(106466001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN1PR02MB197; H:atltwp01.amd.com; FPR:; MLV:sfv; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BN1PR02MB197; X-Forefront-PRVS: 0353563E2B Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-OriginatorOrg: amd4.onmicrosoft.com Cc: Suravee Suthikulpanit , xen-devel@lists.xen.org Subject: [Xen-devel] [PATCH V4] amd/seattle: Initial revision of AMD Seattle support X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: suravee.suthikulpanit@amd.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: From: Suravee Suthikulpanit This patch add inital (minimal) platform support for AMD Seattle, which mainly just define the matching ID, and specify system_off, and system_reset mechanism. Initially, the firmware only support a subset of PSCI-0.2 functions, system-off and sytem-reset. The mechanism for bring up auxiliary processors is still using spin-table. Signed-off-by: Suravee Suthikulpanit Reviewed-by: Julien Grall --- Changes in V4: * Add the dom0_gnttab_start and dom0_gnttab_size (per Julien suggestions) xen/arch/arm/platforms/Makefile | 1 + xen/arch/arm/platforms/seattle.c | 68 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 xen/arch/arm/platforms/seattle.c diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile index 680364f..e1fde6e 100644 --- a/xen/arch/arm/platforms/Makefile +++ b/xen/arch/arm/platforms/Makefile @@ -3,4 +3,5 @@ obj-$(CONFIG_ARM_32) += exynos5.o obj-$(CONFIG_ARM_32) += midway.o obj-$(CONFIG_ARM_32) += omap5.o obj-$(CONFIG_ARM_32) += sunxi.o +obj-$(CONFIG_ARM_64) += seattle.o obj-$(CONFIG_ARM_64) += xgene-storm.o diff --git a/xen/arch/arm/platforms/seattle.c b/xen/arch/arm/platforms/seattle.c new file mode 100644 index 0000000..edfc391 --- /dev/null +++ b/xen/arch/arm/platforms/seattle.c @@ -0,0 +1,68 @@ +/* + * xen/arch/arm/seattle.c + * + * AMD Seattle specific settings + * + * Suravee Suthikulpanit + * Copyright (c) 2014 Advance Micro Devices Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include + +static const char * const seattle_dt_compat[] __initconst = +{ + "amd,seattle", + NULL +}; + +/* Seattle firmware only implements PSCI handler for + * system off and system reset at this point. + * This is temporary until full PSCI-0.2 is supported. + * Then, these function will be removed. + */ +static noinline void seattle_smc_psci(register_t func_id) +{ + asm volatile( + "smc #0" + : "+r" (func_id) + :); +} + +static void seattle_system_reset(void) +{ + seattle_smc_psci(PSCI_0_2_FN_SYSTEM_RESET); +} + +static void seattle_system_off(void) +{ + seattle_smc_psci(PSCI_0_2_FN_SYSTEM_OFF); +} + +PLATFORM_START(seattle, "SEATTLE") + .compatible = seattle_dt_compat, + .reset = seattle_system_reset, + .poweroff = seattle_system_off, + + .dom0_gnttab_start = 0xe1700000, + .dom0_gnttab_size = 0x20000, +PLATFORM_END + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */