diff options
author | Daniel Mack <daniel@caiaq.de> | 2009-05-20 13:54:35 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-05-26 06:31:13 -0400 |
commit | cbaa6ca1f5af59ec8d0d104c1f02b65a6cf0a8aa (patch) | |
tree | 40235e7b1a8e155def1872b4c8dac18916d34710 /arch/arm/mach-mx3 | |
parent | 1bc34f7964b1e8dee8d49d83cba8dad0a010df92 (diff) |
ARM: MX3: add lilly-1131 ethernet support
This adds support for the SMSC911x chip found on the lilly-1131 module.
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx3')
-rw-r--r-- | arch/arm/mach-mx3/mx31lilly.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/arch/arm/mach-mx3/mx31lilly.c b/arch/arm/mach-mx3/mx31lilly.c index a7d66cbbb2fe..e5339341c0ba 100644 --- a/arch/arm/mach-mx3/mx31lilly.c +++ b/arch/arm/mach-mx3/mx31lilly.c | |||
@@ -27,6 +27,9 @@ | |||
27 | #include <linux/types.h> | 27 | #include <linux/types.h> |
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
29 | #include <linux/clk.h> | 29 | #include <linux/clk.h> |
30 | #include <linux/platform_device.h> | ||
31 | #include <linux/interrupt.h> | ||
32 | #include <linux/smsc911x.h> | ||
30 | 33 | ||
31 | #include <asm/mach-types.h> | 34 | #include <asm/mach-types.h> |
32 | #include <asm/mach/arch.h> | 35 | #include <asm/mach/arch.h> |
@@ -46,6 +49,44 @@ | |||
46 | * appropriate baseboard support code. | 49 | * appropriate baseboard support code. |
47 | */ | 50 | */ |
48 | 51 | ||
52 | /* SMSC ethernet support */ | ||
53 | |||
54 | static struct resource smsc91x_resources[] = { | ||
55 | { | ||
56 | .start = CS4_BASE_ADDR, | ||
57 | .end = CS4_BASE_ADDR + 0xffff, | ||
58 | .flags = IORESOURCE_MEM, | ||
59 | }, | ||
60 | { | ||
61 | .start = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0), | ||
62 | .end = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0), | ||
63 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING, | ||
64 | } | ||
65 | }; | ||
66 | |||
67 | static struct smsc911x_platform_config smsc911x_config = { | ||
68 | .phy_interface = PHY_INTERFACE_MODE_MII, | ||
69 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, | ||
70 | .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, | ||
71 | .flags = SMSC911X_USE_32BIT | | ||
72 | SMSC911X_SAVE_MAC_ADDRESS | | ||
73 | SMSC911X_FORCE_INTERNAL_PHY, | ||
74 | }; | ||
75 | |||
76 | static struct platform_device smsc91x_device = { | ||
77 | .name = "smsc911x", | ||
78 | .id = -1, | ||
79 | .num_resources = ARRAY_SIZE(smsc91x_resources), | ||
80 | .resource = smsc91x_resources, | ||
81 | .dev = { | ||
82 | .platform_data = &smsc911x_config, | ||
83 | } | ||
84 | }; | ||
85 | |||
86 | static struct platform_device *devices[] __initdata = { | ||
87 | &smsc91x_device, | ||
88 | }; | ||
89 | |||
49 | static int mx31lilly_baseboard; | 90 | static int mx31lilly_baseboard; |
50 | core_param(mx31lilly_baseboard, mx31lilly_baseboard, int, 0444); | 91 | core_param(mx31lilly_baseboard, mx31lilly_baseboard, int, 0444); |
51 | 92 | ||
@@ -61,6 +102,10 @@ static void __init mx31lilly_board_init(void) | |||
61 | printk(KERN_ERR "Illegal mx31lilly_baseboard type %d\n", | 102 | printk(KERN_ERR "Illegal mx31lilly_baseboard type %d\n", |
62 | mx31lilly_baseboard); | 103 | mx31lilly_baseboard); |
63 | } | 104 | } |
105 | |||
106 | mxc_iomux_alloc_pin(MX31_PIN_CS4__CS4, "Ethernet CS"); | ||
107 | |||
108 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
64 | } | 109 | } |
65 | 110 | ||
66 | static void __init mx31lilly_timer_init(void) | 111 | static void __init mx31lilly_timer_init(void) |