From patchwork Fri Oct 24 23:40:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 5150671 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 46C1DC11AC for ; Fri, 24 Oct 2014 23:44:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 81C1220256 for ; Fri, 24 Oct 2014 23:44:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A222920268 for ; Fri, 24 Oct 2014 23:44:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XhoTz-0006B6-9u; Fri, 24 Oct 2014 23:41:23 +0000 Received: from mail-pa0-f52.google.com ([209.85.220.52]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XhoTl-000637-C1 for linux-arm-kernel@lists.infradead.org; Fri, 24 Oct 2014 23:41:09 +0000 Received: by mail-pa0-f52.google.com with SMTP id fa1so291102pad.39 for ; Fri, 24 Oct 2014 16:40:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mZMn3HQZtD1ypr18Njq3kn9v/jhqTFuaT/nKvxCceow=; b=J6fqEliNH5iBAdOE1wAibjYYopCPTGte05FwO7gAhnckqbcHVCKzYstC8M0RHAMfeC FlP2iUejfcts0I2gDPh1kcFLOeErDwDGiZrFU4BqLKL9i2B4fbFY5W+RybtY7BuEk+/Q alD3A2+rM/4GTEtJfSNHQOISQxqKaklvFEd239l+2LWuKFCtlAwPJmycBX5QBq6Stlez xEzHk+vzvKm/RjbM/NgghXf3OS7cFiBD15LvOWowndgMjFXk80wiaPQ2ZycGY8GgI4gM gCwQ/sJvZcf5WpSBH2qv/flPithx1El08ecHP+y/tiheBOZq5/BiokKWx+vZBe9unXlW 2PGA== X-Gm-Message-State: ALoCoQlc+810IoPnSoZZAlBO4ujCZXW4OUEs6Ta/kMy+0MU2dIFvMOk3jgFLUkPJOeFB/vnVkdIq X-Received: by 10.66.171.45 with SMTP id ar13mr7607487pac.21.1414194047173; Fri, 24 Oct 2014 16:40:47 -0700 (PDT) Received: from ubuntu.localdomain (proxy6-global253.qualcomm.com. [199.106.103.253]) by mx.google.com with ESMTPSA id fm15sm4774620pdb.58.2014.10.24.16.40.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Oct 2014 16:40:46 -0700 (PDT) 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 Subject: [PATCH v9 1/9] qcom: scm: scm_set_warm_boot_addr() to set the warmboot address Date: Fri, 24 Oct 2014 17:40:16 -0600 Message-Id: <1414194024-55547-2-git-send-email-lina.iyer@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1414194024-55547-1-git-send-email-lina.iyer@linaro.org> References: <1414194024-55547-1-git-send-email-lina.iyer@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141024_164109_429205_10063C02 X-CRM114-Status: GOOD ( 10.72 ) X-Spam-Score: -0.7 (/) Cc: msivasub@codeaurora.org, devicetree@vger.kernel.org, lorenzo.pieralisi@arm.com, Lina Iyer X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Set the warmboot address using an SCM call, only if the new address is different than the old one. Signed-off-by: Lina Iyer --- drivers/soc/qcom/scm-boot.c | 22 ++++++++++++++++++++++ include/soc/qcom/scm-boot.h | 1 + 2 files changed, 23 insertions(+) diff --git a/drivers/soc/qcom/scm-boot.c b/drivers/soc/qcom/scm-boot.c index 60ff7b4..5710967 100644 --- a/drivers/soc/qcom/scm-boot.c +++ b/drivers/soc/qcom/scm-boot.c @@ -37,3 +37,25 @@ 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) +{ + static int flags[NR_CPUS] = { + SCM_FLAG_WARMBOOT_CPU0, + SCM_FLAG_WARMBOOT_CPU1, + SCM_FLAG_WARMBOOT_CPU2, + SCM_FLAG_WARMBOOT_CPU3, + }; + static DEFINE_PER_CPU(void *, last_known_entry); + int ret; + + if (entry == per_cpu(last_known_entry, cpu)) + return 0; + + ret = scm_set_boot_addr(virt_to_phys(entry), flags[cpu]); + if (!ret) + per_cpu(last_known_entry, cpu) = entry; + + return ret; +} diff --git a/include/soc/qcom/scm-boot.h b/include/soc/qcom/scm-boot.h index 02b445c..100938b 100644 --- a/include/soc/qcom/scm-boot.h +++ b/include/soc/qcom/scm-boot.h @@ -22,5 +22,6 @@ #define SCM_FLAG_WARMBOOT_CPU3 0x40 int scm_set_boot_addr(phys_addr_t addr, int flags); +int scm_set_warm_boot_addr(void *entry, int cpu); #endif