677dbbc07706cbbec319baa75ecffdb1a76b178e
[openwrt/staging/mkresin.git] /
1 From 2223efd48766e22bbf56ba6000078af9e32c7772 Mon Sep 17 00:00:00 2001
2 From: Camelia Groza <camelia.groza@nxp.com>
3 Date: Mon, 17 Dec 2018 15:20:42 +0200
4 Subject: [PATCH] sdk_fman: suspend the FMan to Deep Sleep on PPC only
5
6 The SCFG_FMCLKDPSLPCR register is present on PPC targets only. This
7 feature does not apply to ARM SoCs.
8
9 Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
10 ---
11 .../net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm.c | 10 +++++-----
12 1 file changed, 5 insertions(+), 5 deletions(-)
13
14 --- a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm.c
15 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm.c
16 @@ -251,7 +251,7 @@ static irqreturn_t fm_irq(int irq, void
17 #ifdef CONFIG_PM_SLEEP
18 if (fman_get_normal_pending(p_Fm->p_FmFpmRegs) & INTR_EN_WAKEUP)
19 {
20 - pm_wakeup_event(p_LnxWrpFmDev->dev, 200);
21 + pm_wakeup_event(p_LnxWrpFmDev->dev, 200);
22 }
23 #endif
24 FM_EventIsr(p_LnxWrpFmDev->h_Dev);
25 @@ -1107,7 +1107,7 @@ static t_Error InitFmDev(t_LnxWrpFmDev
26 p_LnxWrpFmDev->fmDevSettings.param.fmMacClkRatio =
27 !!(get_rcwsr(4) & 0x1); /* RCW[FM_MAC_RAT1] */
28
29 - {
30 + {
31 /* T4 Devices ClkRatio is always 1 regardless of RCW[FM_MAC_RAT1] */
32 uint32_t svr;
33 svr = mfspr(SPRN_SVR);
34 @@ -1320,7 +1320,7 @@ static const struct of_device_id fm_matc
35 MODULE_DEVICE_TABLE(of, fm_match);
36 #endif /* !MODULE */
37
38 -#ifdef CONFIG_PM
39 +#if defined CONFIG_PM && (defined CONFIG_PPC || defined CONFIG_PPC64)
40
41 #define SCFG_FMCLKDPSLPCR_ADDR 0xFFE0FC00C
42 #define SCFG_FMCLKDPSLPCR_DS_VAL 0x48402000
43 @@ -1373,11 +1373,11 @@ static const struct dev_pm_ops fm_pm_ops
44
45 #define FM_PM_OPS (&fm_pm_ops)
46
47 -#else /* CONFIG_PM */
48 +#else /* CONFIG_PM && (CONFIG_PPC || CONFIG_PPC64) */
49
50 #define FM_PM_OPS NULL
51
52 -#endif /* CONFIG_PM */
53 +#endif /* CONFIG_PM && (CONFIG_PPC || CONFIG_PPC64) */
54
55 static struct platform_driver fm_driver = {
56 .driver = {