* [PATCH 2/3] ARM: mxc: add mx31pdk Lan9217 support
@ 2009-03-24 6:44 Richard Zhao
2009-03-24 7:58 ` Sascha Hauer
0 siblings, 1 reply; 3+ messages in thread
From: Richard Zhao @ 2009-03-24 6:44 UTC (permalink / raw)
To: kernel; +Cc: linux-arm-kernel, steve.glendinning, netdev
Signed-off-by: Richard Zhao <linuxzsc@gmail.com>
diff --git a/arch/arm/mach-mx3/mx31pdk.c b/arch/arm/mach-mx3/mx31pdk.c
index aa7e3c5..45cef70 100644
--- a/arch/arm/mach-mx3/mx31pdk.c
+++ b/arch/arm/mach-mx3/mx31pdk.c
@@ -32,6 +32,8 @@
#include <mach/board-mx31pdk.h>
#include <mach/imx-uart.h>
#include <mach/iomux-mx3.h>
+#include <linux/platform_device.h>
+#include <linux/smsc911x.h>
#include "devices.h"
#include "3stack-debug.h"
@@ -57,6 +59,43 @@ static inline void mxc_init_imx_uart(void)
mxc_register_device(&mxc_uart_device0, &uart_pdata);
}
+/*lan9217 device*/
+#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
+static struct resource smsc911x_resources[] = {
+ {
+ .start = LAN9217_BASE_ADDR,
+ .end = LAN9217_BASE_ADDR + 0x100,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = LAN9217_IRQ,
+ .end = LAN9217_IRQ,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct smsc911x_platform_config smsc911x_platconfig = {
+ .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
+ .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
+ .flags = SMSC911X_USE_16BIT | SMSC911X_USE_INTERPHY,
+};
+
+static struct platform_device smsc_lan9217_device = {
+ .name = "smsc911x",
+ .id = 0,
+ .num_resources = ARRAY_SIZE(smsc911x_resources),
+ .resource = smsc911x_resources,
+};
+static void mxc_init_enet(void)
+{
+ mxc_register_device(&smsc_lan9217_device, &smsc911x_platconfig);
+}
+#else
+static inline void mxc_init_enet(void)
+{
+}
+#endif
+
static u32 brd_io;
static void mxc_expio_irq_handler(u32 irq, struct irq_desc *desc)
@@ -217,6 +256,7 @@ static void __init mxc_board_init(void)
{
mxc_init_imx_uart();
mxc_expio_init();
+ mxc_init_enet();
}
static void __init mx31pdk_timer_init(void)
--
1.5.6.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/3] ARM: mxc: add mx31pdk Lan9217 support
2009-03-24 6:44 [PATCH 2/3] ARM: mxc: add mx31pdk Lan9217 support Richard Zhao
@ 2009-03-24 7:58 ` Sascha Hauer
2009-03-24 8:59 ` Richard Zhao
0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2009-03-24 7:58 UTC (permalink / raw)
To: Richard Zhao; +Cc: kernel, linux-arm-kernel, steve.glendinning, netdev
On Tue, Mar 24, 2009 at 02:44:41PM +0800, Richard Zhao wrote:
> Signed-off-by: Richard Zhao <linuxzsc@gmail.com>
>
> diff --git a/arch/arm/mach-mx3/mx31pdk.c b/arch/arm/mach-mx3/mx31pdk.c
> index aa7e3c5..45cef70 100644
> --- a/arch/arm/mach-mx3/mx31pdk.c
> +++ b/arch/arm/mach-mx3/mx31pdk.c
> @@ -32,6 +32,8 @@
> #include <mach/board-mx31pdk.h>
> #include <mach/imx-uart.h>
> #include <mach/iomux-mx3.h>
> +#include <linux/platform_device.h>
> +#include <linux/smsc911x.h>
> #include "devices.h"
> #include "3stack-debug.h"
>
> @@ -57,6 +59,43 @@ static inline void mxc_init_imx_uart(void)
> mxc_register_device(&mxc_uart_device0, &uart_pdata);
> }
>
> +/*lan9217 device*/
> +#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
IMO it is not worth to clutter the code with ifdefs just to save some
bytes of binary space, but ok, that's just my two cents.
> +static struct resource smsc911x_resources[] = {
> + {
> + .start = LAN9217_BASE_ADDR,
> + .end = LAN9217_BASE_ADDR + 0x100,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .start = LAN9217_IRQ,
> + .end = LAN9217_IRQ,
> + .flags = IORESOURCE_IRQ,
> + },
> +};
static struct resource smsc911x_resources[] = {
{
.start = LAN9217_BASE_ADDR,
.end = LAN9217_BASE_ADDR + 0x100,
.flags = IORESOURCE_MEM,
},{
.start = LAN9217_IRQ,
.end = LAN9217_IRQ,
.flags = IORESOURCE_IRQ,
},
};
> +
> +static struct smsc911x_platform_config smsc911x_platconfig = {
> + .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
> + .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
> + .flags = SMSC911X_USE_16BIT | SMSC911X_USE_INTERPHY,
> +};
> +
> +static struct platform_device smsc_lan9217_device = {
> + .name = "smsc911x",
> + .id = 0,
> + .num_resources = ARRAY_SIZE(smsc911x_resources),
> + .resource = smsc911x_resources,
> +};
> +static void mxc_init_enet(void)
> +{
> + mxc_register_device(&smsc_lan9217_device, &smsc911x_platconfig);
> +}
> +#else
> +static inline void mxc_init_enet(void)
> +{
> +}
> +#endif
> +
> static u32 brd_io;
>
> static void mxc_expio_irq_handler(u32 irq, struct irq_desc *desc)
> @@ -217,6 +256,7 @@ static void __init mxc_board_init(void)
> {
> mxc_init_imx_uart();
> mxc_expio_init();
> + mxc_init_enet();
> }
>
> static void __init mx31pdk_timer_init(void)
> --
> 1.5.6.3
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/3] ARM: mxc: add mx31pdk Lan9217 support
2009-03-24 7:58 ` Sascha Hauer
@ 2009-03-24 8:59 ` Richard Zhao
0 siblings, 0 replies; 3+ messages in thread
From: Richard Zhao @ 2009-03-24 8:59 UTC (permalink / raw)
To: Richard Zhao, kernel, linux-arm-kernel, steve.glendinning, netdev
On Tue, Mar 24, 2009 at 3:58 PM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> On Tue, Mar 24, 2009 at 02:44:41PM +0800, Richard Zhao wrote:
>> Signed-off-by: Richard Zhao <linuxzsc@gmail.com>
>>
>> diff --git a/arch/arm/mach-mx3/mx31pdk.c b/arch/arm/mach-mx3/mx31pdk.c
>> index aa7e3c5..45cef70 100644
>> --- a/arch/arm/mach-mx3/mx31pdk.c
>> +++ b/arch/arm/mach-mx3/mx31pdk.c
>> @@ -32,6 +32,8 @@
>> #include <mach/board-mx31pdk.h>
>> #include <mach/imx-uart.h>
>> #include <mach/iomux-mx3.h>
>> +#include <linux/platform_device.h>
>> +#include <linux/smsc911x.h>
>> #include "devices.h"
>> #include "3stack-debug.h"
>>
>> @@ -57,6 +59,43 @@ static inline void mxc_init_imx_uart(void)
>> mxc_register_device(&mxc_uart_device0, &uart_pdata);
>> }
>>
>> +/*lan9217 device*/
>> +#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
>
> IMO it is not worth to clutter the code with ifdefs just to save some
> bytes of binary space, but ok, that's just my two cents.
>
Hi Sascha,
ok, I will remove the ifdefs.
Thanks
Richard
>> +static struct resource smsc911x_resources[] = {
>> + {
>> + .start = LAN9217_BASE_ADDR,
>> + .end = LAN9217_BASE_ADDR + 0x100,
>> + .flags = IORESOURCE_MEM,
>> + },
>> + {
>> + .start = LAN9217_IRQ,
>> + .end = LAN9217_IRQ,
>> + .flags = IORESOURCE_IRQ,
>> + },
>> +};
>
> static struct resource smsc911x_resources[] = {
> {
> .start = LAN9217_BASE_ADDR,
> .end = LAN9217_BASE_ADDR + 0x100,
> .flags = IORESOURCE_MEM,
> },{
> .start = LAN9217_IRQ,
> .end = LAN9217_IRQ,
> .flags = IORESOURCE_IRQ,
> },
> };
>
>> +
>> +static struct smsc911x_platform_config smsc911x_platconfig = {
>> + .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
>> + .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
>> + .flags = SMSC911X_USE_16BIT | SMSC911X_USE_INTERPHY,
>> +};
>> +
>> +static struct platform_device smsc_lan9217_device = {
>> + .name = "smsc911x",
>> + .id = 0,
>> + .num_resources = ARRAY_SIZE(smsc911x_resources),
>> + .resource = smsc911x_resources,
>> +};
>> +static void mxc_init_enet(void)
>> +{
>> + mxc_register_device(&smsc_lan9217_device, &smsc911x_platconfig);
>> +}
>> +#else
>> +static inline void mxc_init_enet(void)
>> +{
>> +}
>> +#endif
>> +
>> static u32 brd_io;
>>
>> static void mxc_expio_irq_handler(u32 irq, struct irq_desc *desc)
>> @@ -217,6 +256,7 @@ static void __init mxc_board_init(void)
>> {
>> mxc_init_imx_uart();
>> mxc_expio_init();
>> + mxc_init_enet();
>> }
>>
>> static void __init mx31pdk_timer_init(void)
>> --
>> 1.5.6.3
>>
>
> --
> Pengutronix e.K. | |
> Industrial Linux Solutions | http://www.pengutronix.de/ |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-03-24 8:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-24 6:44 [PATCH 2/3] ARM: mxc: add mx31pdk Lan9217 support Richard Zhao
2009-03-24 7:58 ` Sascha Hauer
2009-03-24 8:59 ` Richard Zhao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).