<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
Hi all,<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
the linux patches depended by RCPM driver,FlexTimer driver and FlexTimer dts, need apply these patches as follows:<br>
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
1. RCPM driver:<br>
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
<a href="https://patchwork.kernel.org/series/162731/mbox/(https://patchwork.kernel.org/patch/11105279">https://patchwork.kernel.org/series/162731/mbox/(https://patchwork.kernel.org/patch/11105279</a>/)<br>
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
2. FlexTimer dts:<br>
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
<a href="https://lore.kernel.org/patchwork/series/405653/mbox/(https://lore.kernel.org/patchwork/patch/1112493">https://lore.kernel.org/patchwork/series/405653/mbox/(https://lore.kernel.org/patchwork/patch/1112493</a>/)<br>
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
3. FlexTimer driver:<br>
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
<a href="https://patchwork.ozlabs.org/series/124718/mbox/(https://patchwork.ozlabs.org/patch/1145999">https://patchwork.ozlabs.org/series/124718/mbox/(https://patchwork.ozlabs.org/patch/1145999</a>/)<br>
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
<a href="https://patchwork.ozlabs.org/series/126942/mbox/(https://patchwork.ozlabs.org/patch/1152085">https://patchwork.ozlabs.org/series/126942/mbox/(https://patchwork.ozlabs.org/patch/1152085</a>/)<br>
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
4. Adjust drivers/soc/fsl/Makefile:<br>
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
remove the line 'obj-y += ftm_alarm.o' in drivers/soc/fsl/Makefile to resolve a compilation error<br>
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
<span id="x_OutlookSignature">
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
»ρΘ‘ <a href="https://aka.ms/ghei36">Outlook for Android</a></div>
</span><br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Biwen Li <biwen.li@nxp.com><br>
<b>Sent:</b> Tuesday, September 24, 2019 10:45:46 AM<br>
<b>To:</b> Leo Li <leoyang.li@nxp.com>; shawnguo@kernel.org <shawnguo@kernel.org>; robh+dt@kernel.org <robh+dt@kernel.org>; mark.rutland@arm.com <mark.rutland@arm.com>; Ran Wang <ran.wang_1@nxp.com><br>
<b>Cc:</b> linuxppc-dev@lists.ozlabs.org <linuxppc-dev@lists.ozlabs.org>; linux-arm-kernel@lists.infradead.org <linux-arm-kernel@lists.infradead.org>; linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>; devicetree@vger.kernel.org <devicetree@vger.kernel.org>;
 Biwen Li <biwen.li@nxp.com><br>
<b>Subject:</b> [v3,1/3] soc: fsl: handle RCPM errata A-008646 on SoC LS1021A</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:11pt;">
<div class="PlainText">Description:<br>
        - Reading configuration register RCPM_IPPDEXPCR1<br>
          always return zero<br>
<br>
Workaround:<br>
        - Save register RCPM_IPPDEXPCR1's value to<br>
          register SCFG_SPARECR8.(uboot's psci also<br>
          need reading value from the register SCFG_SPARECR8<br>
          to set register RCPM_IPPDEXPCR1)<br>
<br>
Impact:<br>
        - FlexTimer module will cannot wakeup system in<br>
          deep sleep on SoC LS1021A<br>
<br>
Signed-off-by: Biwen Li <biwen.li@nxp.com><br>
---<br>
Change in v3:<br>
        - update commit message<br>
        - rename property name<br>
          fsl,rcpm-scfg -> fsl,ippdexpcr-alt-addr<br>
<br>
Change in v2:<br>
        - fix stype problems<br>
<br>
 drivers/soc/fsl/rcpm.c | 21 +++++++++++++++++++++<br>
 1 file changed, 21 insertions(+)<br>
<br>
diff --git a/drivers/soc/fsl/rcpm.c b/drivers/soc/fsl/rcpm.c<br>
index 82c0ad5e663e..7f42b17d3f29 100644<br>
--- a/drivers/soc/fsl/rcpm.c<br>
+++ b/drivers/soc/fsl/rcpm.c<br>
@@ -13,6 +13,8 @@<br>
 #include <linux/slab.h><br>
 #include <linux/suspend.h><br>
 #include <linux/kernel.h><br>
+#include <linux/regmap.h><br>
+#include <linux/mfd/syscon.h><br>
 <br>
 #define RCPM_WAKEUP_CELL_MAX_SIZE       7<br>
 <br>
@@ -29,6 +31,9 @@ static int rcpm_pm_prepare(struct device *dev)<br>
         struct rcpm             *rcpm;<br>
         u32 value[RCPM_WAKEUP_CELL_MAX_SIZE + 1], tmp;<br>
         int i, ret, idx;<br>
+       struct regmap * scfg_addr_regmap = NULL;<br>
+       u32 reg_offset[RCPM_WAKEUP_CELL_MAX_SIZE + 1];<br>
+       u32 reg_value = 0;<br>
 <br>
         rcpm = dev_get_drvdata(dev);<br>
         if (!rcpm)<br>
@@ -63,6 +68,22 @@ static int rcpm_pm_prepare(struct device *dev)<br>
                                         tmp |= value[i + 1];<br>
                                         iowrite32be(tmp, rcpm->ippdexpcr_base + i * 4);<br>
                                 }<br>
+                               /* Workaround of errata A-008646 on SoC LS1021A: There is a bug of<br>
+                                * register ippdexpcr1. Reading configuration register RCPM_IPPDEXPCR1<br>
+                                * always return zero. So save ippdexpcr1's value to register SCFG_SPARECR8.<br>
+                                * And the value of ippdexpcr1 will be read from SCFG_SPARECR8.<br>
+                                */<br>
+                               scfg_addr_regmap = syscon_regmap_lookup_by_phandle(np, "fsl,ippdexpcr-alt-addr");<br>
+                               if (scfg_addr_regmap) {<br>
+                                       if (of_property_read_u32_array(dev->of_node,<br>
+                                           "fsl,ippdexpcr-alt-addr", reg_offset, rcpm->wakeup_cells + 1)) {<br>
+                                               scfg_addr_regmap = NULL;<br>
+                                               continue;<br>
+                                       }<br>
+                                       regmap_read(scfg_addr_regmap, reg_offset[i + 1], &reg_value);<br>
+                                       /* Write value to register SCFG_SPARECR8 */<br>
+                                       regmap_write(scfg_addr_regmap, reg_offset[i + 1], tmp | reg_value);<br>
+                               }<br>
                         }<br>
                 }<br>
         } while (ws = wakeup_source_get_next(ws));<br>
-- <br>
2.17.1<br>
<br>
</div>
</span></font>
</body>
</html>