From patchwork Thu Nov 27 00:13:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 41576 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F3C3A25E74 for ; Thu, 27 Nov 2014 00:13:45 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id s18sf2397529lam.10 for ; Wed, 26 Nov 2014 16:13:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=NGAlPpxzWXq3wPKrQIOI2C0+huHiwbWMFy0mmahNALc=; b=YHezx34ThAoepvsEkzkNdE9ZwHflKlETaKbwmUFZ11NWe8L7Kxn1nSLppEDYvt1qDs 1ARNXGaX5AYHredUJeilIC9l9o8isMaqYP1HRGU8jOz8tF7Ux5K+ZQlPjgwkfCFs7Xso Nti4twWmjg9vGWCdPS02hrQUU3ApDH2ptCqBoa7iWZeL701JQVDIj/tqPbKaXvUlCl8R 1oY2uyLyiKKPCQpTTgrwMG1eTv6cWyC1EgYV5xWFd2z+pHysby6fuZPWbF4jHY+6P6Wl i811P/Uygs4RMU84aiMmUWnExXjuyJUox/hwHwCgmcjh/NjNmxZRi7EpgyPhvQUX3tGo tKcQ== X-Gm-Message-State: ALoCoQnhUCMuZ/xEQUhc6Ntu9HX6es8xwds4ANo1w/uUWWLyLTCCu4rg2F7VzV4S5bb5+ww+EPhn X-Received: by 10.152.10.233 with SMTP id l9mr9832989lab.0.1417047224885; Wed, 26 Nov 2014 16:13:44 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.202 with SMTP id u10ls610269lau.68.gmail; Wed, 26 Nov 2014 16:13:44 -0800 (PST) X-Received: by 10.112.135.229 with SMTP id pv5mr36285600lbb.52.1417047224389; Wed, 26 Nov 2014 16:13:44 -0800 (PST) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id ay17si40876lab.132.2014.11.26.16.13.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Nov 2014 16:13:44 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by mail-la0-f47.google.com with SMTP id hz20so3267745lab.20 for ; Wed, 26 Nov 2014 16:13:43 -0800 (PST) X-Received: by 10.112.14.69 with SMTP id n5mr36357244lbc.34.1417047223926; Wed, 26 Nov 2014 16:13:43 -0800 (PST) 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.184.201 with SMTP id ew9csp722190lbc; Wed, 26 Nov 2014 16:13:41 -0800 (PST) X-Received: by 10.68.162.66 with SMTP id xy2mr58088317pbb.28.1417047217914; Wed, 26 Nov 2014 16:13:37 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rb4si9151119pab.48.2014.11.26.16.13.37 for ; Wed, 26 Nov 2014 16:13:37 -0800 (PST) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753105AbaK0ANf (ORCPT + 12 others); Wed, 26 Nov 2014 19:13:35 -0500 Received: from mail-pd0-f176.google.com ([209.85.192.176]:48017 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751699AbaK0ANe (ORCPT ); Wed, 26 Nov 2014 19:13:34 -0500 Received: by mail-pd0-f176.google.com with SMTP id y10so3748214pdj.7 for ; Wed, 26 Nov 2014 16:13:34 -0800 (PST) X-Received: by 10.70.103.74 with SMTP id fu10mr58023774pdb.53.1417047214075; Wed, 26 Nov 2014 16:13:34 -0800 (PST) Received: from ubuntu.localdomain (proxy6-global253.qualcomm.com. [199.106.103.253]) by mx.google.com with ESMTPSA id yb8sm5403070pab.7.2014.11.26.16.13.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Nov 2014 16:13:33 -0800 (PST) From: Lina Iyer To: daniel.lezcano@linaro.org, khilman@linaro.org, sboyd@codeaurora.org, galak@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: lorenzo.pieralisi@arm.com, msivasub@codeaurora.org, devicetree@vger.kernel.org, Lina Iyer Subject: [PATCH v12 02/10] qcom: scm: Add SCM warmboot support for quad core SoCs Date: Wed, 26 Nov 2014 17:13:07 -0700 Message-Id: <1417047195-18978-3-git-send-email-lina.iyer@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1417047195-18978-1-git-send-email-lina.iyer@linaro.org> References: <1417047195-18978-1-git-send-email-lina.iyer@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lina.iyer@linaro.org 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.47 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-Post: , List-Help: , List-Archive: List-Unsubscribe: , Quad core SoCs like APQ8074, APQ8064, APQ8084 need SCM support set up warm boot addresses in the Secure Monitor. Extend the SCM flags to support warm boot addresses for secondary cores. We do not need to export the warmboot flags. Move them into the implementation file. Signed-off-by: Lina Iyer Acked-by: Daniel Lezcano --- drivers/soc/qcom/scm-boot.c | 35 +++++++++++++++++++++++++++++++++++ include/soc/qcom/scm-boot.h | 3 +-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/drivers/soc/qcom/scm-boot.c b/drivers/soc/qcom/scm-boot.c index 60ff7b4..f653217a 100644 --- a/drivers/soc/qcom/scm-boot.c +++ b/drivers/soc/qcom/scm-boot.c @@ -21,6 +21,23 @@ #include #include +#define SCM_FLAG_WARMBOOT_CPU0 0x04 +#define SCM_FLAG_WARMBOOT_CPU1 0x02 +#define SCM_FLAG_WARMBOOT_CPU2 0x10 +#define SCM_FLAG_WARMBOOT_CPU3 0x40 + +struct scm_warmboot { + int flag; + void *entry; +}; + +static struct scm_warmboot scm_flags[] = { + { .flag = SCM_FLAG_WARMBOOT_CPU0 }, + { .flag = SCM_FLAG_WARMBOOT_CPU1 }, + { .flag = SCM_FLAG_WARMBOOT_CPU2 }, + { .flag = SCM_FLAG_WARMBOOT_CPU3 }, +}; + /* * Set the cold/warm boot address for one of the CPU cores. */ @@ -37,3 +54,21 @@ int scm_set_boot_addr(phys_addr_t addr, int flags) &cmd, sizeof(cmd), NULL, 0); } EXPORT_SYMBOL(scm_set_boot_addr); + +int scm_set_warm_boot_addr(void *entry, int cpu) +{ + int ret; + + /* + * Reassign only if we are switching from hotplug entry point + * to cpuidle entry point or vice versa. + */ + if (entry == scm_flags[cpu].entry) + return 0; + + ret = scm_set_boot_addr(virt_to_phys(entry), scm_flags[cpu].flag); + if (!ret) + scm_flags[cpu].entry = entry; + + return ret; +} diff --git a/include/soc/qcom/scm-boot.h b/include/soc/qcom/scm-boot.h index 6aabb24..529f55a 100644 --- a/include/soc/qcom/scm-boot.h +++ b/include/soc/qcom/scm-boot.h @@ -16,9 +16,8 @@ #define SCM_FLAG_COLDBOOT_CPU1 0x01 #define SCM_FLAG_COLDBOOT_CPU2 0x08 #define SCM_FLAG_COLDBOOT_CPU3 0x20 -#define SCM_FLAG_WARMBOOT_CPU0 0x04 -#define SCM_FLAG_WARMBOOT_CPU1 0x02 int scm_set_boot_addr(phys_addr_t addr, int flags); +int scm_set_warm_boot_addr(void *entry, int cpu); #endif