aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYong Shen <yong.shen@freescale.com>2011-01-06 23:25:32 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2011-01-07 09:20:53 -0500
commit639047677b2fc931d6874807a7b596a236071015 (patch)
tree639982d5f3e9b1ada971e7b4697dcc36f268e373
parent14c6500e7547704255f94c63fc6016ae5cbed1c9 (diff)
ARM i.MX53: enable fec driver on EVK board
1. Adjust FEC base address name to fit macro definition 2. Add platform data and reset function for FEC Signed-off-by: Yong Shen <yong.shen@freescale.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/mach-mx5/board-mx53_evk.c27
-rw-r--r--arch/arm/mach-mx5/devices-imx53.h4
-rw-r--r--arch/arm/plat-mxc/devices/Kconfig2
-rw-r--r--arch/arm/plat-mxc/devices/platform-fec.c5
-rw-r--r--arch/arm/plat-mxc/include/mach/mx53.h2
5 files changed, 38 insertions, 2 deletions
diff --git a/arch/arm/mach-mx5/board-mx53_evk.c b/arch/arm/mach-mx5/board-mx53_evk.c
index fa97d0d5dd05..8a744ae09f6f 100644
--- a/arch/arm/mach-mx5/board-mx53_evk.c
+++ b/arch/arm/mach-mx5/board-mx53_evk.c
@@ -21,6 +21,9 @@
21 21
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/fec.h>
25#include <linux/delay.h>
26#include <linux/gpio.h>
24#include <mach/common.h> 27#include <mach/common.h>
25#include <mach/hardware.h> 28#include <mach/hardware.h>
26#include <asm/mach-types.h> 29#include <asm/mach-types.h>
@@ -29,6 +32,8 @@
29#include <mach/imx-uart.h> 32#include <mach/imx-uart.h>
30#include <mach/iomux-mx53.h> 33#include <mach/iomux-mx53.h>
31 34
35#define SMD_FEC_PHY_RST IMX_GPIO_NR(7, 6)
36
32#include "crm_regs.h" 37#include "crm_regs.h"
33#include "devices-imx53.h" 38#include "devices-imx53.h"
34 39
@@ -60,11 +65,33 @@ static inline void mx53_evk_init_uart(void)
60 imx53_add_imx_uart(2, &mx53_evk_uart_pdata); 65 imx53_add_imx_uart(2, &mx53_evk_uart_pdata);
61} 66}
62 67
68static inline void mx53_evk_fec_reset(void)
69{
70 int ret;
71
72 /* reset FEC PHY */
73 ret = gpio_request(SMD_FEC_PHY_RST, "fec-phy-reset");
74 if (ret) {
75 printk(KERN_ERR"failed to get GPIO_FEC_PHY_RESET: %d\n", ret);
76 return;
77 }
78 gpio_direction_output(SMD_FEC_PHY_RST, 0);
79 gpio_set_value(SMD_FEC_PHY_RST, 0);
80 msleep(1);
81 gpio_set_value(SMD_FEC_PHY_RST, 1);
82}
83
84static struct fec_platform_data mx53_evk_fec_pdata = {
85 .phy = PHY_INTERFACE_MODE_RMII,
86};
87
63static void __init mx53_evk_board_init(void) 88static void __init mx53_evk_board_init(void)
64{ 89{
65 mxc_iomux_v3_setup_multiple_pads(mx53_evk_pads, 90 mxc_iomux_v3_setup_multiple_pads(mx53_evk_pads,
66 ARRAY_SIZE(mx53_evk_pads)); 91 ARRAY_SIZE(mx53_evk_pads));
67 mx53_evk_init_uart(); 92 mx53_evk_init_uart();
93 mx53_evk_fec_reset();
94 imx53_add_fec(&mx53_evk_fec_pdata);
68} 95}
69 96
70static void __init mx53_evk_timer_init(void) 97static void __init mx53_evk_timer_init(void)
diff --git a/arch/arm/mach-mx5/devices-imx53.h b/arch/arm/mach-mx5/devices-imx53.h
index 9d0ec2507fa6..dbf1989b451d 100644
--- a/arch/arm/mach-mx5/devices-imx53.h
+++ b/arch/arm/mach-mx5/devices-imx53.h
@@ -8,6 +8,10 @@
8#include <mach/mx53.h> 8#include <mach/mx53.h>
9#include <mach/devices-common.h> 9#include <mach/devices-common.h>
10 10
11extern const struct imx_fec_data imx53_fec_data __initconst;
12#define imx53_add_fec(pdata) \
13 imx_add_fec(&imx53_fec_data, pdata)
14
11extern const struct imx_imx_uart_1irq_data imx53_imx_uart_data[] __initconst; 15extern const struct imx_imx_uart_1irq_data imx53_imx_uart_data[] __initconst;
12#define imx53_add_imx_uart(id, pdata) \ 16#define imx53_add_imx_uart(id, pdata) \
13 imx_add_imx_uart_1irq(&imx53_imx_uart_data[id], pdata) 17 imx_add_imx_uart_1irq(&imx53_imx_uart_data[id], pdata)
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig
index 2537166468ac..b9ab1d58b5e7 100644
--- a/arch/arm/plat-mxc/devices/Kconfig
+++ b/arch/arm/plat-mxc/devices/Kconfig
@@ -1,6 +1,6 @@
1config IMX_HAVE_PLATFORM_FEC 1config IMX_HAVE_PLATFORM_FEC
2 bool 2 bool
3 default y if ARCH_MX25 || SOC_IMX27 || SOC_IMX35 || SOC_IMX51 3 default y if ARCH_MX25 || SOC_IMX27 || SOC_IMX35 || SOC_IMX51 || SOC_IMX53
4 4
5config IMX_HAVE_PLATFORM_FLEXCAN 5config IMX_HAVE_PLATFORM_FLEXCAN
6 select HAVE_CAN_FLEXCAN if CAN 6 select HAVE_CAN_FLEXCAN if CAN
diff --git a/arch/arm/plat-mxc/devices/platform-fec.c b/arch/arm/plat-mxc/devices/platform-fec.c
index 269ec78aba77..b50c3517d083 100644
--- a/arch/arm/plat-mxc/devices/platform-fec.c
+++ b/arch/arm/plat-mxc/devices/platform-fec.c
@@ -36,6 +36,11 @@ const struct imx_fec_data imx51_fec_data __initconst =
36 imx_fec_data_entry_single(MX51); 36 imx_fec_data_entry_single(MX51);
37#endif 37#endif
38 38
39#ifdef CONFIG_SOC_IMX53
40const struct imx_fec_data imx53_fec_data __initconst =
41 imx_fec_data_entry_single(MX53);
42#endif
43
39struct platform_device *__init imx_add_fec( 44struct platform_device *__init imx_add_fec(
40 const struct imx_fec_data *data, 45 const struct imx_fec_data *data,
41 const struct fec_platform_data *pdata) 46 const struct fec_platform_data *pdata)
diff --git a/arch/arm/plat-mxc/include/mach/mx53.h b/arch/arm/plat-mxc/include/mach/mx53.h
index 9577cdbf7fad..a35e0c79bf23 100644
--- a/arch/arm/plat-mxc/include/mach/mx53.h
+++ b/arch/arm/plat-mxc/include/mach/mx53.h
@@ -136,7 +136,7 @@
136#define MX53_MIPI_HSC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000DC000) 136#define MX53_MIPI_HSC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000DC000)
137#define MX53_MLB_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000E4000) 137#define MX53_MLB_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000E4000)
138#define MX53_SSI3_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000E8000) 138#define MX53_SSI3_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000E8000)
139#define MX53_MXC_FEC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000EC000) 139#define MX53_FEC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000EC000)
140#define MX53_TVE_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000F0000) 140#define MX53_TVE_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000F0000)
141#define MX53_VPU_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000F4000) 141#define MX53_VPU_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000F4000)
142#define MX53_SAHARA_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000F8000) 142#define MX53_SAHARA_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000F8000)