diff options
author | Daniel Mack <daniel@caiaq.de> | 2009-05-20 19:54:35 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-05-26 12:31:13 +0200 |
commit | cbaa6ca1f5af59ec8d0d104c1f02b65a6cf0a8aa (patch) | |
tree | 40235e7b1a8e155def1872b4c8dac18916d34710 /arch/arm/mach-mx3 | |
parent | 1bc34f7964b1e8dee8d49d83cba8dad0a010df92 (diff) | |
download | op-kernel-dev-cbaa6ca1f5af59ec8d0d104c1f02b65a6cf0a8aa.zip op-kernel-dev-cbaa6ca1f5af59ec8d0d104c1f02b65a6cf0a8aa.tar.gz |
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 a7d66cb..e533934 100644 --- a/arch/arm/mach-mx3/mx31lilly.c +++ b/arch/arm/mach-mx3/mx31lilly.c @@ -27,6 +27,9 @@ #include <linux/types.h> #include <linux/init.h> #include <linux/clk.h> +#include <linux/platform_device.h> +#include <linux/interrupt.h> +#include <linux/smsc911x.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> @@ -46,6 +49,44 @@ * appropriate baseboard support code. */ +/* SMSC ethernet support */ + +static struct resource smsc91x_resources[] = { + { + .start = CS4_BASE_ADDR, + .end = CS4_BASE_ADDR + 0xffff, + .flags = IORESOURCE_MEM, + }, + { + .start = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0), + .end = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0), + .flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING, + } +}; + +static struct smsc911x_platform_config smsc911x_config = { + .phy_interface = PHY_INTERFACE_MODE_MII, + .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, + .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, + .flags = SMSC911X_USE_32BIT | + SMSC911X_SAVE_MAC_ADDRESS | + SMSC911X_FORCE_INTERNAL_PHY, +}; + +static struct platform_device smsc91x_device = { + .name = "smsc911x", + .id = -1, + .num_resources = ARRAY_SIZE(smsc91x_resources), + .resource = smsc91x_resources, + .dev = { + .platform_data = &smsc911x_config, + } +}; + +static struct platform_device *devices[] __initdata = { + &smsc91x_device, +}; + static int mx31lilly_baseboard; core_param(mx31lilly_baseboard, mx31lilly_baseboard, int, 0444); @@ -61,6 +102,10 @@ static void __init mx31lilly_board_init(void) printk(KERN_ERR "Illegal mx31lilly_baseboard type %d\n", mx31lilly_baseboard); } + + mxc_iomux_alloc_pin(MX31_PIN_CS4__CS4, "Ethernet CS"); + + platform_add_devices(devices, ARRAY_SIZE(devices)); } static void __init mx31lilly_timer_init(void) |