From patchwork Mon Sep 16 10:25:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biwen Li X-Patchwork-Id: 11146779 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 081DF912 for ; Mon, 16 Sep 2019 10:37:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DA35B206A4 for ; Mon, 16 Sep 2019 10:37:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dbINlYNi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA35B206A4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=Q3k7jEb559T5Abvf5ezh/yylWtlE747BY3v8eqIclZc=; b=dbI NlYNim7OWdcTVYVEQjpKlzKtHOmUgWk/Z75BXcerh5A+ywbUAwAmOUzIFw6igEdzxAO6kT1MSTBhS 6zXN8iRw2Vi+z8YPFo9dZpp/EU3sUklp19SQ6sRA8qA5gIuSmYqKfIic/iL2Z0vxaMYmreUHE6sx3 uX+4Vx8xiqdJZq//+9at0dtUyqh4PUxvjtPkW4pK8eQB8t2uGTlZZIP3dN1Pyy7lU97Qay6msHIJq x3wUYDwMA1t3bZ8EKhumb/kjzwyD2Yz4dVselZkpbN6VlSBscRXOzA5wUQXDZseJFVodx0hm33Q80 IxlWvoEp32q/n2I+ILSGXY9nV6oKklA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1i9oNk-0005q5-CR; Mon, 16 Sep 2019 10:37:20 +0000 Received: from inva020.nxp.com ([92.121.34.13]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1i9oMs-0005Np-RL for linux-arm-kernel@lists.infradead.org; Mon, 16 Sep 2019 10:36:28 +0000 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 6520C1A0572; Mon, 16 Sep 2019 12:36:21 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 22DBD1A0207; Mon, 16 Sep 2019 12:36:17 +0200 (CEST) Received: from titan.ap.freescale.net (TITAN.ap.freescale.net [10.192.208.233]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 92EDF402BF; Mon, 16 Sep 2019 18:36:11 +0800 (SGT) From: Biwen Li To: leoyang.li@nxp.com, shawnguo@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com Subject: [1/3] soc: fsl: fix that flextimer cannot wakeup system in deep sleep on LS1021A Date: Mon, 16 Sep 2019 18:25:54 +0800 Message-Id: <20190916102556.16655-1-biwen.li@nxp.com> X-Mailer: git-send-email 2.9.5 X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190916_033627_132774_CF5BE9F7 X-CRM114-Status: GOOD ( 11.71 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [92.121.34.13 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Biwen Li MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Why: - Cannot write register RCPM_IPPDEXPCR1 on LS1021A, Register RCPM_IPPDEXPCR1's default value is zero. So the register value that reading from register RCPM_IPPDEXPCR1 is always zero. How: - Save register RCPM_IPPDEXPCR1's value to register SCFG_SPARECR8.(uboot's psci also need reading value from the register SCFG_SPARECR8 to set register RCPM_IPPDEXPCR1) Signed-off-by: Biwen Li --- drivers/soc/fsl/rcpm.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/soc/fsl/rcpm.c b/drivers/soc/fsl/rcpm.c index 82c0ad5e663e..2bf37d38efe5 100644 --- a/drivers/soc/fsl/rcpm.c +++ b/drivers/soc/fsl/rcpm.c @@ -13,6 +13,8 @@ #include #include #include +#include +#include #define RCPM_WAKEUP_CELL_MAX_SIZE 7 @@ -63,6 +65,33 @@ static int rcpm_pm_prepare(struct device *dev) tmp |= value[i + 1]; iowrite32be(tmp, rcpm->ippdexpcr_base + i * 4); } + #ifdef CONFIG_SOC_LS1021A + /* Workaround: There is a bug of register ippdexpcr1, + * cannot write it but can read it.Tt's default value is zero, + * then read it will always returns zero. + * So save ippdexpcr1's value to register SCFG_SPARECR8. + * And the value of ippdexpcr1 will be read from SCFG_SPARECR8. + */ + { + struct regmap * rcpm_scfg_regmap = NULL; + u32 reg_offset[RCPM_WAKEUP_CELL_MAX_SIZE + 1]; + u32 reg_value = 0; + + rcpm_scfg_regmap = syscon_regmap_lookup_by_phandle(np, "fsl,rcpm-scfg"); + if (rcpm_scfg_regmap) { + if (of_property_read_u32_array(dev->of_node, + "fsl,rcpm-scfg", reg_offset, rcpm->wakeup_cells + 1)) { + rcpm_scfg_regmap = NULL; + continue; + } + regmap_read(rcpm_scfg_regmap, reg_offset[i + 1], ®_value); + /* Write value to register SCFG_SPARECR8 */ + regmap_write(rcpm_scfg_regmap, reg_offset[i + 1], tmp | reg_value); + } + } + #endif + + } } } while (ws = wakeup_source_get_next(ws)); From patchwork Mon Sep 16 10:25:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biwen Li X-Patchwork-Id: 11146777 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E7997912 for ; Mon, 16 Sep 2019 10:36:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C59F6214AF for ; Mon, 16 Sep 2019 10:36:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="n0D2KuBn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C59F6214AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=0bu9mE2mTm149Gg1h3L5upQwoI17Jxqr0Er/WFJXc+s=; b=n0D2KuBnkZ24aeGNkVK3yfCfpC U8/m4Du20Dog3T18jcZOH9otcPyqXg10yDcRqGMSOzlX8JTuIeFDM0+L8OxmbCJKqyvv4KytaBT/i 4aLtOSiKpJZTA7rF+xHT2OSYXaJ/EUsyO9Y3RAVupU4PMx48YVya5JrAEtZhk7kYx2Q+6KPiZyn2v 0ja5zLCw17R9A1CFa6xxRgJtWVFsgf4sg3x797wASSso74ga68NANdnvIlCPnx3NUwbc6fKxlzaKF TQuT7dsSNHl3vGw6Ic9M8hY1Mj8hDl3ds3hfCOF6Sagx++LpjZ0yRDaAeJM6mQWFkACTrp2Fsa0QI NlFj3MmQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1i9oNM-0005dU-T4; Mon, 16 Sep 2019 10:36:56 +0000 Received: from inva020.nxp.com ([92.121.34.13]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1i9oMt-0005Nq-0l for linux-arm-kernel@lists.infradead.org; Mon, 16 Sep 2019 10:36:28 +0000 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 01D781A0207; Mon, 16 Sep 2019 12:36:22 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id B3FD41A0049; Mon, 16 Sep 2019 12:36:17 +0200 (CEST) Received: from titan.ap.freescale.net (TITAN.ap.freescale.net [10.192.208.233]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 89A4C402CA; Mon, 16 Sep 2019 18:36:12 +0800 (SGT) From: Biwen Li To: leoyang.li@nxp.com, shawnguo@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com Subject: [2/3] arm: dts: ls1021a: fix that FlexTimer cannot wakeup system in deep sleep Date: Mon, 16 Sep 2019 18:25:55 +0800 Message-Id: <20190916102556.16655-2-biwen.li@nxp.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190916102556.16655-1-biwen.li@nxp.com> References: <20190916102556.16655-1-biwen.li@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190916_033627_454607_DFC85F07 X-CRM114-Status: UNSURE ( 7.40 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [92.121.34.13 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Biwen Li MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The patch fix a bug that FlexTimer cannot wakeup system in deep sleep. Signed-off-by: Biwen Li --- arch/arm/boot/dts/ls1021a.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi index e3973b611c3a..377bb4717584 100644 --- a/arch/arm/boot/dts/ls1021a.dtsi +++ b/arch/arm/boot/dts/ls1021a.dtsi @@ -1000,12 +1000,13 @@ compatible = "fsl,ls1021a-rcpm", "fsl,qoriq-rcpm-2.1+"; reg = <0x0 0x1ee2140 0x0 0x8>; #fsl,rcpm-wakeup-cells = <2>; + fsl,rcpm-scfg = <&scfg 0x0 0x51c>; /* SCFG_SPARECR8 */ }; ftm_alarm0: timer0@29d0000 { compatible = "fsl,ls1021a-ftm-alarm"; reg = <0x0 0x29d0000 0x0 0x10000>; - fsl,rcpm-wakeup = <&rcpm 0x0 0x20000000>; + fsl,rcpm-wakeup = <&rcpm 0x0 0x30000000>; /* FlexTimer1 and OCRAM1 are not powerdown during LPM20(sleep) */ interrupts = ; big-endian; }; From patchwork Mon Sep 16 10:25:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biwen Li X-Patchwork-Id: 11146781 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4153976 for ; Mon, 16 Sep 2019 10:37:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1FB65214AF for ; Mon, 16 Sep 2019 10:37:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kMc+dwgd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1FB65214AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ZfYvGpgNDU58iFeToOPzERR7h+DvwOd1BFRFXASoCPo=; b=kMc+dwgda1VuanwWKSMfH+Fc2k 1zLUUrlLZxeRgXF6Qtkm7K9AgiAcYaKByyGimQd38cXRYNW42HYdyXRNSi3n2DR1/Bt85ieyLsU2s yo3D1oimeXQlXAHHZXwtUxqdWbvUPH35TIdEuCDBWMuFQb3tazGh5DrGuPY2ZTprxmis/RIQW5zSF P+xmApAmtdBWmPwDalfoi9Tgv2D6P6VbkDxC4KiIjGyiz6JE3QVH3xAvEnB/v+uNuOQ/uYU1osltp F86TjfNYodNubUfJbXKWktWbYIhmu1Gb7HPRb0VMRFeYQRR9oISo8kscp08CezZ+idkJYWdvvYGiI PWcPzc3w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1i9oO2-0006Am-QT; Mon, 16 Sep 2019 10:37:38 +0000 Received: from inva021.nxp.com ([92.121.34.21]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1i9oMt-0005O6-Rt for linux-arm-kernel@lists.infradead.org; Mon, 16 Sep 2019 10:36:29 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 5B18D200022; Mon, 16 Sep 2019 12:36:23 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 1777D20058B; Mon, 16 Sep 2019 12:36:19 +0200 (CEST) Received: from titan.ap.freescale.net (TITAN.ap.freescale.net [10.192.208.233]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 88257402E6; Mon, 16 Sep 2019 18:36:13 +0800 (SGT) From: Biwen Li To: leoyang.li@nxp.com, shawnguo@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com Subject: [3/3] Documentation: dt: binding: fsl: Add 'fsl,rcpm-scfg' property Date: Mon, 16 Sep 2019 18:25:56 +0800 Message-Id: <20190916102556.16655-3-biwen.li@nxp.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190916102556.16655-1-biwen.li@nxp.com> References: <20190916102556.16655-1-biwen.li@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190916_033628_232075_A40E2671 X-CRM114-Status: UNSURE ( 7.82 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [92.121.34.21 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Biwen Li MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The 'fsl,rcpm-scfg' property is used to fix a bug that FlexTimer cannot wakeup system in deep sleep on LS1021A Signed-off-by: Biwen Li --- .../devicetree/bindings/soc/fsl/rcpm.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Documentation/devicetree/bindings/soc/fsl/rcpm.txt b/Documentation/devicetree/bindings/soc/fsl/rcpm.txt index 5a33619d881d..31e22f092b51 100644 --- a/Documentation/devicetree/bindings/soc/fsl/rcpm.txt +++ b/Documentation/devicetree/bindings/soc/fsl/rcpm.txt @@ -34,6 +34,12 @@ Chassis Version Example Chips Optional properties: - little-endian : RCPM register block is Little Endian. Without it RCPM will be Big Endian (default case). + - fsl,rcpm-scfg : Must add the property for SoC LS1021A, + Must include n + 1 entries (n = #fsl,rcpm-wakeup-cells, such as: + #fsl,rcpm-wakeup-cells equal to 2, then must include 2 + 1 entries). + The first entry must be a link to the SCFG device node. + The non-first entry must be offset of registers of SCFG. + (Currently only support SoC LS1021A) Example: The RCPM node for T4240: @@ -43,6 +49,15 @@ The RCPM node for T4240: #fsl,rcpm-wakeup-cells = <2>; }; +The RCPM node for LS1021A: + rcpm: rcpm@1ee2140 { + compatible = "fsl,ls1021a-rcpm", "fsl,qoriq-rcpm-2.1+"; + reg = <0x0 0x1ee2140 0x0 0x8>; + #fsl,rcpm-wakeup-cells = <2>; + fsl,rcpm-scfg = <&scfg 0x0 0x51c>; /* SCFG_SPARECR8 */ + }; + + * Freescale RCPM Wakeup Source Device Tree Bindings ------------------------------------------- Required fsl,rcpm-wakeup property should be added to a device node if the device