From patchwork Fri Nov 21 18:03:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 41339 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C072321459 for ; Fri, 21 Nov 2014 18:04:21 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id gd6sf3413805lab.8 for ; Fri, 21 Nov 2014 10:04:18 -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=7ZpmaMDSTItvcdyQqLSwOM7lAGFPfyI4MBrcKsGPvRI=; b=XlHi/JLs+UbJAJxBliSw7tuW69GFTPm+tRUoyipw9JdhpaRl9Aw0CDocyXYO78cc0s oF/d9P71hE9OBXrlUgPLqQmxEzIt9WwHbiz8nCu0PWvps10ndZ/B/KT5XACFn4m+yZsV Aa/Gro8+WVr+fg9jZkXJNe0XFZap/ZgPoVg500cQHk01gG/3krf5FjKLeyNr2n7IGgRN cHzUXSjEusJTfheBwvAW2ZdTPlbJLAZiU/cdxEnkrbrscZwApqwLUJ2CadlMutbm5LXL yXJTan/fm3qsfJs32UHOHgz/86Z9QBlvlEsQui5H4tVx+Ku15gmtDgDhfC0OLse7Fcil JO1Q== X-Gm-Message-State: ALoCoQlboZ2enDG+wR+cGwN7qc3e1tqwihGOzBplK4UnjFr30vLvYmYJLx/b4lGebo4MyTGHqcAf X-Received: by 10.152.42.196 with SMTP id q4mr1983900lal.6.1416593057814; Fri, 21 Nov 2014 10:04:17 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.7 with SMTP id o7ls214458lao.55.gmail; Fri, 21 Nov 2014 10:04:17 -0800 (PST) X-Received: by 10.152.207.71 with SMTP id lu7mr6747703lac.81.1416593057310; Fri, 21 Nov 2014 10:04:17 -0800 (PST) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id 10si3615739lal.74.2014.11.21.10.04.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Nov 2014 10:04:16 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id f15so4969816lbj.13 for ; Fri, 21 Nov 2014 10:04:15 -0800 (PST) X-Received: by 10.112.52.37 with SMTP id q5mr6760532lbo.32.1416593055253; Fri, 21 Nov 2014 10:04:15 -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 ew9csp138530lbc; Fri, 21 Nov 2014 10:04:14 -0800 (PST) X-Received: by 10.70.47.166 with SMTP id e6mr9459459pdn.43.1416593052714; Fri, 21 Nov 2014 10:04:12 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xj9si10077613pab.73.2014.11.21.10.04.11 for ; Fri, 21 Nov 2014 10:04:12 -0800 (PST) Received-SPF: none (google.com: devicetree-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 S1750807AbaKUSEJ (ORCPT + 4 others); Fri, 21 Nov 2014 13:04:09 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:46689 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750895AbaKUSEI (ORCPT ); Fri, 21 Nov 2014 13:04:08 -0500 Received: by mail-pa0-f46.google.com with SMTP id lj1so5308570pab.5 for ; Fri, 21 Nov 2014 10:04:07 -0800 (PST) X-Received: by 10.66.179.75 with SMTP id de11mr9633443pac.24.1416593047695; Fri, 21 Nov 2014 10:04:07 -0800 (PST) Received: from ubuntu.localdomain (pat_11.qualcomm.com. [192.35.156.11]) by mx.google.com with ESMTPSA id qh4sm5411466pbb.35.2014.11.21.10.04.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 21 Nov 2014 10:04:07 -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 v10 02/10] qcom: scm: Add SCM warmboot support for quad core SoCs Date: Fri, 21 Nov 2014 11:03:49 -0700 Message-Id: <1416593037-27527-3-git-send-email-lina.iyer@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1416593037-27527-1-git-send-email-lina.iyer@linaro.org> References: <1416593037-27527-1-git-send-email-lina.iyer@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@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.182 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 | 31 +++++++++++++++++++++++++++++++ include/soc/qcom/scm-boot.h | 3 +-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/drivers/soc/qcom/scm-boot.c b/drivers/soc/qcom/scm-boot.c index 60ff7b4..0871659 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,17 @@ 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; + + 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