Commit 82c520dc authored by Richard Zhao's avatar Richard Zhao Committed by Sascha Hauer

arm: mx50_rdp: add fec support

Signed-off-by: default avatarRichard Zhao <richard.zhao@freescale.com>
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
parent a929dcf7
...@@ -157,6 +157,7 @@ config MACH_MX50_RDP ...@@ -157,6 +157,7 @@ config MACH_MX50_RDP
select IMX_HAVE_PLATFORM_IMX_UART select IMX_HAVE_PLATFORM_IMX_UART
select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
select IMX_HAVE_PLATFORM_SPI_IMX select IMX_HAVE_PLATFORM_SPI_IMX
select IMX_HAVE_PLATFORM_FEC
help help
Include support for MX50 reference design platform (RDP) board. This Include support for MX50 reference design platform (RDP) board. This
includes specific configurations for the board and its peripherals. includes specific configurations for the board and its peripherals.
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
#include "devices-imx50.h" #include "devices-imx50.h"
#define FEC_EN IMX_GPIO_NR(6, 23)
#define FEC_RESET_B IMX_GPIO_NR(4, 12)
static iomux_v3_cfg_t mx50_rdp_pads[] __initdata = { static iomux_v3_cfg_t mx50_rdp_pads[] __initdata = {
/* SD1 */ /* SD1 */
MX50_PAD_ECSPI2_SS0__GPIO_4_19, MX50_PAD_ECSPI2_SS0__GPIO_4_19,
...@@ -102,7 +105,7 @@ static iomux_v3_cfg_t mx50_rdp_pads[] __initdata = { ...@@ -102,7 +105,7 @@ static iomux_v3_cfg_t mx50_rdp_pads[] __initdata = {
MX50_PAD_I2C3_SCL__USBOTG_OC, MX50_PAD_I2C3_SCL__USBOTG_OC,
MX50_PAD_SSI_RXC__FEC_MDIO, MX50_PAD_SSI_RXC__FEC_MDIO,
MX50_PAD_SSI_RXC__FEC_MDIO, MX50_PAD_SSI_RXFS__FEC_MDC,
MX50_PAD_DISP_D0__FEC_TXCLK, MX50_PAD_DISP_D0__FEC_TXCLK,
MX50_PAD_DISP_D1__FEC_RX_ER, MX50_PAD_DISP_D1__FEC_RX_ER,
MX50_PAD_DISP_D2__FEC_RX_DV, MX50_PAD_DISP_D2__FEC_RX_DV,
...@@ -111,7 +114,6 @@ static iomux_v3_cfg_t mx50_rdp_pads[] __initdata = { ...@@ -111,7 +114,6 @@ static iomux_v3_cfg_t mx50_rdp_pads[] __initdata = {
MX50_PAD_DISP_D5__FEC_TX_EN, MX50_PAD_DISP_D5__FEC_TX_EN,
MX50_PAD_DISP_D6__FEC_TXD1, MX50_PAD_DISP_D6__FEC_TXD1,
MX50_PAD_DISP_D7__FEC_TXD0, MX50_PAD_DISP_D7__FEC_TXD0,
MX50_PAD_SSI_RXFS__FEC_MDC,
MX50_PAD_I2C3_SDA__GPIO_6_23, MX50_PAD_I2C3_SDA__GPIO_6_23,
MX50_PAD_ECSPI1_SCLK__GPIO_4_12, MX50_PAD_ECSPI1_SCLK__GPIO_4_12,
...@@ -168,6 +170,20 @@ static const struct imxuart_platform_data uart_pdata __initconst = { ...@@ -168,6 +170,20 @@ static const struct imxuart_platform_data uart_pdata __initconst = {
.flags = IMXUART_HAVE_RTSCTS, .flags = IMXUART_HAVE_RTSCTS,
}; };
static const struct fec_platform_data fec_data __initconst = {
.phy = PHY_INTERFACE_MODE_RMII,
};
static inline void mx50_rdp_fec_reset(void)
{
gpio_request(FEC_EN, "fec-en");
gpio_direction_output(FEC_EN, 0);
gpio_request(FEC_RESET_B, "fec-reset_b");
gpio_direction_output(FEC_RESET_B, 0);
msleep(1);
gpio_set_value(FEC_RESET_B, 1);
}
/* /*
* Board specific initialization. * Board specific initialization.
*/ */
...@@ -178,6 +194,8 @@ static void __init mx50_rdp_board_init(void) ...@@ -178,6 +194,8 @@ static void __init mx50_rdp_board_init(void)
imx50_add_imx_uart(0, &uart_pdata); imx50_add_imx_uart(0, &uart_pdata);
imx50_add_imx_uart(1, &uart_pdata); imx50_add_imx_uart(1, &uart_pdata);
mx50_rdp_fec_reset();
imx50_add_fec(&fec_data);
} }
static void __init mx50_rdp_timer_init(void) static void __init mx50_rdp_timer_init(void)
......
...@@ -24,3 +24,8 @@ ...@@ -24,3 +24,8 @@
extern const struct imx_imx_uart_1irq_data imx50_imx_uart_data[] __initconst; extern const struct imx_imx_uart_1irq_data imx50_imx_uart_data[] __initconst;
#define imx50_add_imx_uart(id, pdata) \ #define imx50_add_imx_uart(id, pdata) \
imx_add_imx_uart_1irq(&imx50_imx_uart_data[id], pdata) imx_add_imx_uart_1irq(&imx50_imx_uart_data[id], pdata)
extern const struct imx_fec_data imx50_fec_data __initconst;
#define imx50_add_fec(pdata) \
imx_add_fec(&imx50_fec_data, pdata)
...@@ -31,6 +31,11 @@ const struct imx_fec_data imx35_fec_data __initconst = ...@@ -31,6 +31,11 @@ const struct imx_fec_data imx35_fec_data __initconst =
imx_fec_data_entry_single(MX35); imx_fec_data_entry_single(MX35);
#endif #endif
#ifdef CONFIG_SOC_IMX50
const struct imx_fec_data imx50_fec_data __initconst =
imx_fec_data_entry_single(MX50);
#endif
#ifdef CONFIG_SOC_IMX51 #ifdef CONFIG_SOC_IMX51
const struct imx_fec_data imx51_fec_data __initconst = const struct imx_fec_data imx51_fec_data __initconst =
imx_fec_data_entry_single(MX51); imx_fec_data_entry_single(MX51);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment