From: Daniel Mack Date: Wed, 20 May 2009 17:54:35 +0000 (+0200) Subject: ARM: MX3: add lilly-1131 ethernet support X-Git-Tag: firefly_0821_release~13934^2~16^2~12 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=cbaa6ca1f5af59ec8d0d104c1f02b65a6cf0a8aa;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Sascha Hauer --- 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 @@ #include #include #include +#include +#include +#include #include #include @@ -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)