aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlessandro Rubini <rubini@gnudd.com>2009-07-02 10:29:32 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-07-02 16:20:46 -0400
commit725b1f9d86822246e5a1237bf97d2783857d8a3a (patch)
tree836f13fd0dd1931dec4a33989abc0045aa40cdd2
parent63796b740b888b396eb0cc78917d755693cc224c (diff)
[ARM] 5586/1: nomadik board: added ethernet
Signed-off-by: Alessandro Rubini <rubini@unipv.it> Acked-by: Andrea Gallo <andrea.gallo@stericsson.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/mach-nomadik/board-nhk8815.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c
index eebca614d36b..79bdea943eb4 100644
--- a/arch/arm/mach-nomadik/board-nhk8815.c
+++ b/arch/arm/mach-nomadik/board-nhk8815.c
@@ -14,6 +14,8 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/amba/bus.h> 16#include <linux/amba/bus.h>
17#include <linux/interrupt.h>
18#include <linux/gpio.h>
17#include <asm/mach-types.h> 19#include <asm/mach-types.h>
18#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
19#include <asm/mach/irq.h> 21#include <asm/mach/irq.h>
@@ -45,8 +47,42 @@ static struct clk nhk8815_clk_48 = {
45 .rate = 48*1000*1000, 47 .rate = 48*1000*1000,
46}; 48};
47 49
50static struct resource nhk8815_eth_resources[] = {
51 {
52 .name = "smc91x-regs",
53 .start = 0x34000000 + 0x300,
54 .end = 0x34000000 + SZ_64K - 1,
55 .flags = IORESOURCE_MEM,
56 }, {
57 .start = NOMADIK_GPIO_TO_IRQ(115),
58 .end = NOMADIK_GPIO_TO_IRQ(115),
59 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING,
60 }
61};
62
63static struct platform_device nhk8815_eth_device = {
64 .name = "smc91x",
65 .resource = nhk8815_eth_resources,
66 .num_resources = ARRAY_SIZE(nhk8815_eth_resources),
67};
68
69static int __init nhk8815_eth_init(void)
70{
71 int gpio_nr = 115; /* hardwired in the board */
72 int err;
73
74 err = gpio_request(gpio_nr, "eth_irq");
75 if (!err) err = nmk_gpio_set_mode(gpio_nr, NMK_GPIO_ALT_GPIO);
76 if (!err) err = gpio_direction_input(gpio_nr);
77 if (err)
78 pr_err("Error %i in %s\n", err, __func__);
79 return err;
80}
81device_initcall(nhk8815_eth_init);
82
48static struct platform_device *nhk8815_platform_devices[] __initdata = { 83static struct platform_device *nhk8815_platform_devices[] __initdata = {
49 /* currently empty, will add keypad, touchscreen etc */ 84 &nhk8815_eth_device,
85 /* will add more devices */
50}; 86};
51 87
52static void __init nhk8815_platform_init(void) 88static void __init nhk8815_platform_init(void)