From patchwork Wed Nov 26 22:28:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 41566 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 1669625E18 for ; Wed, 26 Nov 2014 22:28:58 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id r20sf2500841wiv.5 for ; Wed, 26 Nov 2014 14:28:57 -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=BpsXFUZesKhuodWcO3VL1mvSEiNicRdORujhXqECngk=; b=Nss2iZuvhMuacWpnSuT6W+Vy2huPGLxH1B2BUfgzydDxtCWkrhupOOnDcFAWuEQ+L+ aTjS8Qzi02K0feD4dEb1JlBy2zj06gg/QQngIf0MkqRJUvI3CG0aNFJ090/5AXP5VKfP TJGE3s/5knx4h+kh0bEEcL1YRO2BFKB+4F9ItdPJQFaWAUlosnhlqIYOJD6yzPFuncQt ExUKWfka7Yy6yZ2BLhaPKUVRCXlBIWxOMBiOjhODVHPYxkbwob4Lnaels8ozg2QM/tEM 0C2Vg4K6xZ0XyTafvMFNWbsDnZrnHMMJpo0HUwVy2iqOSPfkpWZYzHHnrr46nevSX3j/ 5bEw== X-Gm-Message-State: ALoCoQkstAS1lA26ChawnbBItxmMOrwrnVW0DRA5zYHTo7eZ8ToLS84vR+QLFgLtRa9vRGC49Szr X-Received: by 10.112.130.8 with SMTP id oa8mr1192877lbb.11.1417040937308; Wed, 26 Nov 2014 14:28:57 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.3.170 with SMTP id d10ls686723lad.37.gmail; Wed, 26 Nov 2014 14:28:56 -0800 (PST) X-Received: by 10.112.27.133 with SMTP id t5mr32508948lbg.45.1417040936558; Wed, 26 Nov 2014 14:28:56 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id ay3si5647174lbc.4.2014.11.26.14.28.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Nov 2014 14:28:56 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id 10so3247870lbg.36 for ; Wed, 26 Nov 2014 14:28:56 -0800 (PST) X-Received: by 10.112.189.10 with SMTP id ge10mr35640205lbc.23.1417040936428; Wed, 26 Nov 2014 14:28:56 -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 ew9csp708827lbc; Wed, 26 Nov 2014 14:28:55 -0800 (PST) X-Received: by 10.66.163.129 with SMTP id yi1mr56548421pab.149.1417040931804; Wed, 26 Nov 2014 14:28:51 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ae10si8754961pbd.132.2014.11.26.14.28.51 for ; Wed, 26 Nov 2014 14:28:51 -0800 (PST) Received-SPF: none (google.com: linux-arm-msm-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 S1753136AbaKZW2u (ORCPT + 5 others); Wed, 26 Nov 2014 17:28:50 -0500 Received: from mail-pd0-f169.google.com ([209.85.192.169]:55962 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753105AbaKZW2t (ORCPT ); Wed, 26 Nov 2014 17:28:49 -0500 Received: by mail-pd0-f169.google.com with SMTP id fp1so3577865pdb.14 for ; Wed, 26 Nov 2014 14:28:48 -0800 (PST) X-Received: by 10.66.124.130 with SMTP id mi2mr57974999pab.104.1417040928516; Wed, 26 Nov 2014 14:28:48 -0800 (PST) Received: from ubuntu.localdomain (proxy6-global253.qualcomm.com. [199.106.103.253]) by mx.google.com with ESMTPSA id xd3sm5219025pbc.54.2014.11.26.14.28.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Nov 2014 14:28:47 -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 02/10] qcom: scm: Add SCM warmboot support for quad core SoCs Date: Wed, 26 Nov 2014 15:28:22 -0700 Message-Id: <1417040910-43290-3-git-send-email-lina.iyer@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1417040910-43290-1-git-send-email-lina.iyer@linaro.org> References: <1417040910-43290-1-git-send-email-lina.iyer@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-arm-msm@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.217.177 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 | 34 ++++++++++++++++++++++++++++++++++ include/soc/qcom/scm-boot.h | 3 +-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/drivers/soc/qcom/scm-boot.c b/drivers/soc/qcom/scm-boot.c index 60ff7b4..8f7136c 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,20 @@ 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