All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] OMAP2EVM: add ethernet support (smc911x)
@ 2008-06-24 12:04 Arun KS
  2008-06-24 12:12 ` Felipe Balbi
  0 siblings, 1 reply; 11+ messages in thread
From: Arun KS @ 2008-06-24 12:04 UTC (permalink / raw)
  To: linux-omap

[-- Attachment #1: Type: text/plain, Size: 2948 bytes --]

>From 58efa8d0019a7f777aaad2d43afb05170df25fae Mon Sep 17 00:00:00 2001
From: Arun KS <arunks@mistralsolutions.com>
Date: Tue, 24 Jun 2008 16:01:32 +0530
Subject: [PATCH] OMAP2EVM:  Adding ethernet support

OMAP2EVM: add ethernet support (smc911x)

Signed-off-by: Arun KS <arunks@mistralsolutions.com>
---
 arch/arm/mach-omap2/board-omap2evm.c       |   37 ++++++++++++++++++++++++++++
 include/asm-arm/arch-omap/board-omap2evm.h |    5 ++-
 2 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap2evm.c
b/arch/arm/mach-omap2/board-omap2evm.c
index d00e502..e9a2cef 100644
--- a/arch/arm/mach-omap2/board-omap2evm.c
+++ b/arch/arm/mach-omap2/board-omap2evm.c
@@ -27,11 +27,43 @@
 #include <asm/arch/board.h>
 #include <asm/arch/common.h>

+static struct resource omap2evm_smc911x_resources[] = {
+   [0] =   {
+       .start  = OMAP2EVM_ETHR_START,
+       .end    = (OMAP2EVM_ETHR_START + OMAP2EVM_ETHR_SIZE - 1),
+       .flags  = IORESOURCE_MEM,
+   },
+   [1] =   {
+       .start  = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
+       .end    = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
+       .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct platform_device omap2evm_smc911x_device = {
+   .name       = "smc911x",
+   .id     = -1,
+   .num_resources  = ARRAY_SIZE(omap2evm_smc911x_resources),
+   .resource   = &omap2evm_smc911x_resources [0],
+};
+
+static inline void __init omap2evm_init_smc911x(void)
+{
+    if (omap_request_gpio(OMAP2EVM_ETHR_GPIO_IRQ) < 0) {
+       printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n",
+       OMAP2EVM_ETHR_GPIO_IRQ);
+       return;
+    }
+
+    omap_set_gpio_direction(OMAP2EVM_ETHR_GPIO_IRQ, 1);
+}
+
 static void __init omap2_evm_init_irq(void)
 {
    omap2_init_common_hw();
    omap_init_irq();
    omap_gpio_init();
+   omap2evm_init_smc911x();
 }

 static struct omap_uart_config omap2_evm_uart_config __initdata = {
@@ -53,8 +85,13 @@ static int __init omap2_evm_i2c_init(void)
    return 0;
 }

+static struct platform_device *omap2_evm_devices[] __initdata = {
+    &omap2evm_smc911x_device,
+};
+
 static void __init omap2_evm_init(void)
 {
+   platform_add_devices(omap2_evm_devices, ARRAY_SIZE(omap2_evm_devices));
    omap_board_config = omap2_evm_config;
    omap_board_config_size = ARRAY_SIZE(omap2_evm_config);
    omap_serial_init();
diff --git a/include/asm-arm/arch-omap/board-omap2evm.h
b/include/asm-arm/arch-omap/board-omap2evm.h
index 98273a9..d770c58 100644
--- a/include/asm-arm/arch-omap/board-omap2evm.h
+++ b/include/asm-arm/arch-omap/board-omap2evm.h
@@ -30,7 +30,8 @@
 #define __ASM_ARCH_OMAP2_EVM_H

 /* Placeholder for OMAP2EVM specific defines */
-#define OMAP24XX_ETHR_START        0x08000300
-#define OMAP24XX_ETHR_GPIO_IRQ     149
+#define OMAP2EVM_ETHR_START            0x2c000000
+#define OMAP2EVM_ETHR_SIZE         1024
+#define OMAP2EVM_ETHR_GPIO_IRQ     149

 #endif /* __ASM_ARCH_OMAP2_EVM_H */
--
1.5.3.4

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-OMAP2EVM-Adding-ethernet-support.patch --]
[-- Type: text/x-patch; name=0001-OMAP2EVM-Adding-ethernet-support.patch, Size: 2847 bytes --]

From 58efa8d0019a7f777aaad2d43afb05170df25fae Mon Sep 17 00:00:00 2001
From: Arun KS <arunks@mistralsolutions.com>
Date: Tue, 24 Jun 2008 16:01:32 +0530
Subject: [PATCH] OMAP2EVM:	Adding ethernet support

OMAP2EVM: add ethernet support (smc911x)

Signed-off-by: Arun KS <arunks@mistralsolutions.com>
---
 arch/arm/mach-omap2/board-omap2evm.c       |   37 ++++++++++++++++++++++++++++
 include/asm-arm/arch-omap/board-omap2evm.h |    5 ++-
 2 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap2evm.c b/arch/arm/mach-omap2/board-omap2evm.c
index d00e502..e9a2cef 100644
--- a/arch/arm/mach-omap2/board-omap2evm.c
+++ b/arch/arm/mach-omap2/board-omap2evm.c
@@ -27,11 +27,43 @@
 #include <asm/arch/board.h>
 #include <asm/arch/common.h>
 
+static struct resource omap2evm_smc911x_resources[] = {
+	[0] =   {
+		.start  = OMAP2EVM_ETHR_START,
+		.end    = (OMAP2EVM_ETHR_START + OMAP2EVM_ETHR_SIZE - 1),
+		.flags  = IORESOURCE_MEM,
+	},
+	[1] =   {
+		.start  = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
+		.end    = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device omap2evm_smc911x_device = {
+	.name       = "smc911x",
+	.id     = -1,
+	.num_resources  = ARRAY_SIZE(omap2evm_smc911x_resources),
+	.resource   = &omap2evm_smc911x_resources [0],
+};
+
+static inline void __init omap2evm_init_smc911x(void)
+{
+    if (omap_request_gpio(OMAP2EVM_ETHR_GPIO_IRQ) < 0) {
+		printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n",
+		OMAP2EVM_ETHR_GPIO_IRQ);
+		return;
+    }
+
+    omap_set_gpio_direction(OMAP2EVM_ETHR_GPIO_IRQ, 1);
+}
+
 static void __init omap2_evm_init_irq(void)
 {
 	omap2_init_common_hw();
 	omap_init_irq();
 	omap_gpio_init();
+	omap2evm_init_smc911x();
 }
 
 static struct omap_uart_config omap2_evm_uart_config __initdata = {
@@ -53,8 +85,13 @@ static int __init omap2_evm_i2c_init(void)
 	return 0;
 }
 
+static struct platform_device *omap2_evm_devices[] __initdata = {
+    &omap2evm_smc911x_device,
+};
+
 static void __init omap2_evm_init(void)
 {
+	platform_add_devices(omap2_evm_devices, ARRAY_SIZE(omap2_evm_devices));
 	omap_board_config = omap2_evm_config;
 	omap_board_config_size = ARRAY_SIZE(omap2_evm_config);
 	omap_serial_init();
diff --git a/include/asm-arm/arch-omap/board-omap2evm.h b/include/asm-arm/arch-omap/board-omap2evm.h
index 98273a9..d770c58 100644
--- a/include/asm-arm/arch-omap/board-omap2evm.h
+++ b/include/asm-arm/arch-omap/board-omap2evm.h
@@ -30,7 +30,8 @@
 #define __ASM_ARCH_OMAP2_EVM_H
 
 /* Placeholder for OMAP2EVM specific defines */
-#define OMAP24XX_ETHR_START		0x08000300
-#define OMAP24XX_ETHR_GPIO_IRQ		149
+#define OMAP2EVM_ETHR_START			0x2c000000
+#define OMAP2EVM_ETHR_SIZE			1024
+#define OMAP2EVM_ETHR_GPIO_IRQ		149
 
 #endif /* __ASM_ARCH_OMAP2_EVM_H */
-- 
1.5.3.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] OMAP2EVM: add ethernet support (smc911x)
  2008-06-24 12:04 [PATCH 1/3] OMAP2EVM: add ethernet support (smc911x) Arun KS
@ 2008-06-24 12:12 ` Felipe Balbi
  2008-06-24 12:29   ` Arun KS
  2008-06-24 12:54   ` Arun KS
  0 siblings, 2 replies; 11+ messages in thread
