From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A47EDC49ED7 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 7403C206A4 for ; Mon, 16 Sep 2019 10:37:21 +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 7403C206A4 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+infradead-linux-arm-kernel=archiver.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-Tj; Mon, 16 Sep 2019 10:37:21 +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-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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.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)); -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel