diff options
Diffstat (limited to 'arch/arm/mach-mxs/mach-mxs.c')
-rw-r--r-- | arch/arm/mach-mxs/mach-mxs.c | 50 |
1 files changed, 1 insertions, 49 deletions
diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c index 6298adb8d335..4ce27b536dc9 100644 --- a/arch/arm/mach-mxs/mach-mxs.c +++ b/arch/arm/mach-mxs/mach-mxs.c | |||
@@ -14,7 +14,6 @@ | |||
14 | #include <linux/clk/mxs.h> | 14 | #include <linux/clk/mxs.h> |
15 | #include <linux/clkdev.h> | 15 | #include <linux/clkdev.h> |
16 | #include <linux/clocksource.h> | 16 | #include <linux/clocksource.h> |
17 | #include <linux/can/platform/flexcan.h> | ||
18 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
19 | #include <linux/err.h> | 18 | #include <linux/err.h> |
20 | #include <linux/gpio.h> | 19 | #include <linux/gpio.h> |
@@ -77,41 +76,6 @@ static inline void __mxs_togl(u32 mask, void __iomem *reg) | |||
77 | __raw_writel(mask, reg + MXS_TOG_ADDR); | 76 | __raw_writel(mask, reg + MXS_TOG_ADDR); |
78 | } | 77 | } |
79 | 78 | ||
80 | /* | ||
81 | * MX28EVK_FLEXCAN_SWITCH is shared between both flexcan controllers | ||
82 | */ | ||
83 | #define MX28EVK_FLEXCAN_SWITCH MXS_GPIO_NR(2, 13) | ||
84 | |||
85 | static int flexcan0_en, flexcan1_en; | ||
86 | |||
87 | static void mx28evk_flexcan_switch(void) | ||
88 | { | ||
89 | if (flexcan0_en || flexcan1_en) | ||
90 | gpio_set_value(MX28EVK_FLEXCAN_SWITCH, 1); | ||
91 | else | ||
92 | gpio_set_value(MX28EVK_FLEXCAN_SWITCH, 0); | ||
93 | } | ||
94 | |||
95 | static void mx28evk_flexcan0_switch(int enable) | ||
96 | { | ||
97 | flexcan0_en = enable; | ||
98 | mx28evk_flexcan_switch(); | ||
99 | } | ||
100 | |||
101 | static void mx28evk_flexcan1_switch(int enable) | ||
102 | { | ||
103 | flexcan1_en = enable; | ||
104 | mx28evk_flexcan_switch(); | ||
105 | } | ||
106 | |||
107 | static struct flexcan_platform_data flexcan_pdata[2]; | ||
108 | |||
109 | static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = { | ||
110 | OF_DEV_AUXDATA("fsl,imx28-flexcan", 0x80032000, NULL, &flexcan_pdata[0]), | ||
111 | OF_DEV_AUXDATA("fsl,imx28-flexcan", 0x80034000, NULL, &flexcan_pdata[1]), | ||
112 | { /* sentinel */ } | ||
113 | }; | ||
114 | |||
115 | #define OCOTP_WORD_OFFSET 0x20 | 79 | #define OCOTP_WORD_OFFSET 0x20 |
116 | #define OCOTP_WORD_COUNT 0x20 | 80 | #define OCOTP_WORD_COUNT 0x20 |
117 | 81 | ||
@@ -271,15 +235,6 @@ static void __init imx28_evk_init(void) | |||
271 | mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0); | 235 | mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0); |
272 | } | 236 | } |
273 | 237 | ||
274 | static void __init imx28_evk_post_init(void) | ||
275 | { | ||
276 | if (!gpio_request_one(MX28EVK_FLEXCAN_SWITCH, GPIOF_DIR_OUT, | ||
277 | "flexcan-switch")) { | ||
278 | flexcan_pdata[0].transceiver_switch = mx28evk_flexcan0_switch; | ||
279 | flexcan_pdata[1].transceiver_switch = mx28evk_flexcan1_switch; | ||
280 | } | ||
281 | } | ||
282 | |||
283 | static int apx4devkit_phy_fixup(struct phy_device *phy) | 238 | static int apx4devkit_phy_fixup(struct phy_device *phy) |
284 | { | 239 | { |
285 | phy->dev_flags |= MICREL_PHY_50MHZ_CLK; | 240 | phy->dev_flags |= MICREL_PHY_50MHZ_CLK; |
@@ -485,13 +440,10 @@ static void __init mxs_machine_init(void) | |||
485 | crystalfontz_init(); | 440 | crystalfontz_init(); |
486 | 441 | ||
487 | of_platform_populate(NULL, of_default_bus_match_table, | 442 | of_platform_populate(NULL, of_default_bus_match_table, |
488 | mxs_auxdata_lookup, parent); | 443 | NULL, parent); |
489 | 444 | ||
490 | if (of_machine_is_compatible("karo,tx28")) | 445 | if (of_machine_is_compatible("karo,tx28")) |
491 | tx28_post_init(); | 446 | tx28_post_init(); |
492 | |||
493 | if (of_machine_is_compatible("fsl,imx28-evk")) | ||
494 | imx28_evk_post_init(); | ||
495 | } | 447 | } |
496 | 448 | ||
497 | #define MX23_CLKCTRL_RESET_OFFSET 0x120 | 449 | #define MX23_CLKCTRL_RESET_OFFSET 0x120 |