From patchwork Tue Dec 2 17:39:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 41817 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0AD4820672 for ; Tue, 2 Dec 2014 17:40:43 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id k14sf8418525wgh.4 for ; Tue, 02 Dec 2014 09:40:42 -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=MvqNtIvPF7691J7V21Wkja7aT3hEKz/+FFiyHQ0cTWU=; b=DoE5Yayn0gKhU6O1nRwIHOMNYsWuHjG0nPtj+eNe0UXI32FDz1qG+50r7AhpiJ76aq WZ5LWBhqfs+ifEJqTP66eUQt5p7UdBi31QXRWQub20+fezXtEn0KDCqQvF/Y4Tm8On9X I1vfl1mKh5YOHKWHTIqFcdtMn2vrdhcXUzeCnbNFQU8yobyssQKPqnE5r8Ot9xrzlOTK itvXN8Go7sPlEkAahEnxYZ2p8T3lk5Uhgt9GoPiUQKvN1W8rphMCWwtZ9FNkiI9D7Pav wGcmA7NiXMAAMO4iG7bDjyU173s0XFfKjBU0ZAtNrW9k06tkGeiMY55QeAINHn1YwgB/ jO+w== X-Gm-Message-State: ALoCoQmhW+6gPO160H5sa6DhYdTKNfY0QPvNXq08CDn2cLBeABWFjrNeTBTadoTekrtmAfsbGP0J X-Received: by 10.152.26.72 with SMTP id j8mr109382lag.3.1417542042284; Tue, 02 Dec 2014 09:40:42 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.1.136 with SMTP id 8ls59125lam.55.gmail; Tue, 02 Dec 2014 09:40:41 -0800 (PST) X-Received: by 10.152.120.73 with SMTP id la9mr380842lab.23.1417542041911; Tue, 02 Dec 2014 09:40:41 -0800 (PST) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id ze6si20958030lbb.75.2014.12.02.09.40.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Dec 2014 09:40:41 -0800 (PST) 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 w7so10736653lbi.5 for ; Tue, 02 Dec 2014 09:40:41 -0800 (PST) X-Received: by 10.112.189.10 with SMTP id ge10mr366491lbc.23.1417542039102; Tue, 02 Dec 2014 09:40:39 -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 ew9csp528019lbc; Tue, 2 Dec 2014 09:40:38 -0800 (PST) X-Received: by 10.70.20.129 with SMTP id n1mr353832pde.135.1417542032956; Tue, 02 Dec 2014 09:40:32 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hb6si949974pbc.194.2014.12.02.09.40.32 for ; Tue, 02 Dec 2014 09:40:32 -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 S1754458AbaLBRkb (ORCPT + 5 others); Tue, 2 Dec 2014 12:40:31 -0500 Received: from mail-pd0-f178.google.com ([209.85.192.178]:62439 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754425AbaLBRk3 (ORCPT ); Tue, 2 Dec 2014 12:40:29 -0500 Received: by mail-pd0-f178.google.com with SMTP id g10so13685149pdj.9 for ; Tue, 02 Dec 2014 09:40:28 -0800 (PST) X-Received: by 10.66.157.137 with SMTP id wm9mr618909pab.17.1417542028118; Tue, 02 Dec 2014 09:40:28 -0800 (PST) Received: from ubuntu.localdomain (proxy6-global253.qualcomm.com. [199.106.103.253]) by mx.google.com with ESMTPSA id q3sm20928900pdn.23.2014.12.02.09.40.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 02 Dec 2014 09:40:27 -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 v14 02/10] qcom: scm: Add SCM warmboot support for quad core SoCs Date: Tue, 2 Dec 2014 10:39:10 -0700 Message-Id: <1417541958-56907-3-git-send-email-lina.iyer@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1417541958-56907-1-git-send-email-lina.iyer@linaro.org> References: <1417541958-56907-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.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-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 Reviewed-by: Stephen Boyd --- 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