diff options
author | Magnus Lilja <lilja.magnus@gmail.com> | 2009-04-14 16:00:07 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-05-07 10:18:36 -0400 |
commit | 3211705f76cccd52cd3f3c2744aef798bf705702 (patch) | |
tree | 211039200927c8d13ba1c55c440c5daae736cfcd /arch/arm/mach-mx3/mx31lite.c | |
parent | c1332616315584d45776a5e664382888513c0fa0 (diff) |
i.MX31: Add ethernet support to i.MX31 Litekit board.
This patch adds the SMSC platform device to the Litekit board.
Signed-off-by: Magnus Lilja <lilja.magnus@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx3/mx31lite.c')
-rw-r--r-- | arch/arm/mach-mx3/mx31lite.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/arch/arm/mach-mx3/mx31lite.c b/arch/arm/mach-mx3/mx31lite.c index abe6ca39853a..74734e50de24 100644 --- a/arch/arm/mach-mx3/mx31lite.c +++ b/arch/arm/mach-mx3/mx31lite.c | |||
@@ -22,6 +22,9 @@ | |||
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
24 | #include <linux/memory.h> | 24 | #include <linux/memory.h> |
25 | #include <linux/platform_device.h> | ||
26 | #include <linux/gpio.h> | ||
27 | #include <linux/smsc911x.h> | ||
25 | 28 | ||
26 | #include <mach/hardware.h> | 29 | #include <mach/hardware.h> |
27 | #include <asm/mach-types.h> | 30 | #include <asm/mach-types.h> |
@@ -34,6 +37,7 @@ | |||
34 | #include <mach/board-mx31lite.h> | 37 | #include <mach/board-mx31lite.h> |
35 | #include <mach/imx-uart.h> | 38 | #include <mach/imx-uart.h> |
36 | #include <mach/iomux-mx3.h> | 39 | #include <mach/iomux-mx3.h> |
40 | #include <mach/irqs.h> | ||
37 | #include "devices.h" | 41 | #include "devices.h" |
38 | 42 | ||
39 | /* | 43 | /* |
@@ -46,12 +50,43 @@ static unsigned int mx31lite_pins[] = { | |||
46 | MX31_PIN_RTS1__RTS1, | 50 | MX31_PIN_RTS1__RTS1, |
47 | MX31_PIN_TXD1__TXD1, | 51 | MX31_PIN_TXD1__TXD1, |
48 | MX31_PIN_RXD1__RXD1, | 52 | MX31_PIN_RXD1__RXD1, |
53 | /* LAN9117 IRQ pin */ | ||
54 | IOMUX_MODE(MX31_PIN_SFS6, IOMUX_CONFIG_GPIO), | ||
49 | }; | 55 | }; |
50 | 56 | ||
51 | static struct imxuart_platform_data uart_pdata = { | 57 | static struct imxuart_platform_data uart_pdata = { |
52 | .flags = IMXUART_HAVE_RTSCTS, | 58 | .flags = IMXUART_HAVE_RTSCTS, |
53 | }; | 59 | }; |
54 | 60 | ||
61 | static struct smsc911x_platform_config smsc911x_config = { | ||
62 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, | ||
63 | .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, | ||
64 | .flags = SMSC911X_USE_16BIT, | ||
65 | }; | ||
66 | |||
67 | static struct resource smsc911x_resources[] = { | ||
68 | [0] = { | ||
69 | .start = CS4_BASE_ADDR, | ||
70 | .end = CS4_BASE_ADDR + 0x100, | ||
71 | .flags = IORESOURCE_MEM, | ||
72 | }, | ||
73 | [1] = { | ||
74 | .start = IOMUX_TO_IRQ(MX31_PIN_SFS6), | ||
75 | .end = IOMUX_TO_IRQ(MX31_PIN_SFS6), | ||
76 | .flags = IORESOURCE_IRQ, | ||
77 | }, | ||
78 | }; | ||
79 | |||
80 | static struct platform_device smsc911x_device = { | ||
81 | .name = "smsc911x", | ||
82 | .id = -1, | ||
83 | .num_resources = ARRAY_SIZE(smsc911x_resources), | ||
84 | .resource = smsc911x_resources, | ||
85 | .dev = { | ||
86 | .platform_data = &smsc911x_config, | ||
87 | }, | ||
88 | }; | ||
89 | |||
55 | /* | 90 | /* |
56 | * This structure defines the MX31 memory map. | 91 | * This structure defines the MX31 memory map. |
57 | */ | 92 | */ |
@@ -87,6 +122,10 @@ static void __init mxc_board_init(void) | |||
87 | "mx31lite"); | 122 | "mx31lite"); |
88 | 123 | ||
89 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 124 | mxc_register_device(&mxc_uart_device0, &uart_pdata); |
125 | |||
126 | /* SMSC9117 IRQ pin */ | ||
127 | gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_SFS6)); | ||
128 | platform_device_register(&smsc911x_device); | ||
90 | } | 129 | } |
91 | 130 | ||
92 | static void __init mx31lite_timer_init(void) | 131 | static void __init mx31lite_timer_init(void) |