diff options
author | Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | 2009-03-26 04:06:27 -0400 |
---|---|---|
committer | Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | 2009-03-26 04:06:27 -0400 |
commit | 839e642f3dda44a35c6a91780bff41d84c288022 (patch) | |
tree | d18a4e08862fdac85f77d18bc56aa355e5204608 /arch/arm | |
parent | 1df621ae2f3b03d557d962a7afec2b1d04558986 (diff) |
Gemini: Add support for Teltonika RUT100
Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-gemini/Kconfig | 7 | ||||
-rw-r--r-- | arch/arm/mach-gemini/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/mach-gemini/board-rut1xx.c | 95 |
3 files changed, 105 insertions, 0 deletions
diff --git a/arch/arm/mach-gemini/Kconfig b/arch/arm/mach-gemini/Kconfig index 3aff39abb188..515b75cf2e8b 100644 --- a/arch/arm/mach-gemini/Kconfig +++ b/arch/arm/mach-gemini/Kconfig | |||
@@ -2,6 +2,13 @@ if ARCH_GEMINI | |||
2 | 2 | ||
3 | menu "Cortina Systems Gemini Implementations" | 3 | menu "Cortina Systems Gemini Implementations" |
4 | 4 | ||
5 | config MACH_RUT100 | ||
6 | bool "Teltonika RUT100" | ||
7 | select GEMINI_MEM_SWAP | ||
8 | help | ||
9 | Say Y here if you intend to run this kernel on a | ||
10 | Teltonika 3G Router RUT100. | ||
11 | |||
5 | endmenu | 12 | endmenu |
6 | 13 | ||
7 | config GEMINI_MEM_SWAP | 14 | config GEMINI_MEM_SWAP |
diff --git a/arch/arm/mach-gemini/Makefile b/arch/arm/mach-gemini/Makefile index e2835cdb0d24..719505b81821 100644 --- a/arch/arm/mach-gemini/Makefile +++ b/arch/arm/mach-gemini/Makefile | |||
@@ -5,3 +5,6 @@ | |||
5 | # Object file lists. | 5 | # Object file lists. |
6 | 6 | ||
7 | obj-y := irq.o mm.o time.o devices.o gpio.o | 7 | obj-y := irq.o mm.o time.o devices.o gpio.o |
8 | |||
9 | # Board-specific support | ||
10 | obj-$(CONFIG_MACH_RUT100) += board-rut1xx.o | ||
diff --git a/arch/arm/mach-gemini/board-rut1xx.c b/arch/arm/mach-gemini/board-rut1xx.c new file mode 100644 index 000000000000..e0de968e32a6 --- /dev/null +++ b/arch/arm/mach-gemini/board-rut1xx.c | |||
@@ -0,0 +1,95 @@ | |||
1 | /* | ||
2 | * Support for Teltonika RUT1xx | ||
3 | * | ||
4 | * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
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/gpio_keys.h> | ||
17 | |||
18 | #include <asm/mach-types.h> | ||
19 | #include <asm/mach/arch.h> | ||
20 | #include <asm/mach/time.h> | ||
21 | |||
22 | #include "common.h" | ||
23 | |||
24 | static struct gpio_keys_button rut1xx_keys[] = { | ||
25 | { | ||
26 | .code = KEY_SETUP, | ||
27 | .gpio = 60, | ||
28 | .active_low = 1, | ||
29 | .desc = "Reset to defaults", | ||
30 | .type = EV_KEY, | ||
31 | }, | ||
32 | }; | ||
33 | |||
34 | static struct gpio_keys_platform_data rut1xx_keys_data = { | ||
35 | .buttons = rut1xx_keys, | ||
36 | .nbuttons = ARRAY_SIZE(rut1xx_keys), | ||
37 | }; | ||
38 | |||
39 | static struct platform_device rut1xx_keys_device = { | ||
40 | .name = "gpio-keys", | ||
41 | .id = -1, | ||
42 | .dev = { | ||
43 | .platform_data = &rut1xx_keys_data, | ||
44 | }, | ||
45 | }; | ||
46 | |||
47 | static struct gpio_led rut100_leds[] = { | ||
48 | { | ||
49 | .name = "Power", | ||
50 | .default_trigger = "heartbeat", | ||
51 | .gpio = 17, | ||
52 | }, | ||
53 | { | ||
54 | .name = "GSM", | ||
55 | .default_trigger = "default-on", | ||
56 | .gpio = 7, | ||
57 | .active_low = 1, | ||
58 | }, | ||
59 | }; | ||
60 | |||
61 | static struct gpio_led_platform_data rut100_leds_data = { | ||
62 | .num_leds = ARRAY_SIZE(rut100_leds), | ||
63 | .leds = rut100_leds, | ||
64 | }; | ||
65 | |||
66 | static struct platform_device rut1xx_leds = { | ||
67 | .name = "leds-gpio", | ||
68 | .id = -1, | ||
69 | .dev = { | ||
70 | .platform_data = &rut100_leds_data, | ||
71 | }, | ||
72 | }; | ||
73 | |||
74 | static struct sys_timer rut1xx_timer = { | ||
75 | .init = gemini_timer_init, | ||
76 | }; | ||
77 | |||
78 | static void __init rut1xx_init(void) | ||
79 | { | ||
80 | gemini_gpio_init(); | ||
81 | platform_register_uart(); | ||
82 | platform_register_pflash(SZ_8M, NULL, 0); | ||
83 | platform_device_register(&rut1xx_leds); | ||
84 | platform_device_register(&rut1xx_keys_device); | ||
85 | } | ||
86 | |||
87 | MACHINE_START(RUT100, "Teltonika RUT100") | ||
88 | .phys_io = 0x7fffc000, | ||
89 | .io_pg_offst = ((0xffffc000) >> 18) & 0xfffc, | ||
90 | .boot_params = 0x100, | ||
91 | .map_io = gemini_map_io, | ||
92 | .init_irq = gemini_init_irq, | ||
93 | .timer = &rut1xx_timer, | ||
94 | .init_machine = rut1xx_init, | ||
95 | MACHINE_END | ||