From: Felipe Balbi @ 2008-06-24 12:12 UTC (permalink / raw)
  To: Arun KS; +Cc: linux-omap



On Tue, 24 Jun 2008 17:34:59 +0530, "Arun KS" <getarunks@gmail.com> wrote:
> From 58efa8d0019a7f777aaad2d43afb05170df25fae Mon Sep 17 00:00:00 2001
> From: Arun KS <arunks@mistralsolutions.com>
> Date: Tue, 24 Jun 2008 16:01:32 +0530
> Subject: [PATCH] OMAP2EVM:  Adding ethernet support
> 
> OMAP2EVM: add ethernet support (smc911x)
> 
> Signed-off-by: Arun KS <arunks@mistralsolutions.com>
> ---
>  arch/arm/mach-omap2/board-omap2evm.c       |   37
> ++++++++++++++++++++++++++++
>  include/asm-arm/arch-omap/board-omap2evm.h |    5 ++-
>  2 files changed, 40 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-omap2evm.c
> b/arch/arm/mach-omap2/board-omap2evm.c
> index d00e502..e9a2cef 100644
> --- a/arch/arm/mach-omap2/board-omap2evm.c
> +++ b/arch/arm/mach-omap2/board-omap2evm.c
> @@ -27,11 +27,43 @@
>  #include <asm/arch/board.h>
>  #include <asm/arch/common.h>
> 
> +static struct resource omap2evm_smc911x_resources[] = {
> +   [0] =   {
> +       .start  = OMAP2EVM_ETHR_START,
> +       .end    = (OMAP2EVM_ETHR_START + OMAP2EVM_ETHR_SIZE - 1),
> +       .flags  = IORESOURCE_MEM,
> +   },
> +   [1] =   {
> +       .start  = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
> +       .end    = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
> +       .flags  = IORESOURCE_IRQ,

it looks like drivers/net/smc911x doesn't use IORESOURCE_IRQ, am I
misreading it ?

> +   },
> +};
> +
> +static struct platform_device omap2evm_smc911x_device = {
> +   .name       = "smc911x",
> +   .id     = -1,
> +   .num_resources  = ARRAY_SIZE(omap2evm_smc911x_resources),
> +   .resource   = &omap2evm_smc911x_resources [0],
> +};
> +
> +static inline void __init omap2evm_init_smc911x(void)
> +{
> +    if (omap_request_gpio(OMAP2EVM_ETHR_GPIO_IRQ) < 0) {
> +       printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n",
> +       OMAP2EVM_ETHR_GPIO_IRQ);
> +       return;
> +    }
> +
> +    omap_set_gpio_direction(OMAP2EVM_ETHR_GPIO_IRQ, 1);

please use gpiolib ;-)

