From patchwork Wed Feb 6 05:13:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 157556 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6000876jaa; Tue, 5 Feb 2019 21:13:52 -0800 (PST) X-Google-Smtp-Source: AHgI3IZHSfLKo8bDmFz56J8UVfPlE9jJtrLvDvwc2fkoSsnGN08JbDu9mJ20zjNqyDvBDIklpCIc X-Received: by 2002:a17:902:8a91:: with SMTP id p17mr8919263plo.316.1549430032360; Tue, 05 Feb 2019 21:13:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549430032; cv=none; d=google.com; s=arc-20160816; b=wT5j5xLoZWAol2XkZs19cL2whqh2h23MxfYAzNwcNwsX/9jY9J9lbUuLLzSx0m3JYV A2861oCDvKzdyKiKqr0Izfd7emdPLFqR4oKyEU8+Zh99cruOdiJs/cEIO6qqXwkLKa3G tGhARdTI8aAdxbNxefcYiWU4WWMn34frquXp4BlKTIDPxi4koo43iqWonD2NgiF9rplu yOE3/iXCfjsYi7zFJ8rBIL7BXGuYZTFLKW6lJ7AjbOoLeQwq57r70msL2b+9A1ccvwuB u0oL6ysnzCm/+ywr9EoH4xOdcF6319eCVzKb3HxsvC+LW4Rg+suz52TeVk8IjuIj9KPD dfRA== 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; bh=6eBUJRtxTOfCi5YseNIZQjzHG28hQt9IsL5ROy/8BF4=; b=YYSEaWRwubX6fa2/1XLHK8M+h1XV2eoka94shgZymGyqzl6xd2AwT6wkKgUpcnZ4f2 D0yF8IBaBEjXRCJ/Q83wnFJpU7rYy44pJsA6JZpgm/iPrvSv3+3aM3o+LzQ+9DFxp7m2 NbjPlLAj4xcI0/zgP+tBtapnMFpC8Ijw5Jd/CI+WdWmcAvz6ZiUQUaWq5Gf4HUNJe5my vE+SWweM09x10qrFZlEcULJR/Dth6Gh/gDOI+tBdvOAZ1dHUdIUxtDs44UhQ9syCO0it cjPy3oyYt7RlXrUL961pc3A4M/CESXFfCOxaN++DS2Wse+/nDAd9GykveuwlbX4wq4Np 0VNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eXFiE3TJ; 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 w11si3972824pfk.210.2019.02.05.21.13.52; Tue, 05 Feb 2019 21:13:52 -0800 (PST) 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=eXFiE3TJ; 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 S1727591AbfBFFNo (ORCPT + 31 others); Wed, 6 Feb 2019 00:13:44 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:34466 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727378AbfBFFNo (ORCPT ); Wed, 6 Feb 2019 00:13:44 -0500 Received: by mail-pf1-f194.google.com with SMTP id h3so2581827pfg.1 for ; Tue, 05 Feb 2019 21:13:43 -0800 (PST) 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=6eBUJRtxTOfCi5YseNIZQjzHG28hQt9IsL5ROy/8BF4=; b=eXFiE3TJp96F2GlZiaJR3MD+eVMpqVUSw/7P8nOrNfHdev5fVN5fZlP4fbi6H2OK69 8Qz9+8L4Qk0et7vriyydSqaumgqpqJkyK3Sno1PZ8Vp/bnCyOzXKnns5eKuNkV2lQC9P 7TQUjYCKTvcVRSkcjKucaRy3v7WWxdowXsJXzT8GFs/1vPwmN3GgtRQFK+JgCNVAWkrW SpcuHZ5UnZzWzQ2sdDwUdapIkJT2rUwWWrJuUGi9AEN8w4bq25w3ztpkfnyCdOYsT+rF wmnrEOQFoSMBUWmksFOWzrzypSneaBFF513yvYHB1i91Cflkeq9tD6bDADBU8DKSLRf0 lEdQ== 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=6eBUJRtxTOfCi5YseNIZQjzHG28hQt9IsL5ROy/8BF4=; b=VM01QquxiNVGBvnVYvbocF+3QbdtbJE8kabkxnEOWvR1+wMuJ9VrWCjrSkkhUiWxky YBy0rjO/gVIwZqC7XTqV+s/Y7yq3wqdKNTbVoj8+qzjI7VFLpxuvNFOWcOkVN5YZ0SYJ Lrl9Vgp/0tjmphjRkEw3PKK2+uXasyJGps3J11KDyiHCBySv/ndmWIgEJQ8zQEljziZv DevTudKKzFAxqTrPNYoT2VNDVreKazmwoM+E7JjPoKDJHG0MEWimpSdlq3i06TRbBZdt s1WG/a6CVdQOa7GACIpT+0sCqR647IO79zEqXzSlOaA1bmElQALQ5Lup/TDSDokU8N8d 4RPA== X-Gm-Message-State: AHQUAuYHRgIldI6R/XxVm+MZVmzEL7Eij9Q1CBKQi2de+Mi5xLLsT8Iq X2jgMulbNRNwUVtqPfHHuIz+U1EUTW8= X-Received: by 2002:a62:47d9:: with SMTP id p86mr8517917pfi.95.1549430023090; Tue, 05 Feb 2019 21:13:43 -0800 (PST) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id y71sm10735012pfi.123.2019.02.05.21.13.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Feb 2019 21:13:42 -0800 (PST) From: Bjorn Andersson To: Andy Gross Cc: David Brown , Rob Herring , Mark Rutland , Arun Kumar Neelakantam , Sibi Sankar , Doug Anderson , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 1/8] arm64: dts: qcom: sdm845: Update reserved memory map Date: Tue, 5 Feb 2019 21:13:28 -0800 Message-Id: <20190206051335.23799-2-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190206051335.23799-1-bjorn.andersson@linaro.org> References: <20190206051335.23799-1-bjorn.andersson@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Update existing and add missing regions to the reserved memory map, as described in version 10. Reviewed-by: Sibi Sankar Signed-off-by: Bjorn Andersson --- Changes since v5: - Replaced a few 0x0 with 0 - Corrected size of tz_mem arch/arm64/boot/dts/qcom/sdm845.dtsi | 74 +++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 7 deletions(-) -- 2.18.0 diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi index ade2f385507c..16a060063882 100644 --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi @@ -72,29 +72,69 @@ #size-cells = <2>; ranges; - memory@85fc0000 { + hyp_mem: memory@85700000 { + reg = <0 0x85700000 0 0x600000>; + no-map; + }; + + xbl_mem: memory@85e00000 { + reg = <0 0x85e00000 0 0x100000>; + no-map; + }; + + aop_mem: memory@85fc0000 { reg = <0 0x85fc0000 0 0x20000>; no-map; }; - memory@85fe0000 { + aop_cmd_db_mem: memory@85fe0000 { compatible = "qcom,cmd-db"; - reg = <0x0 0x85fe0000 0x0 0x20000>; + reg = <0x0 0x85fe0000 0 0x20000>; no-map; }; smem_mem: memory@86000000 { - reg = <0x0 0x86000000 0x0 0x200000>; + reg = <0x0 0x86000000 0 0x200000>; no-map; }; - memory@86200000 { + tz_mem: memory@86200000 { reg = <0 0x86200000 0 0x2d00000>; no-map; }; - wlan_msa_mem: memory@96700000 { - reg = <0 0x96700000 0 0x100000>; + qseecom_mem: memory@8ab00000 { + reg = <0 0x8ab00000 0 0x1400000>; + no-map; + }; + + camera_mem: memory@8bf00000 { + reg = <0 0x8bf00000 0 0x500000>; + no-map; + }; + + ipa_fw_mem: memory@8c400000 { + reg = <0 0x8c400000 0 0x10000>; + no-map; + }; + + ipa_gsi_mem: memory@8c410000 { + reg = <0 0x8c410000 0 0x5000>; + no-map; + }; + + gpu_mem: memory@8c415000 { + reg = <0 0x8c415000 0 0x2000>; + no-map; + }; + + adsp_mem: memory@8c500000 { + reg = <0 0x8c500000 0 0x1a00000>; + no-map; + }; + + wlan_msa_mem: memory@8df00000 { + reg = <0 0x8df00000 0 0x100000>; no-map; }; @@ -103,10 +143,30 @@ no-map; }; + venus_mem: memory@95800000 { + reg = <0 0x95800000 0 0x500000>; + no-map; + }; + + cdsp_mem: memory@95d00000 { + reg = <0 0x95d00000 0 0x800000>; + no-map; + }; + mba_region: memory@96500000 { reg = <0 0x96500000 0 0x200000>; no-map; }; + + slpi_mem: memory@96700000 { + reg = <0 0x96700000 0 0x1400000>; + no-map; + }; + + spss_mem: memory@97b00000 { + reg = <0 0x97b00000 0 0x100000>; + no-map; + }; }; cpus { From patchwork Wed Feb 6 05:13:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 157557 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6000886jaa; Tue, 5 Feb 2019 21:13:52 -0800 (PST) X-Google-Smtp-Source: AHgI3Iannn6GU3iCPDVaxwde7J6Q8rTCPfWDw2oMTJtR6kB632GVwR5TvXUxTXHfAd2u9yvMBvnL X-Received: by 2002:a63:c40a:: with SMTP id h10mr6345569pgd.131.1549430032702; Tue, 05 Feb 2019 21:13:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549430032; cv=none; d=google.com; s=arc-20160816; b=ZT7QoW3wzBw5Sj9GziP+EeYImSLcIxiAWiLL28tu4eMafpEMKnLdzsudjRR6z9fxbC ySfJMqE3WfvgHYX6/KI6s1vcdyxiFxBGt6fP88HBK0KU2bFL+iDzoA7Z7csXZOsgBFbd DroPTp9D+8PtafoRrQId/Gk02QFkm7Gi7q1HtSn7IcOdsP0aZUgPMWoY/rcvwSkL6gRY h5rGOyZoIGL23Wd30Q3y3kDkAYUPlaT9YgfEpE3eMn88o9RV9+5hXOOsgQAxd0Bu+1CZ hMiT+Kl8gbLPk41ibvWGbAbCczqh3lz4u4tcyCr0aVHZhiC5YMowqrEctn7zTHVtQYGt amPw== 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; bh=e9TQnw+GQEem4vsP/p8L7vayUTg3Ai1uL/Urr2XtEmY=; b=AWIPqKtxQdkS5ncuAQWoG3Otg3mFL7hRSr5ckKaI53UQSlQayIFvdDr3Xj4Yl9t9cX 6iXMQukDaZIH4V9EYjxRY4zIMlpHFjNeF1VUcj5MncTyrdQ4OhhC/dX0/lYJ7vn37JdN Knw0f7hDHZlguG4g9pAxj2hbCj6aqVf3tTOSNk5YOhSA40qY8Pfl8MSU0cGtPvVj03sl cuoyZMIoCH3ETdnSwFGB7bY86GZRBtjwGOBTf/Gm7CY76VYVW/KgdPYrvhbgJoK+XqDi Bovm3A73EfQkwYsV1KC1DRtvi59KAJA6oqkGzvKvxQalfSIMAXo8XVp/V2Bn4WfDXNET Z7ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="cAjM/UgE"; 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 w11si3972824pfk.210.2019.02.05.21.13.52; Tue, 05 Feb 2019 21:13:52 -0800 (PST) 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="cAjM/UgE"; 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 S1727716AbfBFFNq (ORCPT + 31 others); Wed, 6 Feb 2019 00:13:46 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:39531 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727619AbfBFFNp (ORCPT ); Wed, 6 Feb 2019 00:13:45 -0500 Received: by mail-pf1-f195.google.com with SMTP id f132so290736pfa.6 for ; Tue, 05 Feb 2019 21:13:44 -0800 (PST) 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=e9TQnw+GQEem4vsP/p8L7vayUTg3Ai1uL/Urr2XtEmY=; b=cAjM/UgE6MuHRLilAUObMjjGRsfkWIyxCExhRof6s0tug8FnL2MAyl4ZOPx81HXZUY 0F6ZCuCd1jNVpoQqJnzfT/mNklL9TRykk10mIzQLHkyxZ/7lhA+gmfbGgRBUtJ2dpPiv To4fVD3JCH+/dMwl4qsSsj712tjVs9Tu6k8mn8Z7J03qidFdpblbkJHfX1xScGL+2/pq G+YWVXV+oJEoa+V8/Pyrb4/sa9Tka+L6SkC5jg6mqu1bNLBCt3iyeeAdzZVkdqG1+f4d XWApgEA1izlwSTPMI9jOiwWicqFclIednmmJBIfNTAU6/nnnluRHJXiNmmuD/WUkthRE oGpA== 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=e9TQnw+GQEem4vsP/p8L7vayUTg3Ai1uL/Urr2XtEmY=; b=aiEXQD0DmmxyazkV5zBASkDj2r+S8YgvsomlX7MS5iY6VwCLVIP/hyEcp6FYgmQpka vaxcXRFI57WsoiSObmno49z0F8yIMzbux2+QEwrRnEDR5NUy2Z1LyjvtEFOsnE1aPxtI WlRFjhwng9SKbQu0UjCC2pWnU4ksenVhH/xpPeDZCWWXa4hpHaQC34qMqs4O8SRcu8U6 Gg0U8ArjOjGNW24LIgSZcfgooQl95cHUPZI9iukVALKgDbuO8cV5T1PTqM2FwG9UyTTW +T11/FBQIiBhqV8RyekT2eVyLhEucU7NdDdhhZ34NEGWM1ll66fzhO5OFDq4t2VRulDt +IyQ== X-Gm-Message-State: AHQUAuaclaMw9wkl8RNKHaV3v8kerfFM5m2akHK8CzR23f1rW8jQ8j7m skNEiDp6N9Ez6Z8ftBEGbxYOlA== X-Received: by 2002:a62:2018:: with SMTP id g24mr9040936pfg.100.1549430024417; Tue, 05 Feb 2019 21:13:44 -0800 (PST) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id y71sm10735012pfi.123.2019.02.05.21.13.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Feb 2019 21:13:43 -0800 (PST) From: Bjorn Andersson To: Andy Gross Cc: David Brown , Rob Herring , Mark Rutland , Arun Kumar Neelakantam , Sibi Sankar , Doug Anderson , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 2/8] arm64: dts: qcom: sdm845: Define rmtfs memory Date: Tue, 5 Feb 2019 21:13:29 -0800 Message-Id: <20190206051335.23799-3-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190206051335.23799-1-bjorn.andersson@linaro.org> References: <20190206051335.23799-1-bjorn.andersson@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Define the rmtfs memory node. As the memory region specified in version 10 of the memory map is only 1MB a chunk of unallocated memory is chosen. Tested-by: Sibi Sankar Reviewed-by: Sibi Sankar Signed-off-by: Bjorn Andersson --- Changes since v5: - Corrected unit address arch/arm64/boot/dts/qcom/sdm845.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.18.0 diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi index 16a060063882..a33d27b3a389 100644 --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi @@ -103,6 +103,15 @@ no-map; }; + rmtfs_mem: memory@88f00000 { + compatible = "qcom,rmtfs-mem"; + reg = <0 0x88f00000 0 0x200000>; + no-map; + + qcom,client-id = <1>; + qcom,vmid = <15>; + }; + qseecom_mem: memory@8ab00000 { reg = <0 0x8ab00000 0 0x1400000>; no-map; From patchwork Wed Feb 6 05:13:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 157561 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6000979jaa; Tue, 5 Feb 2019 21:14:00 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib2pG+SFEs7th9+kVDE5b2tex7oyjdvtQsLEqQFcSOzo/O8XP4vMQ/oQw35JUcVYBMhHqw5 X-Received: by 2002:a62:f54f:: with SMTP id n76mr8738993pfh.59.1549430039968; Tue, 05 Feb 2019 21:13:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549430039; cv=none; d=google.com; s=arc-20160816; b=rxoz2BiPvQABEs5EUA3kz/Lqguw8wLl7kYBh90K0fCDkCYRHr5t09/O/18a05zq8XK W1shCCr49WtQqvd+18aK6AWMFp1hYfJg93bvSkLdJS0632qnxDmhjdQPVNXj/NPe184m d4Trrn3/KBIT9nxf0CV0rQbBnxUc6GOZnDzRXUO1PPNDP221tKYJTTDfYXOMsKgDH/ju 0hcEKlT8wnF7IzD8c5TzEu42kRMmkEIvogBGYGxreSjLqDA7UVvEOhQnwiamQI54ZE8O q52dcPh4cPSyRCfABlxt7Kga7SgtbDovPfdcVuw1elunW7Fp+/Rp9Mw+DJZ3EfK5ouUK DuAw== 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; bh=+JsCVSwcWKdm/aTk0uK6Req0/gJIwLF/l4LfLmjrExk=; b=gFgNy24MS6AQXo22itjmzOejwR3hibMFcuI6IL0DR6opafqxww8Zo66qRgOujsHQwX X+8u0n0QZqZVRZ5RSLmjbAd9qMi35+xPRyfsAlePrL4XroClVgfgxnCxlv40rTei0c7w LxtlLUSkMotXDiaVMqyC56YGiutDL3IEp782UiRcknz59vg5J6yQ6e5qyiTul67Dy2OC 7nmL6VpB8ODacOWVXTOW3DbGwK2Cx3VGO3orSG8F5g9+Xii/QNHufa11xyarY5CZJ8uh H9ywENJOKm+Fad5RH/s1NzR3ZfDfPLgpJIcbgDB2fPxJa7xzqjPY2LAtMY//e7uT2Nlq UpQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J863Us3k; 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 d13si3614139pgh.196.2019.02.05.21.13.59; Tue, 05 Feb 2019 21:13:59 -0800 (PST) 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=J863Us3k; 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 S1728002AbfBFFN4 (ORCPT + 31 others); Wed, 6 Feb 2019 00:13:56 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:43603 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727853AbfBFFNv (ORCPT ); Wed, 6 Feb 2019 00:13:51 -0500 Received: by mail-pg1-f193.google.com with SMTP id v28so2414405pgk.10 for ; Tue, 05 Feb 2019 21:13:50 -0800 (PST) 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=+JsCVSwcWKdm/aTk0uK6Req0/gJIwLF/l4LfLmjrExk=; b=J863Us3kF0HpU7PnNjGaCzU64PX7BiLHvNHdMQtehUriGHYT/qswbqBNAntEfOizsm ZbJry+FKWA2BLs1Vwmt9NU1p6tINUqiVmxq20hW3H987+JwEdoIy/IA0to5LWzMeKgY9 8H35zCW3+Eim9aoW1BmwzV6NIpJ3MAwZZeR9tSiJiwuPPkvRCZ67v3pc6XRLuf0BxB9W Mq0FE+OIWin6EGUJ9LYJOP0upSaUkOSb/GlXOTPubdTzE8JY2/zk/FUNHZuGaLhE9Q3D rFk05IDNd2TrjSzUAqcTJPm6v9Pl7Zea/79Rl9O5ezkWawr1ekE9ueU8VkizO5StozsP lpAw== 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=+JsCVSwcWKdm/aTk0uK6Req0/gJIwLF/l4LfLmjrExk=; b=IlDzSDBq0Gqynak9FqEX2fBm/4WCvA2o27KmZZenVzfkQQGnV8RvIkLBsEaUh5V4f1 j9/fH9pF+KiwyES8GD0epbSUvKRLWPpfPUCTbyyL+zVifHNBBdyg33IFVKv6l1Fa4wly wDmgWKsDZ+7e9EtvniVRkz1tvLiIBG/aTnh5O1DL5nCIaAoxzvPh8e5+LKsyhHUYb+Y9 UX5+1l4UIUBBMhQEh/0y4rJMLB/s/XNvaEG6P3wMbNwGMMGhtQjX9fl7H3PBFebSAplY F/8VCgpN0PCM23GVyVF5ITXK6ISKE2wgJ/W9X2LW4MvvMrq19gQ+aMYMt6C+AwkxZwCF pZFA== X-Gm-Message-State: AHQUAuYV4QhdMHeAEKoU3HwGVaQHpY45JWoM1GSHNRuCFKJ44OdfNm0m fFPGD2TLmEGQ/5Fk/kWwxYw5pw== X-Received: by 2002:a62:3811:: with SMTP id f17mr8864551pfa.206.1549430029882; Tue, 05 Feb 2019 21:13:49 -0800 (PST) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id y71sm10735012pfi.123.2019.02.05.21.13.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Feb 2019 21:13:49 -0800 (PST) From: Bjorn Andersson To: Andy Gross Cc: David Brown , Rob Herring , Mark Rutland , Arun Kumar Neelakantam , Sibi Sankar , Doug Anderson , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 6/8] soc: qcom: Add AOSS QMP genpd provider Date: Tue, 5 Feb 2019 21:13:33 -0800 Message-Id: <20190206051335.23799-7-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190206051335.23799-1-bjorn.andersson@linaro.org> References: <20190206051335.23799-1-bjorn.andersson@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The AOSS QMP genpd provider implements control over power-related resources related to low-power state associated with the remoteprocs in the system as well as control over a set of clocks related to debug hardware in the SoC. Tested-by: Sibi Sankar Tested-by: Sai Prakash Ranjan Reviewed-by: Sibi Sankar Signed-off-by: Bjorn Andersson --- Changes since v5: - Clear outgoing buffer, to avoid sending unitialized stack content to AOP - Fix domain initialization - Clean up domains on failure and remove drivers/soc/qcom/Kconfig | 9 ++ drivers/soc/qcom/Makefile | 1 + drivers/soc/qcom/aoss-qmp-pd.c | 158 +++++++++++++++++++++++++++++++++ 3 files changed, 168 insertions(+) create mode 100644 drivers/soc/qcom/aoss-qmp-pd.c -- 2.18.0 diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig index 28ab19bf8c98..893b56b70957 100644 --- a/drivers/soc/qcom/Kconfig +++ b/drivers/soc/qcom/Kconfig @@ -12,6 +12,15 @@ config QCOM_AOSS_QMP micro-controller in the AOSS, using QMP, to control certain resource that are not exposed through RPMh. +config QCOM_AOSS_QMP_PD + tristate "Qualcomm AOSS Messaging Power Domain driver" + depends on QCOM_AOSS_QMP + select PM_GENERIC_DOMAINS + help + This driver provides the means of controlling the AOSS's handling of + low-power state for resources related to the remoteproc subsystems as + well as controlling the debug clocks. + config QCOM_COMMAND_DB bool "Qualcomm Command DB" depends on ARCH_QCOM || COMPILE_TEST diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile index 2c04d27fbf9e..16913e73fddf 100644 --- a/drivers/soc/qcom/Makefile +++ b/drivers/soc/qcom/Makefile @@ -1,6 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS_rpmh-rsc.o := -I$(src) obj-$(CONFIG_QCOM_AOSS_QMP) += aoss-qmp.o +obj-$(CONFIG_QCOM_AOSS_QMP_PD) += aoss-qmp-pd.o obj-$(CONFIG_QCOM_GENI_SE) += qcom-geni-se.o obj-$(CONFIG_QCOM_COMMAND_DB) += cmd-db.o obj-$(CONFIG_QCOM_GLINK_SSR) += glink_ssr.o diff --git a/drivers/soc/qcom/aoss-qmp-pd.c b/drivers/soc/qcom/aoss-qmp-pd.c new file mode 100644 index 000000000000..a375abcbe9c7 --- /dev/null +++ b/drivers/soc/qcom/aoss-qmp-pd.c @@ -0,0 +1,158 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2018, Linaro Ltd + */ +#include +#include +#include +#include +#include + +/* Requests are expected to be 96 bytes long */ +#define AOSS_QMP_PD_MSG_LEN 96 + +struct qmp_pd { + struct qmp *qmp; + struct generic_pm_domain pd; +}; + +#define to_qmp_pd_resource(res) container_of(res, struct qmp_pd, pd) + +struct qmp_pd_resource { + const char *name; + int (*on)(struct generic_pm_domain *domain); + int (*off)(struct generic_pm_domain *domain); +}; + +static int qmp_pd_clock_toggle(struct qmp_pd *res, bool enable) +{ + char buf[AOSS_QMP_PD_MSG_LEN]; + + memset(buf, 0, sizeof(buf)); + snprintf(buf, sizeof(buf), "{class: clock, res: %s, val: %d}", + res->pd.name, enable); + return qmp_send(res->qmp, buf, sizeof(buf)); +} + +static int qmp_pd_clock_on(struct generic_pm_domain *domain) +{ + return qmp_pd_clock_toggle(to_qmp_pd_resource(domain), true); +} + +static int qmp_pd_clock_off(struct generic_pm_domain *domain) +{ + return qmp_pd_clock_toggle(to_qmp_pd_resource(domain), false); +} + +static int qmp_pd_image_toggle(struct qmp_pd *res, bool enable) +{ + char buf[AOSS_QMP_PD_MSG_LEN]; + + memset(buf, 0, sizeof(buf)); + snprintf(buf, sizeof(buf), + "{class: image, res: load_state, name: %s, val: %s}", + res->pd.name, enable ? "on" : "off"); + return qmp_send(res->qmp, buf, sizeof(buf)); +} + +static int qmp_pd_image_on(struct generic_pm_domain *domain) +{ + return qmp_pd_image_toggle(to_qmp_pd_resource(domain), true); +} + +static int qmp_pd_image_off(struct generic_pm_domain *domain) +{ + return qmp_pd_image_toggle(to_qmp_pd_resource(domain), false); +} + +static const struct qmp_pd_resource sdm845_resources[] = { + [AOSS_QMP_QDSS_CLK] = { "qdss", qmp_pd_clock_on, qmp_pd_clock_off }, + [AOSS_QMP_LS_CDSP] = { "cdsp", qmp_pd_image_on, qmp_pd_image_off }, + [AOSS_QMP_LS_LPASS] = { "adsp", qmp_pd_image_on, qmp_pd_image_off }, + [AOSS_QMP_LS_MODEM] = { "modem", qmp_pd_image_on, qmp_pd_image_off }, + [AOSS_QMP_LS_SLPI] = { "slpi", qmp_pd_image_on, qmp_pd_image_off }, + [AOSS_QMP_LS_SPSS] = { "spss", qmp_pd_image_on, qmp_pd_image_off }, + [AOSS_QMP_LS_VENUS] = { "venus", qmp_pd_image_on, qmp_pd_image_off }, +}; + +static int qmp_pd_probe(struct platform_device *pdev) +{ + struct genpd_onecell_data *data; + struct device *parent = pdev->dev.parent; + struct qmp_pd *res; + struct qmp *qmp; + size_t num = ARRAY_SIZE(sdm845_resources); + int ret; + int i; + + qmp = dev_get_drvdata(pdev->dev.parent); + if (!qmp) + return -EINVAL; + + res = devm_kcalloc(&pdev->dev, num, sizeof(*res), GFP_KERNEL); + if (!res) + return -ENOMEM; + + data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + data->domains = devm_kcalloc(&pdev->dev, num, sizeof(*data->domains), + GFP_KERNEL); + if (!data->domains) + return -ENOMEM; + + for (i = 0; i < num; i++) { + res[i].qmp = qmp; + res[i].pd.name = sdm845_resources[i].name; + res[i].pd.power_on = sdm845_resources[i].on; + res[i].pd.power_off = sdm845_resources[i].off; + + ret = pm_genpd_init(&res[i].pd, NULL, true); + if (ret < 0) { + dev_err(&pdev->dev, "failed to init genpd\n"); + goto unroll_genpds; + } + + data->domains[i] = &res[i].pd; + } + + data->num_domains = i; + + platform_set_drvdata(pdev, data); + + return of_genpd_add_provider_onecell(parent->of_node, data); + +unroll_genpds: + for (i--; i >= 0; i--) + pm_genpd_remove(data->domains[i]); + + return ret; +} + +static int qmp_pd_remove(struct platform_device *pdev) +{ + struct device *parent = pdev->dev.parent; + struct genpd_onecell_data *data = platform_get_drvdata(pdev); + int i; + + of_genpd_del_provider(parent->of_node); + + for (i = 0; i < data->num_domains; i++) + pm_genpd_remove(data->domains[i]); + + return 0; +} + +static struct platform_driver qmp_pd_driver = { + .driver = { + .name = "aoss_qmp_pd", + }, + .probe = qmp_pd_probe, + .remove = qmp_pd_remove, +}; +module_platform_driver(qmp_pd_driver); + +MODULE_ALIAS("platform:aoss_qmp_pd"); +MODULE_DESCRIPTION("Qualcomm AOSS QMP load-state driver"); +MODULE_LICENSE("GPL v2");