aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/Kconfig1
-rw-r--r--arch/arm/mach-gemini/Makefile2
-rw-r--r--arch/arm/mach-gemini/board-nas4220b.c1
-rw-r--r--arch/arm/mach-gemini/board-rut1xx.c2
-rw-r--r--arch/arm/mach-gemini/board-wbd111.c1
-rw-r--r--arch/arm/mach-gemini/board-wbd222.c1
-rw-r--r--arch/arm/mach-gemini/common.h2
-rw-r--r--arch/arm/mach-gemini/gpio.c19
-rw-r--r--arch/arm/mach-gemini/include/mach/hardware.h2
-rw-r--r--arch/arm/mach-gemini/irq.c4
-rw-r--r--arch/arm/mach-gemini/mm.c22
-rw-r--r--arch/arm/mach-gemini/reset.c (renamed from arch/arm/mach-gemini/include/mach/system.h)2
12 files changed, 34 insertions, 25 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 5b714695b01b..78f31a3bc7c1 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -411,6 +411,7 @@ config ARCH_GEMINI
411 bool "Cortina Systems Gemini" 411 bool "Cortina Systems Gemini"
412 select ARCH_REQUIRE_GPIOLIB 412 select ARCH_REQUIRE_GPIOLIB
413 select ARCH_USES_GETTIMEOFFSET 413 select ARCH_USES_GETTIMEOFFSET
414 select NEED_MACH_GPIO_H
414 select CPU_FA526 415 select CPU_FA526
415 help 416 help
416 Support for the Cortina Systems Gemini family SoCs 417 Support for the Cortina Systems Gemini family SoCs
diff --git a/arch/arm/mach-gemini/Makefile b/arch/arm/mach-gemini/Makefile
index 7355c0bbcb5e..7963a77be637 100644
--- a/arch/arm/mach-gemini/Makefile
+++ b/arch/arm/mach-gemini/Makefile
@@ -4,7 +4,7 @@
4 4
5# Object file lists. 5# Object file lists.
6 6
7obj-y := irq.o mm.o time.o devices.o gpio.o idle.o 7obj-y := irq.o mm.o time.o devices.o gpio.o idle.o reset.o
8 8
9# Board-specific support 9# Board-specific support
10obj-$(CONFIG_MACH_NAS4220B) += board-nas4220b.o 10obj-$(CONFIG_MACH_NAS4220B) += board-nas4220b.o
diff --git a/arch/arm/mach-gemini/board-nas4220b.c b/arch/arm/mach-gemini/board-nas4220b.c
index 08bd650c42f3..ca8a25bb3521 100644
--- a/arch/arm/mach-gemini/board-nas4220b.c
+++ b/arch/arm/mach-gemini/board-nas4220b.c
@@ -103,4 +103,5 @@ MACHINE_START(NAS4220B, "Raidsonic NAS IB-4220-B")
103 .init_irq = gemini_init_irq, 103 .init_irq = gemini_init_irq,
104 .init_time = gemini_timer_init, 104 .init_time = gemini_timer_init,
105 .init_machine = ib4220b_init, 105 .init_machine = ib4220b_init,
106 .restart = gemini_restart,
106MACHINE_END 107MACHINE_END
diff --git a/arch/arm/mach-gemini/board-rut1xx.c b/arch/arm/mach-gemini/board-rut1xx.c
index fa0a36337f4d..7a675f88ffd6 100644
--- a/arch/arm/mach-gemini/board-rut1xx.c
+++ b/arch/arm/mach-gemini/board-rut1xx.c
@@ -14,6 +14,7 @@
14#include <linux/leds.h> 14#include <linux/leds.h>
15#include <linux/input.h> 15#include <linux/input.h>
16#include <linux/gpio_keys.h> 16#include <linux/gpio_keys.h>
17#include <linux/sizes.h>
17 18
18#include <asm/mach-types.h> 19#include <asm/mach-types.h>
19#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
@@ -87,4 +88,5 @@ MACHINE_START(RUT100, "Teltonika RUT100")
87 .init_irq = gemini_init_irq, 88 .init_irq = gemini_init_irq,
88 .init_time = gemini_timer_init, 89 .init_time = gemini_timer_init,
89 .init_machine = rut1xx_init, 90 .init_machine = rut1xx_init,
91 .restart = gemini_restart,
90MACHINE_END 92MACHINE_END
diff --git a/arch/arm/mach-gemini/board-wbd111.c b/arch/arm/mach-gemini/board-wbd111.c
index 3321cd6cc1f3..418188cd1712 100644
--- a/arch/arm/mach-gemini/board-wbd111.c
+++ b/arch/arm/mach-gemini/board-wbd111.c
@@ -130,4 +130,5 @@ MACHINE_START(WBD111, "Wiliboard WBD-111")
130 .init_irq = gemini_init_irq, 130 .init_irq = gemini_init_irq,
131 .init_time = gemini_timer_init, 131 .init_time = gemini_timer_init,
132 .init_machine = wbd111_init, 132 .init_machine = wbd111_init,
133 .restart = gemini_restart,
133MACHINE_END 134MACHINE_END
diff --git a/arch/arm/mach-gemini/board-wbd222.c b/arch/arm/mach-gemini/board-wbd222.c
index fe33c825fdaf..266b265090cd 100644
--- a/arch/arm/mach-gemini/board-wbd222.c
+++ b/arch/arm/mach-gemini/board-wbd222.c
@@ -130,4 +130,5 @@ MACHINE_START(WBD222, "Wiliboard WBD-222")
130 .init_irq = gemini_init_irq, 130 .init_irq = gemini_init_irq,
131 .init_time = gemini_timer_init, 131 .init_time = gemini_timer_init,
132 .init_machine = wbd222_init, 132 .init_machine = wbd222_init,
133 .restart = gemini_restart,
133MACHINE_END 134MACHINE_END
diff --git a/arch/arm/mach-gemini/common.h b/arch/arm/mach-gemini/common.h
index 7670c39acb2f..38a45260a7c8 100644
--- a/arch/arm/mach-gemini/common.h
+++ b/arch/arm/mach-gemini/common.h
@@ -26,4 +26,6 @@ extern int platform_register_pflash(unsigned int size,
26 struct mtd_partition *parts, 26 struct mtd_partition *parts,
27 unsigned int nr_parts); 27 unsigned int nr_parts);
28 28
29extern void gemini_restart(char mode, const char *cmd);
30
29#endif /* __GEMINI_COMMON_H__ */ 31#endif /* __GEMINI_COMMON_H__ */
diff --git a/arch/arm/mach-gemini/gpio.c b/arch/arm/mach-gemini/gpio.c
index fdc7ef1391d3..70bfa571b24b 100644
--- a/arch/arm/mach-gemini/gpio.c
+++ b/arch/arm/mach-gemini/gpio.c
@@ -21,6 +21,7 @@
21 21
22#include <mach/hardware.h> 22#include <mach/hardware.h>
23#include <mach/irqs.h> 23#include <mach/irqs.h>
24#include <mach/gpio.h>
24 25
25#define GPIO_BASE(x) IO_ADDRESS(GEMINI_GPIO_BASE(x)) 26#define GPIO_BASE(x) IO_ADDRESS(GEMINI_GPIO_BASE(x))
26 27
@@ -44,7 +45,7 @@
44 45
45#define GPIO_PORT_NUM 3 46#define GPIO_PORT_NUM 3
46 47
47static void _set_gpio_irqenable(unsigned int base, unsigned int index, 48static void _set_gpio_irqenable(void __iomem *base, unsigned int index,
48 int enable) 49 int enable)
49{ 50{
50 unsigned int reg; 51 unsigned int reg;
@@ -57,7 +58,7 @@ static void _set_gpio_irqenable(unsigned int base, unsigned int index,
57static void gpio_ack_irq(struct irq_data *d) 58static void gpio_ack_irq(struct irq_data *d)
58{ 59{
59 unsigned int gpio = irq_to_gpio(d->irq); 60 unsigned int gpio = irq_to_gpio(d->irq);
60 unsigned int base = GPIO_BASE(gpio / 32); 61 void __iomem *base = GPIO_BASE(gpio / 32);
61 62
62 __raw_writel(1 << (gpio % 32), base + GPIO_INT_CLR); 63 __raw_writel(1 << (gpio % 32), base + GPIO_INT_CLR);
63} 64}
@@ -65,7 +66,7 @@ static void gpio_ack_irq(struct irq_data *d)
65static void gpio_mask_irq(struct irq_data *d) 66static void gpio_mask_irq(struct irq_data *d)
66{ 67{
67 unsigned int gpio = irq_to_gpio(d->irq); 68 unsigned int gpio = irq_to_gpio(d->irq);
68 unsigned int base = GPIO_BASE(gpio / 32); 69 void __iomem *base = GPIO_BASE(gpio / 32);
69 70
70 _set_gpio_irqenable(base, gpio % 32, 0); 71 _set_gpio_irqenable(base, gpio % 32, 0);
71} 72}
@@ -73,7 +74,7 @@ static void gpio_mask_irq(struct irq_data *d)
73static void gpio_unmask_irq(struct irq_data *d) 74static void gpio_unmask_irq(struct irq_data *d)
74{ 75{
75 unsigned int gpio = irq_to_gpio(d->irq); 76 unsigned int gpio = irq_to_gpio(d->irq);
76 unsigned int base = GPIO_BASE(gpio / 32); 77 void __iomem *base = GPIO_BASE(gpio / 32);
77 78
78 _set_gpio_irqenable(base, gpio % 32, 1); 79 _set_gpio_irqenable(base, gpio % 32, 1);
79} 80}
@@ -82,7 +83,7 @@ static int gpio_set_irq_type(struct irq_data *d, unsigned int type)
82{ 83{
83 unsigned int gpio = irq_to_gpio(d->irq); 84 unsigned int gpio = irq_to_gpio(d->irq);
84 unsigned int gpio_mask = 1 << (gpio % 32); 85 unsigned int gpio_mask = 1 << (gpio % 32);
85 unsigned int base = GPIO_BASE(gpio / 32); 86 void __iomem *base = GPIO_BASE(gpio / 32);
86 unsigned int reg_both, reg_level, reg_type; 87 unsigned int reg_both, reg_level, reg_type;
87 88
88 reg_type = __raw_readl(base + GPIO_INT_TYPE); 89 reg_type = __raw_readl(base + GPIO_INT_TYPE);
@@ -120,7 +121,7 @@ static int gpio_set_irq_type(struct irq_data *d, unsigned int type)
120 __raw_writel(reg_level, base + GPIO_INT_LEVEL); 121 __raw_writel(reg_level, base + GPIO_INT_LEVEL);
121 __raw_writel(reg_both, base + GPIO_INT_BOTH_EDGE); 122 __raw_writel(reg_both, base + GPIO_INT_BOTH_EDGE);
122 123
123 gpio_ack_irq(d->irq); 124 gpio_ack_irq(d);
124 125
125 return 0; 126 return 0;
126} 127}
@@ -153,7 +154,7 @@ static struct irq_chip gpio_irq_chip = {
153static void _set_gpio_direction(struct gpio_chip *chip, unsigned offset, 154static void _set_gpio_direction(struct gpio_chip *chip, unsigned offset,
154 int dir) 155 int dir)
155{ 156{
156 unsigned int base = GPIO_BASE(offset / 32); 157 void __iomem *base = GPIO_BASE(offset / 32);
157 unsigned int reg; 158 unsigned int reg;
158 159
159 reg = __raw_readl(base + GPIO_DIR); 160 reg = __raw_readl(base + GPIO_DIR);
@@ -166,7 +167,7 @@ static void _set_gpio_direction(struct gpio_chip *chip, unsigned offset,
166 167
167static void gemini_gpio_set(struct gpio_chip *chip, unsigned offset, int value) 168static void gemini_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
168{ 169{
169 unsigned int base = GPIO_BASE(offset / 32); 170 void __iomem *base = GPIO_BASE(offset / 32);
170 171
171 if (value) 172 if (value)
172 __raw_writel(1 << (offset % 32), base + GPIO_DATA_SET); 173 __raw_writel(1 << (offset % 32), base + GPIO_DATA_SET);
@@ -176,7 +177,7 @@ static void gemini_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
176 177
177static int gemini_gpio_get(struct gpio_chip *chip, unsigned offset) 178static int gemini_gpio_get(struct gpio_chip *chip, unsigned offset)
178{ 179{
179 unsigned int base = GPIO_BASE(offset / 32); 180 void __iomem *base = GPIO_BASE(offset / 32);
180 181
181 return (__raw_readl(base + GPIO_DATA_IN) >> (offset % 32)) & 1; 182 return (__raw_readl(base + GPIO_DATA_IN) >> (offset % 32)) & 1;
182} 183}
diff --git a/arch/arm/mach-gemini/include/mach/hardware.h b/arch/arm/mach-gemini/include/mach/hardware.h
index 8c950e1d06be..98e7b0f286bf 100644
--- a/arch/arm/mach-gemini/include/mach/hardware.h
+++ b/arch/arm/mach-gemini/include/mach/hardware.h
@@ -69,6 +69,6 @@
69/* 69/*
70 * macro to get at IO space when running virtually 70 * macro to get at IO space when running virtually
71 */ 71 */
72#define IO_ADDRESS(x) ((((x) & 0xFFF00000) >> 4) | ((x) & 0x000FFFFF) | 0xF0000000) 72#define IO_ADDRESS(x) IOMEM((((x) & 0xFFF00000) >> 4) | ((x) & 0x000FFFFF) | 0xF0000000)
73 73
74#endif 74#endif
diff --git a/arch/arm/mach-gemini/irq.c b/arch/arm/mach-gemini/irq.c
index 020852d3bdd8..30bef116691e 100644
--- a/arch/arm/mach-gemini/irq.c
+++ b/arch/arm/mach-gemini/irq.c
@@ -65,8 +65,8 @@ static struct irq_chip gemini_irq_chip = {
65 65
66static struct resource irq_resource = { 66static struct resource irq_resource = {
67 .name = "irq_handler", 67 .name = "irq_handler",
68 .start = IO_ADDRESS(GEMINI_INTERRUPT_BASE), 68 .start = GEMINI_INTERRUPT_BASE,
69 .end = IO_ADDRESS(FIQ_STATUS(GEMINI_INTERRUPT_BASE)) + 4, 69 .end = FIQ_STATUS(GEMINI_INTERRUPT_BASE) + 4,
70}; 70};
71 71
72void __init gemini_init_irq(void) 72void __init gemini_init_irq(void)
diff --git a/arch/arm/mach-gemini/mm.c b/arch/arm/mach-gemini/mm.c
index 51948242ec09..2c2cd284bb6a 100644
--- a/arch/arm/mach-gemini/mm.c
+++ b/arch/arm/mach-gemini/mm.c
@@ -19,57 +19,57 @@
19/* Page table mapping for I/O region */ 19/* Page table mapping for I/O region */
20static struct map_desc gemini_io_desc[] __initdata = { 20static struct map_desc gemini_io_desc[] __initdata = {
21 { 21 {
22 .virtual = IO_ADDRESS(GEMINI_GLOBAL_BASE), 22 .virtual = (unsigned long)IO_ADDRESS(GEMINI_GLOBAL_BASE),
23 .pfn =__phys_to_pfn(GEMINI_GLOBAL_BASE), 23 .pfn =__phys_to_pfn(GEMINI_GLOBAL_BASE),
24 .length = SZ_512K, 24 .length = SZ_512K,
25 .type = MT_DEVICE, 25 .type = MT_DEVICE,
26 }, { 26 }, {
27 .virtual = IO_ADDRESS(GEMINI_UART_BASE), 27 .virtual = (unsigned long)IO_ADDRESS(GEMINI_UART_BASE),
28 .pfn = __phys_to_pfn(GEMINI_UART_BASE), 28 .pfn = __phys_to_pfn(GEMINI_UART_BASE),
29 .length = SZ_512K, 29 .length = SZ_512K,
30 .type = MT_DEVICE, 30 .type = MT_DEVICE,
31 }, { 31 }, {
32 .virtual = IO_ADDRESS(GEMINI_TIMER_BASE), 32 .virtual = (unsigned long)IO_ADDRESS(GEMINI_TIMER_BASE),
33 .pfn = __phys_to_pfn(GEMINI_TIMER_BASE), 33 .pfn = __phys_to_pfn(GEMINI_TIMER_BASE),
34 .length = SZ_512K, 34 .length = SZ_512K,
35 .type = MT_DEVICE, 35 .type = MT_DEVICE,
36 }, { 36 }, {
37 .virtual = IO_ADDRESS(GEMINI_INTERRUPT_BASE), 37 .virtual = (unsigned long)IO_ADDRESS(GEMINI_INTERRUPT_BASE),
38 .pfn = __phys_to_pfn(GEMINI_INTERRUPT_BASE), 38 .pfn = __phys_to_pfn(GEMINI_INTERRUPT_BASE),
39 .length = SZ_512K, 39 .length = SZ_512K,
40 .type = MT_DEVICE, 40 .type = MT_DEVICE,
41 }, { 41 }, {
42 .virtual = IO_ADDRESS(GEMINI_POWER_CTRL_BASE), 42 .virtual = (unsigned long)IO_ADDRESS(GEMINI_POWER_CTRL_BASE),
43 .pfn = __phys_to_pfn(GEMINI_POWER_CTRL_BASE), 43 .pfn = __phys_to_pfn(GEMINI_POWER_CTRL_BASE),
44 .length = SZ_512K, 44 .length = SZ_512K,
45 .type = MT_DEVICE, 45 .type = MT_DEVICE,
46 }, { 46 }, {
47 .virtual = IO_ADDRESS(GEMINI_GPIO_BASE(0)), 47 .virtual = (unsigned long)IO_ADDRESS(GEMINI_GPIO_BASE(0)),
48 .pfn = __phys_to_pfn(GEMINI_GPIO_BASE(0)), 48 .pfn = __phys_to_pfn(GEMINI_GPIO_BASE(0)),
49 .length = SZ_512K, 49 .length = SZ_512K,
50 .type = MT_DEVICE, 50 .type = MT_DEVICE,
51 }, { 51 }, {
52 .virtual = IO_ADDRESS(GEMINI_GPIO_BASE(1)), 52 .virtual = (unsigned long)IO_ADDRESS(GEMINI_GPIO_BASE(1)),
53 .pfn = __phys_to_pfn(GEMINI_GPIO_BASE(1)), 53 .pfn = __phys_to_pfn(GEMINI_GPIO_BASE(1)),
54 .length = SZ_512K, 54 .length = SZ_512K,
55 .type = MT_DEVICE, 55 .type = MT_DEVICE,
56 }, { 56 }, {
57 .virtual = IO_ADDRESS(GEMINI_GPIO_BASE(2)), 57 .virtual = (unsigned long)IO_ADDRESS(GEMINI_GPIO_BASE(2)),
58 .pfn = __phys_to_pfn(GEMINI_GPIO_BASE(2)), 58 .pfn = __phys_to_pfn(GEMINI_GPIO_BASE(2)),
59 .length = SZ_512K, 59 .length = SZ_512K,
60 .type = MT_DEVICE, 60 .type = MT_DEVICE,
61 }, { 61 }, {
62 .virtual = IO_ADDRESS(GEMINI_FLASH_CTRL_BASE), 62 .virtual = (unsigned long)IO_ADDRESS(GEMINI_FLASH_CTRL_BASE),
63 .pfn = __phys_to_pfn(GEMINI_FLASH_CTRL_BASE), 63 .pfn = __phys_to_pfn(GEMINI_FLASH_CTRL_BASE),
64 .length = SZ_512K, 64 .length = SZ_512K,
65 .type = MT_DEVICE, 65 .type = MT_DEVICE,
66 }, { 66 }, {
67 .virtual = IO_ADDRESS(GEMINI_DRAM_CTRL_BASE), 67 .virtual = (unsigned long)IO_ADDRESS(GEMINI_DRAM_CTRL_BASE),
68 .pfn = __phys_to_pfn(GEMINI_DRAM_CTRL_BASE), 68 .pfn = __phys_to_pfn(GEMINI_DRAM_CTRL_BASE),
69 .length = SZ_512K, 69 .length = SZ_512K,
70 .type = MT_DEVICE, 70 .type = MT_DEVICE,
71 }, { 71 }, {
72 .virtual = IO_ADDRESS(GEMINI_GENERAL_DMA_BASE), 72 .virtual = (unsigned long)IO_ADDRESS(GEMINI_GENERAL_DMA_BASE),
73 .pfn = __phys_to_pfn(GEMINI_GENERAL_DMA_BASE), 73 .pfn = __phys_to_pfn(GEMINI_GENERAL_DMA_BASE),
74 .length = SZ_512K, 74 .length = SZ_512K,
75 .type = MT_DEVICE, 75 .type = MT_DEVICE,
diff --git a/arch/arm/mach-gemini/include/mach/system.h b/arch/arm/mach-gemini/reset.c
index a33b5a1f8ab4..b26659759e27 100644
--- a/arch/arm/mach-gemini/include/mach/system.h
+++ b/arch/arm/mach-gemini/reset.c
@@ -14,7 +14,7 @@
14#include <mach/hardware.h> 14#include <mach/hardware.h>
15#include <mach/global_reg.h> 15#include <mach/global_reg.h>
16 16
17static inline void arch_reset(char mode, const char *cmd) 17void gemini_restart(char mode, const char *cmd)
18{ 18{
19 __raw_writel(RESET_GLOBAL | RESET_CPU1, 19 __raw_writel(RESET_GLOBAL | RESET_CPU1,
20 IO_ADDRESS(GEMINI_GLOBAL_BASE) + GLOBAL_RESET); 20 IO_ADDRESS(GEMINI_GLOBAL_BASE) + GLOBAL_RESET);