aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx3/mx31lite.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-mx3/mx31lite.c')
-rw-r--r--arch/arm/mach-mx3/mx31lite.c74
1 files changed, 73 insertions, 1 deletions
diff --git a/arch/arm/mach-mx3/mx31lite.c b/arch/arm/mach-mx3/mx31lite.c
index 894d98cd9941..86fe70fa3e13 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>
@@ -32,11 +35,64 @@
32#include <asm/page.h> 35#include <asm/page.h>
33#include <asm/setup.h> 36#include <asm/setup.h>
34#include <mach/board-mx31lite.h> 37#include <mach/board-mx31lite.h>
38#include <mach/imx-uart.h>
39#include <mach/iomux-mx3.h>
40#include <mach/irqs.h>
41#include <mach/mxc_nand.h>
42#include "devices.h"
35 43
36/* 44/*
37 * This file contains the board-specific initialization routines. 45 * This file contains the board-specific initialization routines.
38 */ 46 */
39 47
48static unsigned int mx31lite_pins[] = {
49 /* UART1 */
50 MX31_PIN_CTS1__CTS1,
51 MX31_PIN_RTS1__RTS1,
52 MX31_PIN_TXD1__TXD1,
53 MX31_PIN_RXD1__RXD1,
54 /* LAN9117 IRQ pin */
55 IOMUX_MODE(MX31_PIN_SFS6, IOMUX_CONFIG_GPIO),
56};
57
58static struct imxuart_platform_data uart_pdata = {
59 .flags = IMXUART_HAVE_RTSCTS,
60};
61
62static struct mxc_nand_platform_data mx31lite_nand_board_info = {
63 .width = 1,
64 .hw_ecc = 1,
65};
66
67static struct smsc911x_platform_config smsc911x_config = {
68 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
69 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
70 .flags = SMSC911X_USE_16BIT,
71};
72
73static struct resource smsc911x_resources[] = {
74 [0] = {
75 .start = CS4_BASE_ADDR,
76 .end = CS4_BASE_ADDR + 0x100,
77 .flags = IORESOURCE_MEM,
78 },
79 [1] = {
80 .start = IOMUX_TO_IRQ(MX31_PIN_SFS6),
81 .end = IOMUX_TO_IRQ(MX31_PIN_SFS6),
82 .flags = IORESOURCE_IRQ,
83 },
84};
85
86static struct platform_device smsc911x_device = {
87 .name = "smsc911x",
88 .id = -1,
89 .num_resources = ARRAY_SIZE(smsc911x_resources),
90 .resource = smsc911x_resources,
91 .dev = {
92 .platform_data = &smsc911x_config,
93 },
94};
95
40/* 96/*
41 * This structure defines the MX31 memory map. 97 * This structure defines the MX31 memory map.
42 */ 98 */
@@ -59,7 +115,7 @@ static struct map_desc mx31lite_io_desc[] __initdata = {
59 */ 115 */
60void __init mx31lite_map_io(void) 116void __init mx31lite_map_io(void)
61{ 117{
62 mxc_map_io(); 118 mx31_map_io();
63 iotable_init(mx31lite_io_desc, ARRAY_SIZE(mx31lite_io_desc)); 119 iotable_init(mx31lite_io_desc, ARRAY_SIZE(mx31lite_io_desc));
64} 120}
65 121
@@ -68,6 +124,22 @@ void __init mx31lite_map_io(void)
68 */ 124 */
69static void __init mxc_board_init(void) 125static void __init mxc_board_init(void)
70{ 126{
127 int ret;
128
129 mxc_iomux_setup_multiple_pins(mx31lite_pins, ARRAY_SIZE(mx31lite_pins),
130 "mx31lite");
131
132 mxc_register_device(&mxc_uart_device0, &uart_pdata);
133 mxc_register_device(&mxc_nand_device, &mx31lite_nand_board_info);
134
135 /* SMSC9117 IRQ pin */
136 ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_SFS6), "sms9117-irq");
137 if (ret)
138 pr_warning("could not get LAN irq gpio\n");
139 else {
140 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_SFS6));
141 platform_device_register(&smsc911x_device);
142 }
71} 143}
72 144
73static void __init mx31lite_timer_init(void) 145static void __init mx31lite_timer_init(void)