From patchwork Mon Aug 14 22:46:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 110070 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp4938151qge; Mon, 14 Aug 2017 15:46:36 -0700 (PDT) X-Received: by 10.84.128.9 with SMTP id 9mr28503912pla.98.1502750796061; Mon, 14 Aug 2017 15:46:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502750796; cv=none; d=google.com; s=arc-20160816; b=lbhj+lXycTuwZpxZkoM54RpJqiqEbVrYW2Z4Zx8888fABDYAzzowlCOUmDhjxAW5cx 5BPSuiqfW36q4VNxMgEfgKqSJr+lt4OcFe2fwi58B7eyhF2XXBkz87UUS8QVLzlMn6ni gaWC7PaRbev+5ZaRrsyQOmldIGNet9j+453azh20f65G71WCrp/dEzXYSeQm2esse7Us n4BBmassHWS+G+dalTVbxIwX6R4kfE4KxTbw6SpuhwvY0ALlZKtBhFOMRRjhIcQ92rkm Sk5FyTD+HH7b7pK+VLZSg2uCr8uOMc0QTlqXF1gHzS/p0gDSpSXPeNzsU2yVGPMjn3G5 U2YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=4UqcOLtkdLOgwra4usbxpItH89zUTPkF2gs2TPYX2Tc=; b=0+OtcjU8rHy1cRBlooXlS45VB6rX5vvv4L3+tzeAE85DNE77GkUE2kBldgKFN+rSef 8+N1qTFGkN8g6JROiJo0ywVhZBb/6pR2l73t82h2/8YhddOS07SG0cTOCBONnqd9YMRi 8sWNyBcEEfFARipKUWh3DHdFZuW4JMj7WjPTi3rhzHX3zl5RdqeH+RbSpYtRv+kSfl2X caWV3zkt0dNqgq0TSmHOmeOuMXO/DiPh8Qoz+rFN7aZBxrJPGpC03RkyMjoDrH5LV0eH EI08GEbXqpd0/vFXhq07x6Xx8/6tZdYYn1KmvBH6Zy8DnBdN5ulhCP1/6f+lptmY7YaL aneA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QJVmuzbZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b10si5228766pll.359.2017.08.14.15.46.35; Mon, 14 Aug 2017 15:46:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QJVmuzbZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752857AbdHNWqc (ORCPT + 25 others); Mon, 14 Aug 2017 18:46:32 -0400 Received: from mail-pg0-f51.google.com ([74.125.83.51]:34864 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752794AbdHNWq0 (ORCPT ); Mon, 14 Aug 2017 18:46:26 -0400 Received: by mail-pg0-f51.google.com with SMTP id v189so55817883pgd.2 for ; Mon, 14 Aug 2017 15:46:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4UqcOLtkdLOgwra4usbxpItH89zUTPkF2gs2TPYX2Tc=; b=QJVmuzbZ0BborZjQtNPrL2pMC1JXKd7FIxNSxKph8Hsx/TTeW+vg/xHl4AsMbvdKvH X6OkiUS5os3yq4DvxuwISottQ5vGr+Hz6OuHlwh6qbmNWW8jb54XMAkWPRv+G3hcLImb F41DlU+YbRgepEUCjIlbetejGwjkUEKh/a4UA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4UqcOLtkdLOgwra4usbxpItH89zUTPkF2gs2TPYX2Tc=; b=VFvp7fV0nn+W5FknGwMsRCrt22NyajRML1/PBHppAyrmLtR6mS4aZPjc2MzPr0mlD/ rbeZS1ZS/J6Y9Ah/oSn0D6VK7IjugC5uJeqEx+SxPFlSUrgVk1hgzw0Bwyimzl14X2dc 9TkZGEhwk3jPTftvP2OM8QfNVrbmO0ae73/rvLWAZM9r4Zu2O6AayHXyry0RExkOKS+3 qTPAm1RPIo1uvoE/WOnGh31TDHbTVlBuZl+YrW2xskpCYPvw7aKyyZwFpKD/SwM7n1ed mhxAJ7nPDXK5FjmRt8eded/s4FRy9HE8PzlxUn+11nqQ326DJvrQOE0nWmnGYs0lO8K/ 1v3w== X-Gm-Message-State: AHYfb5j7doLGk+ojOZ95/taMIKfSR3QYRxBHcwKaXInhrV5OFISbhKQu 7ESncFE65qmjCqqo X-Received: by 10.84.232.11 with SMTP id h11mr29959543plk.126.1502750785748; Mon, 14 Aug 2017 15:46:25 -0700 (PDT) Received: from localhost.localdomain (ip68-111-217-79.sd.sd.cox.net. [68.111.217.79]) by smtp.gmail.com with ESMTPSA id 15sm19839428pfo.57.2017.08.14.15.46.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Aug 2017 15:46:25 -0700 (PDT) From: Bjorn Andersson To: Andy Gross , David Brown , Rob Herring , Mark Rutland Cc: Stephen Boyd , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org Subject: [PATCH v4 2/3] firmware: qcom: scm: Expose download-mode control Date: Mon, 14 Aug 2017 15:46:18 -0700 Message-Id: <20170814224619.29256-3-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170814224619.29256-1-bjorn.andersson@linaro.org> References: <20170814224619.29256-1-bjorn.andersson@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In order to aid post-mortem debugging the Qualcomm platforms provide a "memory download mode", where the boot loader will provide an interface for custom tools to "download" the content of RAM to a host machine. The mode is triggered by writing a magic value somewhere in RAM, that is read in the boot code path after a warm-restart. Two mechanism for setting this magic value are supported in modern platforms; a direct SCM call to enable the mode or through a secure io write of a magic value. In order for a normal reboot not to trigger "download mode" the magic must be cleared during a clean reboot. Download mode has to be enabled by including qcom_scm.download_mode=1 on the command line. Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson --- Changes since v3: - Offset register in TCSR - Spelling Changes since v2: - Define memory address by reference to TCSR - Provide Kconfig option for defaulting to enabled - Provided some comment in the code Changes since v1: - Specify DT propert being two-cell - Correct handling of scm-call return code .../devicetree/bindings/firmware/qcom,scm.txt | 2 + drivers/firmware/Kconfig | 11 ++++ drivers/firmware/qcom_scm-32.c | 6 ++ drivers/firmware/qcom_scm-64.c | 13 ++++ drivers/firmware/qcom_scm.c | 75 ++++++++++++++++++++++ drivers/firmware/qcom_scm.h | 2 + 6 files changed, 109 insertions(+) -- 2.12.0 diff --git a/Documentation/devicetree/bindings/firmware/qcom,scm.txt b/Documentation/devicetree/bindings/firmware/qcom,scm.txt index 20f26fbce875..7b40054be0d8 100644 --- a/Documentation/devicetree/bindings/firmware/qcom,scm.txt +++ b/Documentation/devicetree/bindings/firmware/qcom,scm.txt @@ -18,6 +18,8 @@ Required properties: * Core, iface, and bus clocks required for "qcom,scm" - clock-names: Must contain "core" for the core clock, "iface" for the interface clock and "bus" for the bus clock per the requirements of the compatible. +- qcom,dload-mode: phandle to the TCSR hardware block and offset of the + download mode control register (optional) Example for MSM8916: diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig index 6e4ed5a9c6fd..fa87a055905e 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig @@ -215,6 +215,17 @@ config QCOM_SCM_64 def_bool y depends on QCOM_SCM && ARM64 +config QCOM_SCM_DOWNLOAD_MODE_DEFAULT + bool "Qualcomm download mode enabled by default" + depends on QCOM_SCM + help + A device with "download mode" enabled will upon an unexpected + warm-restart enter a special debug mode that allows the user to + "download" memory content over USB for offline postmortem analysis. + The feature can be enabled/disabled on the kernel command line. + + Say Y here to enable "download mode" by default. + config TI_SCI_PROTOCOL tristate "TI System Control Interface (TISCI) Message Protocol" depends on TI_MESSAGE_MANAGER diff --git a/drivers/firmware/qcom_scm-32.c b/drivers/firmware/qcom_scm-32.c index 11fdb1584823..68b2033bc30e 100644 --- a/drivers/firmware/qcom_scm-32.c +++ b/drivers/firmware/qcom_scm-32.c @@ -561,6 +561,12 @@ int __qcom_scm_pas_mss_reset(struct device *dev, bool reset) return ret ? : le32_to_cpu(out); } +int __qcom_scm_set_dload_mode(struct device *dev, bool enable) +{ + return qcom_scm_call_atomic2(QCOM_SCM_SVC_BOOT, QCOM_SCM_SET_DLOAD_MODE, + enable ? QCOM_SCM_SET_DLOAD_MODE : 0, 0); +} + int __qcom_scm_set_remote_state(struct device *dev, u32 state, u32 id) { struct { diff --git a/drivers/firmware/qcom_scm-64.c b/drivers/firmware/qcom_scm-64.c index bf50fb59852e..3fea6f563ca9 100644 --- a/drivers/firmware/qcom_scm-64.c +++ b/drivers/firmware/qcom_scm-64.c @@ -440,6 +440,19 @@ int __qcom_scm_iommu_secure_ptbl_init(struct device *dev, u64 addr, u32 size, return ret; } +int __qcom_scm_set_dload_mode(struct device *dev, bool enable) +{ + struct qcom_scm_desc desc = {0}; + struct arm_smccc_res res; + + desc.args[0] = QCOM_SCM_SET_DLOAD_MODE; + desc.args[1] = enable ? QCOM_SCM_SET_DLOAD_MODE : 0; + desc.arginfo = QCOM_SCM_ARGS(2); + + return qcom_scm_call(dev, QCOM_SCM_SVC_BOOT, QCOM_SCM_SET_DLOAD_MODE, + &desc, &res); +} + int __qcom_scm_io_readl(struct device *dev, phys_addr_t addr, unsigned int *val) { diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c index e18d63935648..9064e559a01f 100644 --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c @@ -19,15 +19,20 @@ #include #include #include +#include #include #include #include +#include #include #include #include #include "qcom_scm.h" +static bool download_mode = IS_ENABLED(CONFIG_QCOM_SCM_DOWNLOAD_MODE_DEFAULT); +module_param(download_mode, bool, 0); + #define SCM_HAS_CORE_CLK BIT(0) #define SCM_HAS_IFACE_CLK BIT(1) #define SCM_HAS_BUS_CLK BIT(2) @@ -38,6 +43,8 @@ struct qcom_scm { struct clk *iface_clk; struct clk *bus_clk; struct reset_controller_dev reset; + + u64 dload_mode_addr; }; static struct qcom_scm *__scm; @@ -345,6 +352,54 @@ int qcom_scm_io_writel(phys_addr_t addr, unsigned int val) } EXPORT_SYMBOL(qcom_scm_io_writel); +static void qcom_scm_set_download_mode(bool enable) +{ + bool avail; + int ret = 0; + + avail = __qcom_scm_is_call_available(__scm->dev, + QCOM_SCM_SVC_BOOT, + QCOM_SCM_SET_DLOAD_MODE); + if (avail) { + ret = __qcom_scm_set_dload_mode(__scm->dev, enable); + } else if (__scm->dload_mode_addr) { + ret = __qcom_scm_io_writel(__scm->dev, __scm->dload_mode_addr, + enable ? QCOM_SCM_SET_DLOAD_MODE : 0); + } else { + dev_err(__scm->dev, + "No available mechanism for setting download mode\n"); + } + + if (ret) + dev_err(__scm->dev, "failed to set download mode: %d\n", ret); +} + +static int qcom_scm_find_dload_address(struct device *dev, u64 *addr) +{ + struct device_node *tcsr; + struct device_node *np = dev->of_node; + struct resource res; + u32 offset; + int ret; + + tcsr = of_parse_phandle(np, "qcom,dload-mode", 0); + if (!tcsr) + return 0; + + ret = of_address_to_resource(tcsr, 0, &res); + of_node_put(tcsr); + if (ret) + return ret; + + ret = of_property_read_u32_index(np, "qcom,dload-mode", 1, &offset); + if (ret < 0) + return ret; + + *addr = res.start + offset; + + return 0; +} + /** * qcom_scm_is_available() - Checks if SCM is available */ @@ -370,6 +425,10 @@ static int qcom_scm_probe(struct platform_device *pdev) if (!scm) return -ENOMEM; + ret = qcom_scm_find_dload_address(&pdev->dev, &scm->dload_mode_addr); + if (ret < 0) + return ret; + clks = (unsigned long)of_device_get_match_data(&pdev->dev); if (clks & SCM_HAS_CORE_CLK) { scm->core_clk = devm_clk_get(&pdev->dev, "core"); @@ -418,9 +477,24 @@ static int qcom_scm_probe(struct platform_device *pdev) __qcom_scm_init(); + /* + * If requested enable "download mode", from this point on warmboot + * will cause the the boot stages to enter download mode, unless + * disabled below by a clean shutdown/reboot. + */ + if (download_mode) + qcom_scm_set_download_mode(true); + return 0; } +static void qcom_scm_shutdown(struct platform_device *pdev) +{ + /* Clean shutdown, disable download mode to allow normal restart */ + if (download_mode) + qcom_scm_set_download_mode(false); +} + static const struct of_device_id qcom_scm_dt_match[] = { { .compatible = "qcom,scm-apq8064", /* FIXME: This should have .data = (void *) SCM_HAS_CORE_CLK */ @@ -448,6 +522,7 @@ static struct platform_driver qcom_scm_driver = { .of_match_table = qcom_scm_dt_match, }, .probe = qcom_scm_probe, + .shutdown = qcom_scm_shutdown, }; static int __init qcom_scm_init(void) diff --git a/drivers/firmware/qcom_scm.h b/drivers/firmware/qcom_scm.h index a60e4b9b1394..83f171c23943 100644 --- a/drivers/firmware/qcom_scm.h +++ b/drivers/firmware/qcom_scm.h @@ -14,9 +14,11 @@ #define QCOM_SCM_SVC_BOOT 0x1 #define QCOM_SCM_BOOT_ADDR 0x1 +#define QCOM_SCM_SET_DLOAD_MODE 0x10 #define QCOM_SCM_BOOT_ADDR_MC 0x11 #define QCOM_SCM_SET_REMOTE_STATE 0xa extern int __qcom_scm_set_remote_state(struct device *dev, u32 state, u32 id); +extern int __qcom_scm_set_dload_mode(struct device *dev, bool enable); #define QCOM_SCM_FLAG_HLOS 0x01 #define QCOM_SCM_FLAG_COLDBOOT_MC 0x02 From patchwork Mon Aug 14 22:46:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 110071 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp4938592qge; Mon, 14 Aug 2017 15:47:08 -0700 (PDT) X-Received: by 10.98.24.21 with SMTP id 21mr26236218pfy.190.1502750828321; Mon, 14 Aug 2017 15:47:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502750828; cv=none; d=google.com; s=arc-20160816; b=WFClkuBFmeZb/r/iKE8bK9GiGtmipY4pm/DeNixl20TRZyQnMae1oqiKMV/ue6PWvD yXCXp7JSGXTG8giBxniEMzBf4v1W3EdHilTrhDPiFCJJhqr8Ct4JXsX5OetaagMb68YT LsqhZN67jdpBLPan1hKIAwHrs4dk/X5INa746eYAMUILuo5Rw+3A1dSx0J+o6yQfh3M3 p4ebuMSpLLM9YpkAsfqi33Y4gjYj/INFe+qfWVcqUZmtcj13XVWcY3fzhQnjuTEF+EO6 1JaBsZ0/x1aNMrwr3xVmBl2W1FLzRK35aqd6FJmFMKNctJkKNxcaRCu6H4Ndn18UxXLn BUYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=p1QWHKb4uCIkp/YmjKaOQboiliYugbuxWbZdGLBKsHg=; b=KbthDzN3OY3A8Oth5FuSivdV/4BsgU0UnlfnWgYpOAd/ffaoP92wL801U3G5ZM71O1 BpEXW4JTdP3MIONayFP5TmDlzVgRpYpdhxSv4rqgZjHSxFIle8d0zlDUv9hZ3EooVDEY Hh3R0Ol1peqRqeShHwrBBcFNB6PzgYglzygOvQaenpMFz8X4DkfoOOJGVbHr/BBP4MSP N9VuI7Zt+Kr133l5DnCnvAV/neO6dHn95wYVOykGTZhy/mf1SwTIV4oTV2VkGjYTPkWz AXsJpZi3LDDfUc5p7rGhWhUzhDIJw+/67/GLxGl5FZq6oYFQiAABGXOgB/RKk8zr9JsR m7pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UdKt6JRY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o4si4626384pgd.352.2017.08.14.15.47.07; Mon, 14 Aug 2017 15:47:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UdKt6JRY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752832AbdHNWq3 (ORCPT + 25 others); Mon, 14 Aug 2017 18:46:29 -0400 Received: from mail-pg0-f46.google.com ([74.125.83.46]:36061 "EHLO mail-pg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752806AbdHNWq1 (ORCPT ); Mon, 14 Aug 2017 18:46:27 -0400 Received: by mail-pg0-f46.google.com with SMTP id i12so5021334pgr.3 for ; Mon, 14 Aug 2017 15:46:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=p1QWHKb4uCIkp/YmjKaOQboiliYugbuxWbZdGLBKsHg=; b=UdKt6JRYm/YmdifpPwzqiBUo1a+tWKKt6dbGAneypoWibZyPdVNNkWiwFquLWk20Tm RPvtVkl4h9/rbxCH+vfUs1WC7ncrcqooPPthWVY3A02iEvq0ypGzYz4ZiuDcj57QA9Cd fN4HNQfBVTC8Xqo6KiNHRBDb8TOhiICLMXP3c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=p1QWHKb4uCIkp/YmjKaOQboiliYugbuxWbZdGLBKsHg=; b=VvV745DDKwzxTBW/XAWTQkdfyf3FRXKG5Alzd09lVxXqDTZ81QjB12VEdzSl9s2MPT DKQqe7LMenSV+6BvXOt0ULBybCTChYwwp1DhFwaw/uxJ6GmozS4LIX/yb8tWqc8zXXyT Wf/KAPtXVPeG4AtrxvFSHSMwED4YdCT5MlCRiS3qZ3uTjvqr/uRLSan3cpjZpcOPMJQS ay/SuCoDpnsnsXB/Li9OgPJu2pCdUMCxVKUDHp4d6iPw4mNpcCNH0VdGYtnfbo7Wi/fg EVQWDZY+GlCnYpSyERgA09Ahv79DiXAvrFZlskqU6jMZAiEDw9Gokh+Z613VphKsIoKq jCXQ== X-Gm-Message-State: AHYfb5jQ4GX/qcPpcQKF84ne1rO3nvTeRsWMn6fAvA3rQkiuEHRAzV7U TdOmKKUZy0mxOdrb X-Received: by 10.84.238.199 with SMTP id l7mr29192913pln.267.1502750786894; Mon, 14 Aug 2017 15:46:26 -0700 (PDT) Received: from localhost.localdomain (ip68-111-217-79.sd.sd.cox.net. [68.111.217.79]) by smtp.gmail.com with ESMTPSA id 15sm19839428pfo.57.2017.08.14.15.46.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Aug 2017 15:46:26 -0700 (PDT) From: Bjorn Andersson To: Andy Gross , David Brown Cc: Rob Herring , Mark Rutland , Stephen Boyd , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org Subject: [PATCH v4 3/3] arm64: dts: qcom: Specify dload address for msm8916 and msm8996 Date: Mon, 14 Aug 2017 15:46:19 -0700 Message-Id: <20170814224619.29256-4-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170814224619.29256-1-bjorn.andersson@linaro.org> References: <20170814224619.29256-1-bjorn.andersson@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On msm8916 and msm8996 boards a secure io-write is used to write the magic for selecting "download mode", specify this address in the DeviceTree. Note that qcom_scm.download_mode=1 must be specified on the kernel command line for the kernel to attempt selecting download mode. Signed-off-by: Bjorn Andersson --- Changes since v3: - Added tcsr offsets - Corrected node address of tcsr arch/arm64/boot/dts/qcom/msm8916.dtsi | 2 ++ arch/arm64/boot/dts/qcom/msm8996.dtsi | 7 +++++++ 2 files changed, 9 insertions(+) -- 2.12.0 diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi index 039991f80831..ecc0775d78a9 100644 --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi @@ -241,6 +241,8 @@ clocks = <&gcc GCC_CRYPTO_CLK>, <&gcc GCC_CRYPTO_AXI_CLK>, <&gcc GCC_CRYPTO_AHB_CLK>; clock-names = "core", "bus", "iface"; #reset-cells = <1>; + + qcom,dload-mode = <&tcsr 0x6100>; }; }; diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi index 8f085716e258..a6d1d01df670 100644 --- a/arch/arm64/boot/dts/qcom/msm8996.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi @@ -261,6 +261,8 @@ firmware { scm { compatible = "qcom,scm-msm8996"; + + qcom,dload-mode = <&tcsr 0x13000>; }; }; @@ -287,6 +289,11 @@ reg = <0x740000 0x20000>; }; + tcsr: syscon@7a0000 { + compatible = "qcom,tcsr-msm8996", "syscon"; + reg = <0x7a0000 0x18000>; + }; + intc: interrupt-controller@9bc0000 { compatible = "arm,gic-v3"; #interrupt-cells = <3>;