> +}
> +
>  static void __init omap2_evm_init_irq(void)
>  {
>     omap2_init_common_hw();
>     omap_init_irq();
>     omap_gpio_init();
> +   omap2evm_init_smc911x();
>  }
> 
>  static struct omap_uart_config omap2_evm_uart_config __initdata = {
> @@ -53,8 +85,13 @@ static int __init omap2_evm_i2c_init(void)
>     return 0;
>  }
> 
> +static struct platform_device *omap2_evm_devices[] __initdata = {
> +    &omap2evm_smc911x_device,
> +};
> +
>  static void __init omap2_evm_init(void)
>  {
> +   platform_add_devices(omap2_evm_devices,
> ARRAY_SIZE(omap2_evm_devices));
>     omap_board_config = omap2_evm_config;
>     omap_board_config_size = ARRAY_SIZE(omap2_evm_config);
>     omap_serial_init();
> diff --git a/include/asm-arm/arch-omap/board-omap2evm.h
> b/include/asm-arm/arch-omap/board-omap2evm.h
> index 98273a9..d770c58 100644
> --- a/include/asm-arm/arch-omap/board-omap2evm.h
> +++ b/include/asm-arm/arch-omap/board-omap2evm.h
> @@ -30,7 +30,8 @@
>  #define __ASM_ARCH_OMAP2_EVM_H
> 
>  /* Placeholder for OMAP2EVM specific defines */
> -#define OMAP24XX_ETHR_START        0x08000300
> -#define OMAP24XX_ETHR_GPIO_IRQ     149
> +#define OMAP2EVM_ETHR_START            0x2c000000
> +#define OMAP2EVM_ETHR_SIZE         1024
> +#define OMAP2EVM_ETHR_GPIO_IRQ     149
> 
>  #endif /* __ASM_ARCH_OMAP2_EVM_H */
> --
> 1.5.3.4
-- 
Best Regards,

Felipe Balbi
http://felipebalbi.com
me@felipebalbi.com


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] OMAP2EVM: add ethernet support (smc911x)
  2008-06-24 12:12 ` Felipe Balbi
@ 2008-06-24 12:29   ` Arun KS
  2008-06-24 12:54   ` Arun KS
  1 sibling, 0 replies; 11+ messages in thread
From: Arun KS @ 2008-06-24 12:29 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: linux-omap

Hi Felipe,

I will do the changes and resend the patches.

Best Regards,
Arun

On Tue, Jun 24, 2008 at 5:42 PM, Felipe Balbi <me@felipebalbi.com> wrote:
>
>
> On Tue, 24 Jun 2008 17:34:59 +0530, "Arun KS" <getarunks@gmail.com> wrote:
>> From 58efa8d0019a7f777aaad2d43afb05170df25fae Mon Sep 17 00:00:00 2001
>> From: Arun KS <arunks@mistralsolutions.com>
>> Date: Tue, 24 Jun 2008 16:01:32 +0530
>> Subject: [PATCH] OMAP2EVM:  Adding ethernet support
>>
>> OMAP2EVM: add ethernet support (smc911x)
>>
>> Signed-off-by: Arun KS <arunks@mistralsolutions.com>
>> ---
>>  arch/arm/mach-omap2/board-omap2evm.c       |   37
>> ++++++++++++++++++++++++++++
>>  include/asm-arm/arch-omap/board-omap2evm.h |    5 ++-
>>  2 files changed, 40 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/board-omap2evm.c
>> b/arch/arm/mach-omap2/board-omap2evm.c
>> index d00e502..e9a2cef 100644
>> --- a/arch/arm/mach-omap2/board-omap2evm.c
>> +++ b/arch/arm/mach-omap2/board-omap2evm.c
>> @@ -27,11 +27,43 @@
>>  #include <asm/arch/board.h>
>>  #include <asm/arch/common.h>
>>
>> +static struct resource omap2evm_smc911x_resources[] = {
>> +   [0] =   {
>> +       .start  = OMAP2EVM_ETHR_START,
>> +       .end    = (OMAP2EVM_ETHR_START + OMAP2EVM_ETHR_SIZE - 1),
>> +       .flags  = IORESOURCE_MEM,
>> +   },
>> +   [1] =   {
>> +       .start  = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
>> +       .end    = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
>> +       .flags  = IORESOURCE_IRQ,
>
> it looks like drivers/net/smc911x doesn't use IORESOURCE_IRQ, am I
> misreading it ?
>
>> +   },
>> +};
>> +
>> +static struct platform_device omap2evm_smc911x_device = {
>> +   .name       = "smc911x",
>> +   .id     = -1,
>> +   .num_resources  = ARRAY_SIZE(omap2evm_smc911x_resources),
>> +   .resource   = &omap2evm_smc911x_resources [0],
>> +};
>> +
>> +static inline void __init omap2evm_init_smc911x(void)
>> +{
>> +    if (omap_request_gpio(OMAP2EVM_ETHR_GPIO_IRQ) < 0) {
>> +       printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n",
>> +       OMAP2EVM_ETHR_GPIO_IRQ);
>> +       return;
>> +    }
>> +
>> +    omap_set_gpio_direction(OMAP2EVM_ETHR_GPIO_IRQ, 1);
>
> please use gpiolib ;-)
>
>> +}
>> +
>>  static void __init omap2_evm_init_irq(void)
>>  {
>>     omap2_init_common_hw();
>>     omap_init_irq();
>>     omap_gpio_init();
>> +   omap2evm_init_smc911x();
>>  }
>>
>>  static struct omap_uart_config omap2_evm_uart_config __initdata = {
>> @@ -53,8 +85,13 @@ static int __init omap2_evm_i2c_init(void)
>>     return 0;
>>  }
>>
>> +static struct platform_device *omap2_evm_devices[] __initdata = {
>> +    &omap2evm_smc911x_device,
>> +};
>> +
>>  static void __init omap2_evm_init(void)
>>  {
>> +   platform_add_devices(omap2_evm_devices,
>> ARRAY_SIZE(omap2_evm_devices));
>>     omap_board_config = omap2_evm_config;
>>     omap_board_config_size = ARRAY_SIZE(omap2_evm_config);
>>     omap_serial_init();
>> diff --git a/include/asm-arm/arch-omap/board-omap2evm.h
>> b/include/asm-arm/arch-omap/board-omap2evm.h
>> index 98273a9..d770c58 100644
>> --- a/include/asm-arm/arch-omap/board-omap2evm.h
>> +++ b/include/asm-arm/arch-omap/board-omap2evm.h
>> @@ -30,7 +30,8 @@
>>  #define __ASM_ARCH_OMAP2_EVM_H
>>
>>  /* Placeholder for OMAP2EVM specific defines */
>> -#define OMAP24XX_ETHR_START        0x08000300
>> -#define OMAP24XX_ETHR_GPIO_IRQ     149
>> +#define OMAP2EVM_ETHR_START            0x2c000000
>> +#define OMAP2EVM_ETHR_SIZE         1024
>> +#define OMAP2EVM_ETHR_GPIO_IRQ     149
>>
>>  #endif /* __ASM_ARCH_OMAP2_EVM_H */
>> --
>> 1.5.3.4
> --
> Best Regards,
>
> Felipe Balbi
> http://felipebalbi.com
> me@felipebalbi.com
>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] OMAP2EVM: add ethernet support (smc911x)
  2008-06-24 12:12 ` Felipe Balbi
  2008-06-24 12:29   ` Arun KS
@ 2008-06-24 12:54   ` Arun KS
  2008-06-24 12:57     ` Felipe Balbi
  1 sibling, 1 reply; 11+ messages in thread
From: Arun KS @ 2008-06-24 12:54 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: linux-omap

On Tue, Jun 24, 2008 at 5:42 PM, Felipe Balbi <me@felipebalbi.com> wrote:
>
>
> On Tue, 24 Jun 2008 17:34:59 +0530, "Arun KS" <getarunks@gmail.com> wrote:
>> From 58efa8d0019a7f777aaad2d43afb05170df25fae Mon Sep 17 00:00:00 2001
>> From: Arun KS <arunks@mistralsolutions.com>
>> Date: Tue, 24 Jun 2008 16:01:32 +0530
>> Subject: [PATCH] OMAP2EVM:  Adding ethernet support
>>
>> OMAP2EVM: add ethernet support (smc911x)
>>
>> Signed-off-by: Arun KS <arunks@mistralsolutions.com>
>> ---
>>  arch/arm/mach-omap2/board-omap2evm.c       |   37
>> ++++++++++++++++++++++++++++
>>  include/asm-arm/arch-omap/board-omap2evm.h |    5 ++-
>>  2 files changed, 40 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/board-omap2evm.c
>> b/arch/arm/mach-omap2/board-omap2evm.c
>> index d00e502..e9a2cef 100644
>> --- a/arch/arm/mach-omap2/board-omap2evm.c
>> +++ b/arch/arm/mach-omap2/board-omap2evm.c
>> @@ -27,11 +27,43 @@
>>  #include <asm/arch/board.h>
>>  #include <asm/arch/common.h>
>>
>> +static struct resource omap2evm_smc911x_resources[] = {
>> +   [0] =   {
>> +       .start  = OMAP2EVM_ETHR_START,
>> +       .end    = (OMAP2EVM_ETHR_START + OMAP2EVM_ETHR_SIZE - 1),
>> +       .flags  = IORESOURCE_MEM,
>> +   },
>> +   [1] =   {
>> +       .start  = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
>> +       .end    = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
>> +       .flags  = IORESOURCE_IRQ,
>
> it looks like drivers/net/smc911x doesn't use IORESOURCE_IRQ, am I
> misreading it ?
>

Yes this driver uses platform_get_irq(pdev, 0) to get its irq number.
>> +   },
>> +};
>> +
>> +static struct platform_device omap2evm_smc911x_device = {
>> +   .name       = "smc911x",
>> +   .id     = -1,
>> +   .num_resources  = ARRAY_SIZE(omap2evm_smc911x_resources),
>> +   .resource   = &omap2evm_smc911x_resources [0],
>> +};
>> +
>> +static inline void __init omap2evm_init_smc911x(void)
>> +{
>> +    if (omap_request_gpio(OMAP2EVM_ETHR_GPIO_IRQ) < 0) {
>> +       printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n",
>> +       OMAP2EVM_ETHR_GPIO_IRQ);
>> +       return;
>> +    }
>> +
>> +    omap_set_gpio_direction(OMAP2EVM_ETHR_GPIO_IRQ, 1);
>
> please use gpiolib ;-)
>
>> +}
>> +
>>  static void __init omap2_evm_init_irq(void)
>>  {
>>     omap2_init_common_hw();
>>     omap_init_irq();
>>     omap_gpio_init();
>> +   omap2evm_init_smc911x();
>>  }
>>
>>  static struct omap_uart_config omap2_evm_uart_config __initdata = {
>> @@ -53,8 +85,13 @@ static int __init omap2_evm_i2c_init(void)
>>     return 0;
>>  }
>>
>> +static struct platform_device *omap2_evm_devices[] __initdata = {
>> +    &omap2evm_smc911x_device,
>> +};
>> +
>>  static void __init omap2_evm_init(void)
>>  {
>> +   platform_add_devices(omap2_evm_devices,
>> ARRAY_SIZE(omap2_evm_devices));
>>     omap_board_config = omap2_evm_config;
>>     omap_board_config_size = ARRAY_SIZE(omap2_evm_config);
>>     omap_serial_init();
>> diff --git a/include/asm-arm/arch-omap/board-omap2evm.h
>> b/include/asm-arm/arch-omap/board-omap2evm.h
>> index 98273a9..d770c58 100644
>> --- a/include/asm-arm/arch-omap/board-omap2evm.h
>> +++ b/include/asm-arm/arch-omap/board-omap2evm.h
>> @@ -30,7 +30,8 @@
>>  #define __ASM_ARCH_OMAP2_EVM_H
>>
>>  /* Placeholder for OMAP2EVM specific defines */
>> -#define OMAP24XX_ETHR_START        0x08000300
>> -#define OMAP24XX_ETHR_GPIO_IRQ     149
>> +#define OMAP2EVM_ETHR_START            0x2c000000
>> +#define OMAP2EVM_ETHR_SIZE         1024
>> +#define OMAP2EVM_ETHR_GPIO_IRQ     149
>>
>>  #endif /* __ASM_ARCH_OMAP2_EVM_H */
>> --
>> 1.5.3.4
> --
> Best Regards,
>
> Felipe Balbi
> http://felipebalbi.com
> me@felipebalbi.com
>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] OMAP2EVM: add ethernet support (smc911x)
  2008-06-24 12:54   ` Arun KS
@ 2008-06-24 12:57     ` Felipe Balbi
  2008-06-24 13:25       ` [Resend] " Arun KS
  0 siblings, 1 reply; 11+ messages in thread
From: Felipe Balbi @ 2008-06-24 12:57 UTC (permalink / raw)
  To: Arun KS; +Cc: linux-omap



On Tue, 24 Jun 2008 18:24:11 +0530, "Arun KS" <getarunks@gmail.com> wrote:

>> it looks like drivers/net/smc911x doesn't use IORESOURCE_IRQ, am I
>> misreading it ?
>>
> 
> Yes this driver uses platform_get_irq(pdev, 0) to get its irq number.

Cool, thanks :-)

-- 
Best Regards,

Felipe Balbi
http://felipebalbi.com
me@felipebalbi.com


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Resend] [PATCH 1/3] OMAP2EVM: add ethernet support (smc911x)
  2008-06-24 12:57     ` Felipe Balbi
@ 2008-06-24 13:25       ` Arun KS
  2008-06-24 14:18         ` Felipe Balbi
  0 siblings, 1 reply; 11+ messages in thread
From: Arun KS @ 2008-06-24 13:25 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: linux-omap

[-- Attachment #1: Type: text/plain, Size: 2915 bytes --]

OMAP2EVM: Add ethernet support (smc911x)

Signed-off-by: Arun KS <arunks@mistralsolutions.com>
---
 arch/arm/mach-omap2/board-omap2evm.c       |   39 ++++++++++++++++++++++++++++
 include/asm-arm/arch-omap/board-omap2evm.h |    5 ++-
 2 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap2evm.c
b/arch/arm/mach-omap2/board-omap2evm.c
index d00e502..61f6b1e 100644
--- a/arch/arm/mach-omap2/board-omap2evm.c
+++ b/arch/arm/mach-omap2/board-omap2evm.c
@@ -27,11 +27,45 @@
 #include <asm/arch/board.h>
 #include <asm/arch/common.h>

+static struct resource omap2evm_smc911x_resources[] = {
+       [0] =   {
+               .start  = OMAP2EVM_ETHR_START,
+               .end    = (OMAP2EVM_ETHR_START + OMAP2EVM_ETHR_SIZE - 1),
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] =   {
+               .start  = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
+               .end    = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device omap2evm_smc911x_device = {
+       .name       = "smc911x",
+       .id     = -1,
+       .num_resources  = ARRAY_SIZE(omap2evm_smc911x_resources),
+       .resource   = &omap2evm_smc911x_resources [0],
+};
+
+static inline void __init omap2evm_init_smc911x(void)
+{
+       int gpio = OMAP2EVM_ETHR_GPIO_IRQ;
+       int ret;
+
+       ret = gpio_request(gpio, "smc911x IRQ");
+       if (ret >= 0)
+               gpio_direction_input(gpio);
+       else
+               printk(KERN_ERR "Failed to request GPIO for smc911x IRQ\n");
+
+}
+
 static void __init omap2_evm_init_irq(void)
 {
        omap2_init_common_hw();
        omap_init_irq();
        omap_gpio_init();
+       omap2evm_init_smc911x();
 }

 static struct omap_uart_config omap2_evm_uart_config __initdata = {
@@ -53,8 +87,13 @@ static int __init omap2_evm_i2c_init(void)
        return 0;
 }

+static struct platform_device *omap2_evm_devices[] __initdata = {
+    &omap2evm_smc911x_device,
+};
+
 static void __init omap2_evm_init(void)
 {
+       platform_add_devices(omap2_evm_devices, ARRAY_SIZE(omap2_evm_devices));
        omap_board_config = omap2_evm_config;
        omap_board_config_size = ARRAY_SIZE(omap2_evm_config);
        omap_serial_init();
diff --git a/include/asm-arm/arch-omap/board-omap2evm.h
b/include/asm-arm/arch-omap/board-omap2evm.h
index 98273a9..d770c58 100644
--- a/include/asm-arm/arch-omap/board-omap2evm.h
+++ b/include/asm-arm/arch-omap/board-omap2evm.h
@@ -30,7 +30,8 @@
 #define __ASM_ARCH_OMAP2_EVM_H

 /* Placeholder for OMAP2EVM specific defines */
-#define OMAP24XX_ETHR_START            0x08000300
-#define OMAP24XX_ETHR_GPIO_IRQ         149
+#define OMAP2EVM_ETHR_START                    0x2c000000
+#define OMAP2EVM_ETHR_SIZE                     1024
+#define OMAP2EVM_ETHR_GPIO_IRQ         149

 #endif /* __ASM_ARCH_OMAP2_EVM_H */
--
1.5.3.4

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-OMAP2EVM-Adding-ethernet-support.patch --]
[-- Type: text/x-patch; name=0001-OMAP2EVM-Adding-ethernet-support.patch, Size: 2832 bytes --]

From f7b330a88124c294204539cf8d1f471400a676b9 Mon Sep 17 00:00:00 2001
From: Arun KS <arunks@mistralsolutions.com>
Date: Tue, 24 Jun 2008 18:59:28 +0530
Subject: [PATCH] OMAP2EVM: Adding ethernet support

OMAP2EVM: Add ethernet support (smc911x)

Signed-off-by: Arun KS <arunks@mistralsolutions.com>
---
 arch/arm/mach-omap2/board-omap2evm.c       |   39 ++++++++++++++++++++++++++++
 include/asm-arm/arch-omap/board-omap2evm.h |    5 ++-
 2 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap2evm.c b/arch/arm/mach-omap2/board-omap2evm.c
index d00e502..61f6b1e 100644
--- a/arch/arm/mach-omap2/board-omap2evm.c
+++ b/arch/arm/mach-omap2/board-omap2evm.c
@@ -27,11 +27,45 @@
 #include <asm/arch/board.h>
 #include <asm/arch/common.h>
 
+static struct resource omap2evm_smc911x_resources[] = {
+	[0] =   {
+		.start  = OMAP2EVM_ETHR_START,
+		.end    = (OMAP2EVM_ETHR_START + OMAP2EVM_ETHR_SIZE - 1),
+		.flags  = IORESOURCE_MEM,
+	},
+	[1] =   {
+		.start  = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
+		.end    = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device omap2evm_smc911x_device = {
+	.name       = "smc911x",
+	.id     = -1,
+	.num_resources  = ARRAY_SIZE(omap2evm_smc911x_resources),
+	.resource   = &omap2evm_smc911x_resources [0],
+};
+
+static inline void __init omap2evm_init_smc911x(void)
+{
+	int gpio = OMAP2EVM_ETHR_GPIO_IRQ;
+	int ret;
+
+	ret = gpio_request(gpio, "smc911x IRQ");
+	if (ret >= 0)
+		gpio_direction_input(gpio);
+	else
+		printk(KERN_ERR "Failed to request GPIO for smc911x IRQ\n");
+
+}
+
 static void __init omap2_evm_init_irq(void)
 {
 	omap2_init_common_hw();
 	omap_init_irq();
 	omap_gpio_init();
+	omap2evm_init_smc911x();
 }
 
 static struct omap_uart_config omap2_evm_uart_config __initdata = {
@@ -53,8 +87,13 @@ static int __init omap2_evm_i2c_init(void)
 	return 0;
 }
 
+static struct platform_device *omap2_evm_devices[] __initdata = {
+    &omap2evm_smc911x_device,
+};
+
 static void __init omap2_evm_init(void)
 {
+	platform_add_devices(omap2_evm_devices, ARRAY_SIZE(omap2_evm_devices));
 	omap_board_config = omap2_evm_config;
 	omap_board_config_size = ARRAY_SIZE(omap2_evm_config);
 	omap_serial_init();
diff --git a/include/asm-arm/arch-omap/board-omap2evm.h b/include/asm-arm/arch-omap/board-omap2evm.h
index 98273a9..d770c58 100644
--- a/include/asm-arm/arch-omap/board-omap2evm.h
+++ b/include/asm-arm/arch-omap/board-omap2evm.h
@@ -30,7 +30,8 @@
 #define __ASM_ARCH_OMAP2_EVM_H
 
 /* Placeholder for OMAP2EVM specific defines */
-#define OMAP24XX_ETHR_START		0x08000300
-#define OMAP24XX_ETHR_GPIO_IRQ		149
+#define OMAP2EVM_ETHR_START			0x2c000000
+#define OMAP2EVM_ETHR_SIZE			1024
+#define OMAP2EVM_ETHR_GPIO_IRQ		149
 
 #endif /* __ASM_ARCH_OMAP2_EVM_H */
-- 
1.5.3.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Resend] [PATCH 1/3] OMAP2EVM: add ethernet support (smc911x)
  2008-06-24 13:25       ` [Resend] " Arun KS
@ 2008-06-24 14:18         ` Felipe Balbi
  2008-06-24 14:50           ` Arun KS
  2008-06-24 15:06           ` Arun KS
  0 siblings, 2 replies; 11+ messages in thread
From: Felipe Balbi @ 2008-06-24 14:18 UTC (permalink / raw)
  To: Arun KS; +Cc: linux-omap

Hi,

On Tue, 24 Jun 2008 18:55:26 +0530, "Arun KS" <getarunks@gmail.com> wrote:

> +static inline void __init omap2evm_init_smc911x(void)
> +{
> +       int gpio = OMAP2EVM_ETHR_GPIO_IRQ;
> +       int ret;
> +
> +       ret = gpio_request(gpio, "smc911x IRQ");
> +       if (ret >= 0)
> +               gpio_direction_input(gpio);
> +       else
> +               printk(KERN_ERR "Failed to request GPIO for smc911x

this would look better like this:

          if (ret < 0) {
             printk(KERN_ERR "Failed to request GPIO %d for smc911x IRQ\n",
gpio);
             return;
          }

          gpio_direction_input(gpio);


besides this, it looks fine :-)

-- 
Best Regards,

Felipe Balbi
http://felipebalbi.com
me@felipebalbi.com


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Resend] [PATCH 1/3] OMAP2EVM: add ethernet support (smc911x)
  2008-06-24 14:18         ` Felipe Balbi
