aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-gemini/board-wbd111.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-08-10 18:17:52 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-08-10 18:17:52 -0400
commit0b019a41553a919965bb02d07d54e3e6c57a796d (patch)
tree6e329b4159b440d2aac5200a5c07103fe261c096 /arch/arm/mach-gemini/board-wbd111.c
parent5f6878b0d22f9b93f9698f88c335007e2a3c3bbc (diff)
parent054d5c9238f3c577ad51195c3ee7803613f322cc (diff)
Merge branches 'master' and 'devel' into for-linus
Conflicts: arch/arm/Kconfig arch/arm/mm/Kconfig
Diffstat (limited to 'arch/arm/mach-gemini/board-wbd111.c')
-rw-r--r--arch/arm/mach-gemini/board-wbd111.c143
1 files changed, 143 insertions, 0 deletions
diff --git a/arch/arm/mach-gemini/board-wbd111.c b/arch/arm/mach-gemini/board-wbd111.c
new file mode 100644
index 000000000000..36538c15b3c4
--- /dev/null
+++ b/arch/arm/mach-gemini/board-wbd111.c
@@ -0,0 +1,143 @@
1/*
2 * Support for Wiliboard WBD-111
3 *
4 * Copyright (C) 2009 Imre Kaloz <kaloz@openwrt.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/leds.h>
15#include <linux/input.h>
16#include <linux/skbuff.h>
17#include <linux/gpio_keys.h>
18#include <linux/mdio-gpio.h>
19#include <linux/mtd/mtd.h>
20#include <linux/mtd/partitions.h>
21#include <asm/mach-types.h>
22#include <asm/mach/arch.h>
23#include <asm/mach/time.h>
24
25
26#include "common.h"
27
28static struct gpio_keys_button wbd111_keys[] = {
29 {
30 .code = KEY_SETUP,
31 .gpio = 5,
32 .active_low = 1,
33 .desc = "reset",
34 .type = EV_KEY,
35 },
36};
37
38static struct gpio_keys_platform_data wbd111_keys_data = {
39 .buttons = wbd111_keys,
40 .nbuttons = ARRAY_SIZE(wbd111_keys),
41};
42
43static struct platform_device wbd111_keys_device = {
44 .name = "gpio-keys",
45 .id = -1,
46 .dev = {
47 .platform_data = &wbd111_keys_data,
48 },
49};
50
51static struct gpio_led wbd111_leds[] = {
52 {
53 .name = "L3red",
54 .gpio = 1,
55 },
56 {
57 .name = "L4green",
58 .gpio = 2,
59 },
60 {
61 .name = "L4red",
62 .gpio = 3,
63 },
64 {
65 .name = "L3green",
66 .gpio = 5,
67 },
68};
69
70static struct gpio_led_platform_data wbd111_leds_data = {
71 .num_leds = ARRAY_SIZE(wbd111_leds),
72 .leds = wbd111_leds,
73};
74
75static struct platform_device wbd111_leds_device = {
76 .name = "leds-gpio",
77 .id = -1,
78 .dev = {
79 .platform_data = &wbd111_leds_data,
80 },
81};
82
83static struct sys_timer wbd111_timer = {
84 .init = gemini_timer_init,
85};
86
87#ifdef CONFIG_MTD_PARTITIONS
88static struct mtd_partition wbd111_partitions[] = {
89 {
90 .name = "RedBoot",
91 .offset = 0,
92 .size = 0x020000,
93 .mask_flags = MTD_WRITEABLE,
94 } , {
95 .name = "kernel",
96 .offset = 0x020000,
97 .size = 0x100000,
98 } , {
99 .name = "rootfs",
100 .offset = 0x120000,
101 .size = 0x6a0000,
102 } , {
103 .name = "VCTL",
104 .offset = 0x7c0000,
105 .size = 0x010000,
106 .mask_flags = MTD_WRITEABLE,
107 } , {
108 .name = "cfg",
109 .offset = 0x7d0000,
110 .size = 0x010000,
111 .mask_flags = MTD_WRITEABLE,
112 } , {
113 .name = "FIS",
114 .offset = 0x7e0000,
115 .size = 0x010000,
116 .mask_flags = MTD_WRITEABLE,
117 }
118};
119#define wbd111_num_partitions ARRAY_SIZE(wbd111_partitions)
120#else
121#define wbd111_partitions NULL
122#define wbd111_num_partitions 0
123#endif /* CONFIG_MTD_PARTITIONS */
124
125static void __init wbd111_init(void)
126{
127 gemini_gpio_init();
128 platform_register_uart();
129 platform_register_pflash(SZ_8M, wbd111_partitions,
130 wbd111_num_partitions);
131 platform_device_register(&wbd111_leds_device);
132 platform_device_register(&wbd111_keys_device);
133}
134
135MACHINE_START(WBD111, "Wiliboard WBD-111")
136 .phys_io = 0x7fffc000,
137 .io_pg_offst = ((0xffffc000) >> 18) & 0xfffc,
138 .boot_params = 0x100,
139 .map_io = gemini_map_io,
140 .init_irq = gemini_init_irq,
141 .timer = &wbd111_timer,
142 .init_machine = wbd111_init,
143MACHINE_END