aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2015-01-07 07:39:52 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-08 23:05:19 -0500
commit99b164a66b7c80be69097d19e55dd1f6a5284fd6 (patch)
tree1d109731d6d603c892abdf34a6f16836d51c7c65
parent0bec3b700d106a8b0a34227b2976d1a582f1aab7 (diff)
Revert "ARM: imx: add FEC sleep mode callback function"
i.MX platform maintainer Shawn Guo is not happy with the such commit as explained below [1]: "The GPR difference between SoCs can be encoded in device tree as well. It's pointless to repeat the same code pattern for every single platform, that need to set up GPR bits for enabling magic packet wake up, while the only difference is the register and bit offset. The platform code will become quite messy and unmaintainable if every device driver dump their GPR register setup code into platform. Sorry, but it's NACK from me." This reverts commit 456062b3ec6f5b9 ("ARM: imx: add FEC sleep mode callback function"). [1] http://www.spinics.net/lists/netdev/msg310922.html Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c41
-rw-r--r--arch/arm/mach-imx/mach-imx6sx.c50
2 files changed, 1 insertions, 90 deletions
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 2f7616889c3f..5057d61298b7 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -31,8 +31,6 @@
31#include <linux/micrel_phy.h> 31#include <linux/micrel_phy.h>
32#include <linux/mfd/syscon.h> 32#include <linux/mfd/syscon.h>
33#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h> 33#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
34#include <linux/fec.h>
35#include <linux/netdevice.h>
36#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
37#include <asm/mach/map.h> 35#include <asm/mach/map.h>
38#include <asm/system_misc.h> 36#include <asm/system_misc.h>
@@ -41,35 +39,6 @@
41#include "cpuidle.h" 39#include "cpuidle.h"
42#include "hardware.h" 40#include "hardware.h"
43 41
44static struct fec_platform_data fec_pdata;
45
46static void imx6q_fec_sleep_enable(int enabled)
47{
48 struct regmap *gpr;
49
50 gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
51 if (!IS_ERR(gpr)) {
52 if (enabled)
53 regmap_update_bits(gpr, IOMUXC_GPR13,
54 IMX6Q_GPR13_ENET_STOP_REQ,
55 IMX6Q_GPR13_ENET_STOP_REQ);
56
57 else
58 regmap_update_bits(gpr, IOMUXC_GPR13,
59 IMX6Q_GPR13_ENET_STOP_REQ, 0);
60 } else
61 pr_err("failed to find fsl,imx6q-iomux-gpr regmap\n");
62}
63
64static void __init imx6q_enet_plt_init(void)
65{
66 struct device_node *np;
67
68 np = of_find_node_by_path("/soc/aips-bus@02100000/ethernet@02188000");
69 if (np && of_get_property(np, "fsl,magic-packet", NULL))
70 fec_pdata.sleep_mode_enable = imx6q_fec_sleep_enable;
71}
72
73/* For imx6q sabrelite board: set KSZ9021RN RGMII pad skew */ 42/* For imx6q sabrelite board: set KSZ9021RN RGMII pad skew */
74static int ksz9021rn_phy_fixup(struct phy_device *phydev) 43static int ksz9021rn_phy_fixup(struct phy_device *phydev)
75{ 44{
@@ -292,12 +261,6 @@ static void __init imx6q_axi_init(void)
292 } 261 }
293} 262}
294 263
295/* Add auxdata to pass platform data */
296static const struct of_dev_auxdata imx6q_auxdata_lookup[] __initconst = {
297 OF_DEV_AUXDATA("fsl,imx6q-fec", 0x02188000, NULL, &fec_pdata),
298 { /* sentinel */ }
299};
300
301static void __init imx6q_init_machine(void) 264static void __init imx6q_init_machine(void)
302{ 265{
303 struct device *parent; 266 struct device *parent;
@@ -311,13 +274,11 @@ static void __init imx6q_init_machine(void)
311 274
312 imx6q_enet_phy_init(); 275 imx6q_enet_phy_init();
313 276
314 of_platform_populate(NULL, of_default_bus_match_table, 277 of_platform_populate(NULL, of_default_bus_match_table, NULL, parent);
315 imx6q_auxdata_lookup, parent);
316 278
317 imx_anatop_init(); 279 imx_anatop_init();
318 cpu_is_imx6q() ? imx6q_pm_init() : imx6dl_pm_init(); 280 cpu_is_imx6q() ? imx6q_pm_init() : imx6dl_pm_init();
319 imx6q_1588_init(); 281 imx6q_1588_init();
320 imx6q_enet_plt_init();
321 imx6q_axi_init(); 282 imx6q_axi_init();
322} 283}
323 284
diff --git a/arch/arm/mach-imx/mach-imx6sx.c b/arch/arm/mach-imx/mach-imx6sx.c
index 747b012665f5..7a96c6577234 100644
--- a/arch/arm/mach-imx/mach-imx6sx.c
+++ b/arch/arm/mach-imx/mach-imx6sx.c
@@ -12,62 +12,12 @@
12#include <linux/regmap.h> 12#include <linux/regmap.h>
13#include <linux/mfd/syscon.h> 13#include <linux/mfd/syscon.h>
14#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h> 14#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
15#include <linux/fec.h>
16#include <linux/netdevice.h>
17#include <asm/mach/arch.h> 15#include <asm/mach/arch.h>
18#include <asm/mach/map.h> 16#include <asm/mach/map.h>
19 17
20#include "common.h" 18#include "common.h"
21#include "cpuidle.h" 19#include "cpuidle.h"
22 20
23static struct fec_platform_data fec_pdata[2];
24
25static void imx6sx_fec1_sleep_enable(int enabled)
26{
27 struct regmap *gpr;
28
29 gpr = syscon_regmap_lookup_by_compatible("fsl,imx6sx-iomuxc-gpr");
30 if (!IS_ERR(gpr)) {
31 if (enabled)
32 regmap_update_bits(gpr, IOMUXC_GPR4,
33 IMX6SX_GPR4_FEC_ENET1_STOP_REQ,
34 IMX6SX_GPR4_FEC_ENET1_STOP_REQ);
35 else
36 regmap_update_bits(gpr, IOMUXC_GPR4,
37 IMX6SX_GPR4_FEC_ENET1_STOP_REQ, 0);
38 } else
39 pr_err("failed to find fsl,imx6sx-iomux-gpr regmap\n");
40}
41
42static void imx6sx_fec2_sleep_enable(int enabled)
43{
44 struct regmap *gpr;
45
46 gpr = syscon_regmap_lookup_by_compatible("fsl,imx6sx-iomuxc-gpr");
47 if (!IS_ERR(gpr)) {
48 if (enabled)
49 regmap_update_bits(gpr, IOMUXC_GPR4,
50 IMX6SX_GPR4_FEC_ENET2_STOP_REQ,
51 IMX6SX_GPR4_FEC_ENET2_STOP_REQ);
52 else
53 regmap_update_bits(gpr, IOMUXC_GPR4,
54 IMX6SX_GPR4_FEC_ENET2_STOP_REQ, 0);
55 } else
56 pr_err("failed to find fsl,imx6sx-iomux-gpr regmap\n");
57}
58
59static void __init imx6sx_enet_plt_init(void)
60{
61 struct device_node *np;
62
63 np = of_find_node_by_path("/soc/aips-bus@02100000/ethernet@02188000");
64 if (np && of_get_property(np, "fsl,magic-packet", NULL))
65 fec_pdata[0].sleep_mode_enable = imx6sx_fec1_sleep_enable;
66 np = of_find_node_by_path("/soc/aips-bus@02100000/ethernet@021b4000");
67 if (np && of_get_property(np, "fsl,magic-packet", NULL))
68 fec_pdata[1].sleep_mode_enable = imx6sx_fec2_sleep_enable;
69}
70
71static int ar8031_phy_fixup(struct phy_device *dev) 21static int ar8031_phy_fixup(struct phy_device *dev)
72{ 22{
73 u16 val; 23 u16 val;