@ 2008-06-24 14:50           ` Arun KS
  2008-06-24 15:06           ` Arun KS
  1 sibling, 0 replies; 11+ messages in thread
From: Arun KS @ 2008-06-24 14:50 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: linux-omap

Hi Felipe,

Thanks for your comments. I will incorporate those changes
and will send back.

Regards
Arun
Felipe Balbi wrote:
> Hi,
>
> On Tue, 24 Jun 2008 18:55:26 +0530, "Arun KS" <getarunks@gmail.com> wrote:
>
>   
>> +static inline void __init omap2evm_init_smc911x(void)
>> +{
>> +       int gpio = OMAP2EVM_ETHR_GPIO_IRQ;
>> +       int ret;
>> +
>> +       ret = gpio_request(gpio, "smc911x IRQ");
>> +       if (ret >= 0)
>> +               gpio_direction_input(gpio);
>> +       else
>> +               printk(KERN_ERR "Failed to request GPIO for smc911x
>>     
>
> this would look better like this:
>
>           if (ret < 0) {
>              printk(KERN_ERR "Failed to request GPIO %d for smc911x IRQ\n",
> gpio);
>              return;
>           }
>
>           gpio_direction_input(gpio);
>
>
> besides this, it looks fine :-)
>
>   


Please do not print this email unless it is absolutely necessary. Spread environmental awareness.

-------------------------------------------------------DISCLAIMER------------------------------------------------------
The information transmitted herewith is confidential and proprietary information intended only for use by the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.
--------------------------------------------------------------------------------------------------------------------------------




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Resend] [PATCH 1/3] OMAP2EVM: add ethernet support (smc911x)
  2008-06-24 14:18         ` Felipe Balbi
  2008-06-24 14:50           ` Arun KS
@ 2008-06-24 15:06           ` Arun KS
  2008-06-24 15:25             ` Felipe Balbi
  1 sibling, 1 reply; 11+ messages in thread
From: Arun KS @ 2008-06-24 15:06 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: linux-omap

OMAP2EVM: Add ethernet support (smc911x)

Signed-off-by: Arun KS <arunks@mistralsolutions.com>
---
 arch/arm/mach-omap2/board-omap2evm.c       |   41 ++++++++++++++++++++++++++++
 include/asm-arm/arch-omap/board-omap2evm.h |    5 ++-
 2 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap2evm.c
b/arch/arm/mach-omap2/board-omap2evm.c
index d00e502..0048775 100644
--- a/arch/arm/mach-omap2/board-omap2evm.c
+++ b/arch/arm/mach-omap2/board-omap2evm.c
@@ -27,11 +27,47 @@
 #include <asm/arch/board.h>
 #include <asm/arch/common.h>

+static struct resource omap2evm_smc911x_resources[] = {
+       [0] =   {
+               .start  = OMAP2EVM_ETHR_START,
+               .end    = (OMAP2EVM_ETHR_START + OMAP2EVM_ETHR_SIZE - 1),
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] =   {
+               .start  = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
+               .end    = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device omap2evm_smc911x_device = {
+       .name       = "smc911x",
+       .id     = -1,
+       .num_resources  = ARRAY_SIZE(omap2evm_smc911x_resources),
+       .resource   = &omap2evm_smc911x_resources [0],
+};
+
+static inline void __init omap2evm_init_smc911x(void)
+{
+       int gpio = OMAP2EVM_ETHR_GPIO_IRQ;
+       int ret;
+
+       ret = gpio_request(gpio, "smc911x IRQ");
+       if (ret < 0) {
+               printk(KERN_ERR "Failed to request GPIO %d for smc911x IRQ\n",
+               gpio);
+               return;
+       }
+       gpio_direction_input(gpio);
+
+}
+
 static void __init omap2_evm_init_irq(void)
 {
        omap2_init_common_hw();
        omap_init_irq();
        omap_gpio_init();
+       omap2evm_init_smc911x();
 }

 static struct omap_uart_config omap2_evm_uart_config __initdata = {
@@ -53,8 +89,13 @@ static int __init omap2_evm_i2c_init(void)
        return 0;
 }

+static struct platform_device *omap2_evm_devices[] __initdata = {
+    &omap2evm_smc911x_device,
+};
+
 static void __init omap2_evm_init(void)
 {
+       platform_add_devices(omap2_evm_devices, ARRAY_SIZE(omap2_evm_devices));
        omap_board_config = omap2_evm_config;
        omap_board_config_size = ARRAY_SIZE(omap2_evm_config);
        omap_serial_init();
diff --git a/include/asm-arm/arch-omap/board-omap2evm.h
b/include/asm-arm/arch-omap/board-omap2evm.h
index 98273a9..d770c58 100644
--- a/include/asm-arm/arch-omap/board-omap2evm.h
+++ b/include/asm-arm/arch-omap/board-omap2evm.h
@@ -30,7 +30,8 @@
 #define __ASM_ARCH_OMAP2_EVM_H

 /* Placeholder for OMAP2EVM specific defines */
-#define OMAP24XX_ETHR_START            0x08000300
-#define OMAP24XX_ETHR_GPIO_IRQ         149
+#define OMAP2EVM_ETHR_START                    0x2c000000
+#define OMAP2EVM_ETHR_SIZE                     1024
+#define OMAP2EVM_ETHR_GPIO_IRQ         149

 #endif /* __ASM_ARCH_OMAP2_EVM_H */
--
1.5.3.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Resend] [PATCH 1/3] OMAP2EVM: add ethernet support (smc911x)
  2008-06-24 15:06           ` Arun KS
@ 2008-06-24 15:25             ` Felipe Balbi
  2008-06-24 15:41               ` Arun KS
  0 siblings, 1 reply; 11+ messages in thread
From: Felipe Balbi @ 2008-06-24 15:25 UTC (permalink / raw)
  To: Arun KS; +Cc: linux-omap

Your patch came with spaces in place of tabs, please tabify and resend

-- 
Best Regards,

Felipe Balbi
http://felipebalbi.com
me@felipebalbi.com


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Resend] [PATCH 1/3] OMAP2EVM: add ethernet support (smc911x)
  2008-06-24 15:25             ` Felipe Balbi
@ 2008-06-24 15:41               ` Arun KS
  0 siblings, 0 replies; 11+ messages in thread
From: Arun KS @ 2008-06-24 15:41 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: linux-omap

[-- Attachment #1: Type: text/plain, Size: 2954 bytes --]

OMAP2EVM: Add ethernet support (smc911x)

Signed-off-by: Arun KS <arunks@mistralsolutions.com>
---
 arch/arm/mach-omap2/board-omap2evm.c       |   41 ++++++++++++++++++++++++++++
 include/asm-arm/arch-omap/board-omap2evm.h |    5 ++-
 2 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap2evm.c
b/arch/arm/mach-omap2/board-omap2evm.c
index d00e502..0048775 100644
--- a/arch/arm/mach-omap2/board-omap2evm.c
+++ b/arch/arm/mach-omap2/board-omap2evm.c
@@ -27,11 +27,47 @@
 #include <asm/arch/board.h>
 #include <asm/arch/common.h>

+static struct resource omap2evm_smc911x_resources[] = {
+       [0] =   {
+               .start  = OMAP2EVM_ETHR_START,
+               .end    = (OMAP2EVM_ETHR_START + OMAP2EVM_ETHR_SIZE - 1),
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] =   {
+               .start  = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
+               .end    = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device omap2evm_smc911x_device = {
+       .name       = "smc911x",
+       .id     = -1,
+       .num_resources  = ARRAY_SIZE(omap2evm_smc911x_resources),
+       .resource   = &omap2evm_smc911x_resources [0],
+};
+
+static inline void __init omap2evm_init_smc911x(void)
+{
+       int gpio = OMAP2EVM_ETHR_GPIO_IRQ;
+       int ret;
+
+       ret = gpio_request(gpio, "smc911x IRQ");
+       if (ret < 0) {
+               printk(KERN_ERR "Failed to request GPIO %d for smc911x IRQ\n",
+               gpio);
+               return;
+       }
+       gpio_direction_input(gpio);
+
+}
+
 static void __init omap2_evm_init_irq(void)
 {
        omap2_init_common_hw();
        omap_init_irq();
        omap_gpio_init();
+       omap2evm_init_smc911x();
 }

 static struct omap_uart_config omap2_evm_uart_config __initdata = {
@@ -53,8 +89,13 @@ static int __init omap2_evm_i2c_init(void)
        return 0;
 }

+static struct platform_device *omap2_evm_devices[] __initdata = {
+    &omap2evm_smc911x_device,
+};
+
 static void __init omap2_evm_init(void)
 {
+       platform_add_devices(omap2_evm_devices, ARRAY_SIZE(omap2_evm_devices));
        omap_board_config = omap2_evm_config;
        omap_board_config_size = ARRAY_SIZE(omap2_evm_config);
        omap_serial_init();
diff --git a/include/asm-arm/arch-omap/board-omap2evm.h
b/include/asm-arm/arch-omap/board-omap2evm.h
index 98273a9..d770c58 100644
--- a/include/asm-arm/arch-omap/board-omap2evm.h
+++ b/include/asm-arm/arch-omap/board-omap2evm.h
@@ -30,7 +30,8 @@
 #define __ASM_ARCH_OMAP2_EVM_H

 /* Placeholder for OMAP2EVM specific defines */
-#define OMAP24XX_ETHR_START            0x08000300
-#define OMAP24XX_ETHR_GPIO_IRQ         149
+#define OMAP2EVM_ETHR_START                    0x2c000000
+#define OMAP2EVM_ETHR_SIZE                     1024
+#define OMAP2EVM_ETHR_GPIO_IRQ         149

 #endif /* __ASM_ARCH_OMAP2_EVM_H */
--
1.5.3.4

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-OMAP2EVM-Adding-ethernet-support.patch --]
[-- Type: text/x-patch; name=0001-OMAP2EVM-Adding-ethernet-support.patch, Size: 2852 bytes --]

From 1b0e3551a0a352fc06cadec9c267e76a3884f3fc Mon Sep 17 00:00:00 2001
From: Arun KS <arunks@mistralsolutions.com>
Date: Tue, 24 Jun 2008 20:51:46 +0530
Subject: [PATCH] OMAP2EVM: Adding ethernet support

OMAP2EVM: Add ethernet support (smc911x)

Signed-off-by: Arun KS <arunks@mistralsolutions.com>
---
 arch/arm/mach-omap2/board-omap2evm.c       |   41 ++++++++++++++++++++++++++++
 include/asm-arm/arch-omap/board-omap2evm.h |    5 ++-
 2 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap2evm.c b/arch/arm/mach-omap2/board-omap2evm.c
index d00e502..0048775 100644
--- a/arch/arm/mach-omap2/board-omap2evm.c
+++ b/arch/arm/mach-omap2/board-omap2evm.c
@@ -27,11 +27,47 @@
 #include <asm/arch/board.h>
 #include <asm/arch/common.h>
 
+static struct resource omap2evm_smc911x_resources[] = {
+	[0] =   {
+		.start  = OMAP2EVM_ETHR_START,
+		.end    = (OMAP2EVM_ETHR_START + OMAP2EVM_ETHR_SIZE - 1),
+		.flags  = IORESOURCE_MEM,
+	},
+	[1] =   {
+		.start  = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
+		.end    = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device omap2evm_smc911x_device = {
+	.name       = "smc911x",
+	.id     = -1,
+	.num_resources  = ARRAY_SIZE(omap2evm_smc911x_resources),
+	.resource   = &omap2evm_smc911x_resources [0],
+};
+
+static inline void __init omap2evm_init_smc911x(void)
+{
+	int gpio = OMAP2EVM_ETHR_GPIO_IRQ;
+	int ret;
+
+	ret = gpio_request(gpio, "smc911x IRQ");
+	if (ret < 0) {
+		printk(KERN_ERR "Failed to request GPIO %d for smc911x IRQ\n",
+		gpio);
+		return;
+	}
+	gpio_direction_input(gpio);
+
+}
+
 static void __init omap2_evm_init_irq(void)
 {
 	omap2_init_common_hw();
 	omap_init_irq();
 	omap_gpio_init();
+	omap2evm_init_smc911x();
 }
 
 static struct omap_uart_config omap2_evm_uart_config __initdata = {
@@ -53,8 +89,13 @@ static int __init omap2_evm_i2c_init(void)
 	return 0;
 }
 
+static struct platform_device *omap2_evm_devices[] __initdata = {
+    &omap2evm_smc911x_device,
+};
+
 static void __init omap2_evm_init(void)
 {
+	platform_add_devices(omap2_evm_devices, ARRAY_SIZE(omap2_evm_devices));
 	omap_board_config = omap2_evm_config;
 	omap_board_config_size = ARRAY_SIZE(omap2_evm_config);
 	omap_serial_init();
diff --git a/include/asm-arm/arch-omap/board-omap2evm.h b/include/asm-arm/arch-omap/board-omap2evm.h
index 98273a9..d770c58 100644
--- a/include/asm-arm/arch-omap/board-omap2evm.h
+++ b/include/asm-arm/arch-omap/board-omap2evm.h
@@ -30,7 +30,8 @@
 #define __ASM_ARCH_OMAP2_EVM_H
 
 /* Placeholder for OMAP2EVM specific defines */
-#define OMAP24XX_ETHR_START		0x08000300
-#define OMAP24XX_ETHR_GPIO_IRQ		149
+#define OMAP2EVM_ETHR_START			0x2c000000
+#define OMAP2EVM_ETHR_SIZE			1024
+#define OMAP2EVM_ETHR_GPIO_IRQ		149
 
 #endif /* __ASM_ARCH_OMAP2_EVM_H */
-- 
1.5.3.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-06-24 15:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-24 12:04 [PATCH 1/3] OMAP2EVM: add ethernet support (smc911x) Arun KS
2008-06-24 12:12 ` Felipe Balbi
2008-06-24 12:29   ` Arun KS
2008-06-24 12:54   ` Arun KS
2008-06-24 12:57     ` Felipe Balbi
2008-06-24 13:25       ` [Resend] " Arun KS
2008-06-24 14:18         ` Felipe Balbi
2008-06-24 14:50           ` Arun KS
2008-06-24 15:06           ` Arun KS
2008-06-24 15:25             ` Felipe Balbi
2008-06-24 15:41               ` Arun KS

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.