aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/patches-5.4/701-net-0099-sdk_fman-suspend-the-FMan-to-Deep-Sleep-on-PPC-only.patch
blob: 677dbbc07706cbbec319baa75ecffdb1a76b178e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From 2223efd48766e22bbf56ba6000078af9e32c7772 Mon Sep 17 00:00:00 2001
From: Camelia Groza <camelia.groza@nxp.com>
Date: Mon, 17 Dec 2018 15:20:42 +0200
Subject: [PATCH] sdk_fman: suspend the FMan to Deep Sleep on PPC only

The SCFG_FMCLKDPSLPCR register is present on PPC targets only. This
feature does not apply to ARM SoCs.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
---
 .../net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm.c    | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm.c
+++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm.c
@@ -251,7 +251,7 @@ static irqreturn_t fm_irq(int irq, void
 #ifdef CONFIG_PM_SLEEP
     if (fman_get_normal_pending(p_Fm->p_FmFpmRegs) & INTR_EN_WAKEUP)
     {
-        pm_wakeup_event(p_LnxWrpFmDev->dev, 200);        
+        pm_wakeup_event(p_LnxWrpFmDev->dev, 200);
     }
 #endif
     FM_EventIsr(p_LnxWrpFmDev->h_Dev);
@@ -1107,7 +1107,7 @@ static t_Error InitFmDev(t_LnxWrpFmDev
         p_LnxWrpFmDev->fmDevSettings.param.fmMacClkRatio =
             !!(get_rcwsr(4) & 0x1); /* RCW[FM_MAC_RAT1] */
 
-    {   
+    {
     /* T4 Devices ClkRatio is always 1 regardless of RCW[FM_MAC_RAT1] */
         uint32_t svr;
         svr = mfspr(SPRN_SVR);
@@ -1320,7 +1320,7 @@ static const struct of_device_id fm_matc
 MODULE_DEVICE_TABLE(of, fm_match);
 #endif /* !MODULE */
 
-#ifdef CONFIG_PM
+#if defined CONFIG_PM && (defined CONFIG_PPC || defined CONFIG_PPC64)
 
 #define SCFG_FMCLKDPSLPCR_ADDR 0xFFE0FC00C
 #define SCFG_FMCLKDPSLPCR_DS_VAL 0x48402000
@@ -1373,11 +1373,11 @@ static const struct dev_pm_ops fm_pm_ops
 
 #define FM_PM_OPS (&fm_pm_ops)
 
-#else /* CONFIG_PM */
+#else /* CONFIG_PM && (CONFIG_PPC || CONFIG_PPC64) */
 
 #define FM_PM_OPS NULL
 
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM && (CONFIG_PPC || CONFIG_PPC64) */
 
 static struct platform_driver fm_driver = {
     .driver = {