From patchwork Wed Oct 1 19:51:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Suthikulpanit, Suravee" X-Patchwork-Id: 38254 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4BB2C202E7 for ; Wed, 1 Oct 2014 19:54:02 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id ho1sf287207wib.4 for ; Wed, 01 Oct 2014 12:54:01 -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:in-reply-to :references: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=feDTAWKTe0dIGDZ8wRZe9tme7jh4ou1Jgh/IgUwzGpc=; b=joTSallViJEXnA3jMaDdJMdpWQSONGrndABxjESzEsY+bng3hbdLG0yu+dxLDT63nn lBF3nap4vtx490zvfYLn4IgJ1j8IhKwm4l9TLXFD1uZjVJbgQKRVtvJ7rUXotJMOzGxB TZ/IZBYazmt+k9jWJD2AZohFYWohvPJ31O3L2TaA8pPJSNhItVWF1kpeo9j0eL/VuLXi QXwVmzb0y/J9E3KWWLIwAW6n+1XayE5Ktyy58y9cUzb0LTfDb9ex4luOUHdDV13gYrDD ieMbH9CoQlIiAdDgTyAnzjSEcE4exai3fmCba5zgKBy5La//dbaXiM12oHBmRqzFlvNI aaUw== X-Gm-Message-State: ALoCoQl058DReXOJJ+89kVbSMdPOnpGP9pw3lzJ5GBOP0o/zKnKjIhHfhObJLonMU+Rd/L6W+n44 X-Received: by 10.112.137.230 with SMTP id ql6mr774035lbb.13.1412193241470; Wed, 01 Oct 2014 12:54:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.197.68 with SMTP id is4ls207387lac.6.gmail; Wed, 01 Oct 2014 12:54:01 -0700 (PDT) X-Received: by 10.152.4.97 with SMTP id j1mr57691863laj.73.1412193241152; Wed, 01 Oct 2014 12:54:01 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) by mx.google.com with ESMTPS id ua7si3313773lac.103.2014.10.01.12.54.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 Oct 2014 12:54:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by mail-lb0-f174.google.com with SMTP id p9so1034970lbv.5 for ; Wed, 01 Oct 2014 12:54:01 -0700 (PDT) X-Received: by 10.112.75.233 with SMTP id f9mr20281537lbw.102.1412193241014; Wed, 01 Oct 2014 12:54:01 -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 of9csp602042lbb; Wed, 1 Oct 2014 12:54:00 -0700 (PDT) X-Received: by 10.224.63.140 with SMTP id b12mr59581347qai.22.1412193239494; Wed, 01 Oct 2014 12:53:59 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id v4si2566745qcf.33.2014.10.01.12.53.58 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 01 Oct 2014 12:53:59 -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 1XZPwA-0002HU-Sf; Wed, 01 Oct 2014 19:51:46 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XZPw9-0002H4-HM for xen-devel@lists.xen.org; Wed, 01 Oct 2014 19:51:45 +0000 Received: from [85.158.137.68:22556] by server-8.bemta-3.messagelabs.com id 3D/0A-31195-05B5C245; Wed, 01 Oct 2014 19:51:44 +0000 X-Env-Sender: Suravee.Suthikulpanit@amd.com X-Msg-Ref: server-14.tower-31.messagelabs.com!1412193102!8498129!1 X-Originating-IP: [157.56.110.116] 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 16034 invoked from network); 1 Oct 2014 19:51:43 -0000 Received: from mail-bn1on0116.outbound.protection.outlook.com (HELO na01-bn1-obe.outbound.protection.outlook.com) (157.56.110.116) by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP; 1 Oct 2014 19:51:43 -0000 Received: from BN1PR02CA0012.namprd02.prod.outlook.com (10.141.56.12) by CO1PR02MB207.namprd02.prod.outlook.com (10.242.165.145) with Microsoft SMTP Server (TLS) id 15.0.1039.15; Wed, 1 Oct 2014 19:51:41 +0000 Received: from BL2FFO11FD046.protection.gbl (2a01:111:f400:7c09::166) by BN1PR02CA0012.outlook.office365.com (2a01:111:e400:2a::12) with Microsoft SMTP Server (TLS) id 15.0.1044.10 via Frontend Transport; Wed, 1 Oct 2014 19:51:40 +0000 Received: from atltwp02.amd.com (165.204.84.222) by BL2FFO11FD046.mail.protection.outlook.com (10.173.161.208) with Microsoft SMTP Server id 15.0.1029.15 via Frontend Transport; Wed, 1 Oct 2014 19:51:40 +0000 X-WSS-ID: 0NCS75X-08-TAK-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 atltwp02.amd.com (Axway MailGate 5.3.1) with ESMTPS id 2CA1DD16022; Wed, 1 Oct 2014 14:51:33 -0500 (CDT) Received: from SATLEXDAG03.amd.com (10.181.40.7) by satlvexedge01.amd.com (10.177.96.28) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 1 Oct 2014 14:52:00 -0500 Received: from ssuthiku-fedora-lt.amd.com (10.180.168.240) by satlexdag03.amd.com (10.181.40.7) with Microsoft SMTP Server id 14.3.195.1; Wed, 1 Oct 2014 15:51:38 -0400 From: To: , , Date: Wed, 1 Oct 2014 14:51:25 -0500 Message-ID: <1412193085-30828-4-git-send-email-suravee.suthikulpanit@amd.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1412193085-30828-1-git-send-email-suravee.suthikulpanit@amd.com> References: <1412193085-30828-1-git-send-email-suravee.suthikulpanit@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.222; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(428002)(199003)(189002)(99396003)(44976005)(86362001)(20776003)(19580395003)(31966008)(53416004)(84676001)(62966002)(21056001)(19580405001)(47776003)(93916002)(33646002)(120916001)(10300001)(107046002)(77096002)(64706001)(86152002)(46102003)(2201001)(50466002)(80022003)(76482002)(92726001)(50226001)(92566001)(36756003)(4396001)(77156001)(48376002)(50986999)(97736003)(106466001)(229853001)(104166001)(87286001)(101416001)(89996001)(88136002)(105586002)(87936001)(85852003)(95666004)(68736004)(85306004)(102836001)(76176999)(2004002); DIR:OUT; SFP:1102; SCL:1; SRVR:CO1PR02MB207; H:atltwp02.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:CO1PR02MB207; X-Forefront-PRVS: 0351D213B3 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] [V2 3/3] 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.174 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 sytem_reset mechanism. Initially, the firmware only support a subset of PSCI-0.2 functions, system-off and sytem-reset. The boot protocol is still using spin-table. Signed-off-by: Suravee Suthikulpanit --- xen/arch/arm/platforms/Makefile | 1 + xen/arch/arm/platforms/seattle.c | 69 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 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..03e7a14 100644 --- a/xen/arch/arm/platforms/Makefile +++ b/xen/arch/arm/platforms/Makefile @@ -4,3 +4,4 @@ obj-$(CONFIG_ARM_32) += midway.o obj-$(CONFIG_ARM_32) += omap5.o obj-$(CONFIG_ARM_32) += sunxi.o obj-$(CONFIG_ARM_64) += xgene-storm.o +obj-$(CONFIG_ARM_64) += seattle.o diff --git a/xen/arch/arm/platforms/seattle.c b/xen/arch/arm/platforms/seattle.c new file mode 100644 index 0000000..06d4e99 --- /dev/null +++ b/xen/arch/arm/platforms/seattle.c @@ -0,0 +1,69 @@ +/* + * 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 +#include +#include +#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 noinline void seattle_system_reset(void) +{ + seattle_smc_psci(PSCI_0_2_FN_SYSTEM_RESET); +} + +static noinline 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, +PLATFORM_END + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */