From patchwork Thu Oct 2 21:25:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Suthikulpanit, Suravee" X-Patchwork-Id: 38307 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f72.google.com (mail-ee0-f72.google.com [74.125.83.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8E368201F1 for ; Thu, 2 Oct 2014 21:28:00 +0000 (UTC) Received: by mail-ee0-f72.google.com with SMTP id e51sf121668eek.3 for ; Thu, 02 Oct 2014 14:27:59 -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=FFBBrlPlal1qbL4P+ZNA3fB8hPn17hxCStJdcc7qNr0=; b=hXbvtiru60o2s+5w8JdSf5Vn5N8zIqntegPuFWPxsqUV5wynIVwPaciuQLx63geRJF IoDUhDI5yDGXiaOG2ZO0ee/DWErGPJTq5RVcFOw7+M4AVoGwvt/baog3GG/C+LN3iWOd roggW3tiq9da030oK0gsCy4VsFyFHd2YGXcj8qbTxxYfTx0Vt6mznJmol5F1Uy/8RWgB OO7eny/2fAEJBwF4KuAsub6mtuqMmDXUtVbnezVnwO/oQJslWXF6UPsqEVpho2N+qZPL hcYkj71kCd7CmpCxmqbLqaWmekR8WghXvcq2xHiJvo67tYpOeamr0/p6+UT1fYP9C/Qi lMRg== X-Gm-Message-State: ALoCoQmO9/u2GJZ625HacY+KhBIjvadnjF75pAiMpxPokL0X4o5JVByfKzb3sg6PwqgUvoNz8OD7 X-Received: by 10.112.145.136 with SMTP id su8mr243680lbb.9.1412285279288; Thu, 02 Oct 2014 14:27:59 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.227 with SMTP id p3ls331036laf.39.gmail; Thu, 02 Oct 2014 14:27:59 -0700 (PDT) X-Received: by 10.112.158.227 with SMTP id wx3mr1321810lbb.1.1412285279144; Thu, 02 Oct 2014 14:27:59 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) by mx.google.com with ESMTPS id tn9si8334931lbb.72.2014.10.02.14.27.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 Oct 2014 14:27:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by mail-la0-f41.google.com with SMTP id pn19so3233563lab.0 for ; Thu, 02 Oct 2014 14:27:58 -0700 (PDT) X-Received: by 10.153.7.73 with SMTP id da9mr12073lad.56.1412285278819; Thu, 02 Oct 2014 14:27:58 -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 of9csp132666lbb; Thu, 2 Oct 2014 14:27:58 -0700 (PDT) X-Received: by 10.140.21.36 with SMTP id 33mr1900154qgk.63.1412285277083; Thu, 02 Oct 2014 14:27:57 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id e92si9359632qgf.34.2014.10.02.14.27.56 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 02 Oct 2014 14:27:57 -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 1XZnt3-0007xR-1k; Thu, 02 Oct 2014 21:26:09 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XZnt0-0007x2-Nz for xen-devel@lists.xen.org; Thu, 02 Oct 2014 21:26:06 +0000 Received: from [85.158.137.68:44396] by server-5.bemta-3.messagelabs.com id F8/34-30889-EE2CD245; Thu, 02 Oct 2014 21:26:06 +0000 X-Env-Sender: Suravee.Suthikulpanit@amd.com X-Msg-Ref: server-14.tower-31.messagelabs.com!1412285164!8748972!1 X-Originating-IP: [65.55.169.133] 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 29873 invoked from network); 2 Oct 2014 21:26:05 -0000 Received: from mail-bl2on0133.outbound.protection.outlook.com (HELO na01-bl2-obe.outbound.protection.outlook.com) (65.55.169.133) by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP; 2 Oct 2014 21:26:05 -0000 Received: from CO1PR02MB208.namprd02.prod.outlook.com (10.242.165.150) by CO1PR02MB256.namprd02.prod.outlook.com (10.242.165.152) with Microsoft SMTP Server (TLS) id 15.0.1039.15; Thu, 2 Oct 2014 21:26:02 +0000 Received: from BY2PR02CA0037.namprd02.prod.outlook.com (10.141.216.27) by CO1PR02MB208.namprd02.prod.outlook.com (10.242.165.150) with Microsoft SMTP Server (TLS) id 15.0.1044.10; Thu, 2 Oct 2014 21:26:00 +0000 Received: from BN1BFFO11FD038.protection.gbl (2a01:111:f400:7c10::1:183) by BY2PR02CA0037.outlook.office365.com (2a01:111:e400:2c40::27) with Microsoft SMTP Server (TLS) id 15.0.1044.10 via Frontend Transport; Thu, 2 Oct 2014 21:26:00 +0000 Received: from atltwp01.amd.com (165.204.84.221) by BN1BFFO11FD038.mail.protection.outlook.com (10.58.144.101) with Microsoft SMTP Server id 15.0.1029.15 via Frontend Transport; Thu, 2 Oct 2014 21:25:59 +0000 X-WSS-ID: 0NCU679-07-67I-02 X-M-MSG: Received: from satlvexedge02.amd.com (satlvexedge02.amd.com [10.177.96.29]) (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 25920CAE80B; Thu, 2 Oct 2014 16:25:56 -0500 (CDT) Received: from SATLEXDAG05.amd.com (10.181.40.11) by SATLVEXEDGE02.amd.com (10.177.96.29) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 2 Oct 2014 16:26:23 -0500 Received: from ssuthiku-fedora-lt.amd.com (10.180.168.240) by satlexdag05.amd.com (10.181.40.11) with Microsoft SMTP Server id 14.3.195.1; Thu, 2 Oct 2014 17:25:57 -0400 From: To: , , , Date: Thu, 2 Oct 2014 16:25:35 -0500 Message-ID: <1412285135-25468-4-git-send-email-suravee.suthikulpanit@amd.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1412285135-25468-1-git-send-email-suravee.suthikulpanit@amd.com> References: <1412285135-25468-1-git-send-email-suravee.suthikulpanit@amd.com> 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)(46102003)(84676001)(76482002)(48376002)(50466002)(102836001)(19580395003)(10300001)(64706001)(19580405001)(95666004)(21056001)(44976005)(68736004)(120916001)(36756003)(4396001)(53416004)(50226001)(107046002)(229853001)(97736003)(101416001)(92726001)(62966002)(76176999)(77096002)(85306004)(105586002)(33646002)(99396003)(2201001)(87286001)(104166001)(80022003)(77156001)(88136002)(47776003)(20776003)(86152002)(31966008)(89996001)(92566001)(85852003)(87936001)(86362001)(106466001)(93916002)(50986999); DIR:OUT; SFP:1102; SCL:1; SRVR:CO1PR02MB208; H:atltwp01.amd.com; FPR:; MLV:sfv; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Antispam: UriScan:;UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:CO1PR02MB208; X-Forefront-PRVS: 03524FBD26 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:CO1PR02MB256; X-OriginatorOrg: amd4.onmicrosoft.com Cc: Suravee Suthikulpanit , xen-devel@lists.xen.org Subject: [Xen-devel] [V3 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.215.41 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 --- xen/arch/arm/platforms/Makefile | 1 + xen/arch/arm/platforms/seattle.c | 65 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 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..d298393 --- /dev/null +++ b/xen/arch/arm/platforms/seattle.c @@ -0,0 +1,65 @@ +/* + * 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, +PLATFORM_END + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */