ARM: gemini: get platform to build again
authorArnd Bergmann <arnd@arndb.de>
Fri, 4 Jan 2013 13:38:03 +0000 (13:38 +0000)
committerArnd Bergmann <arnd@arndb.de>
Thu, 14 Mar 2013 20:14:03 +0000 (21:14 +0100)
There is no defconfig file for gemini, which has lead to a lot
of bitrot. This makes the broken board files, the gpio implementation
and the reset logic work again, and fixes the build warnings
that got introduced with the changes to the readl/writel prototypes.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
13 files changed:
arch/arm/Kconfig
arch/arm/mach-gemini/Makefile
arch/arm/mach-gemini/board-nas4220b.c
arch/arm/mach-gemini/board-rut1xx.c
arch/arm/mach-gemini/board-wbd111.c
arch/arm/mach-gemini/board-wbd222.c
arch/arm/mach-gemini/common.h
arch/arm/mach-gemini/gpio.c
arch/arm/mach-gemini/include/mach/hardware.h
arch/arm/mach-gemini/include/mach/system.h [deleted file]
arch/arm/mach-gemini/irq.c
arch/arm/mach-gemini/mm.c
arch/arm/mach-gemini/reset.c [new file with mode: 0644]

index 5b714695b01bb9db0455ad2f5c959a714aa00064..78f31a3bc7c1714761871de4a8ccf3baaceb55aa 100644 (file)
@@ -411,6 +411,7 @@ config ARCH_GEMINI
        bool "Cortina Systems Gemini"
        select ARCH_REQUIRE_GPIOLIB
        select ARCH_USES_GETTIMEOFFSET
+       select NEED_MACH_GPIO_H
        select CPU_FA526
        help
          Support for the Cortina Systems Gemini family SoCs
index 7355c0bbcb5ec5c2072e0ab6e7ddf277a580467c..7963a77be637b9fb13ef2cded4f6f2165096f721 100644 (file)
@@ -4,7 +4,7 @@
 
 # Object file lists.
 
-obj-y                  := irq.o mm.o time.o devices.o gpio.o idle.o
+obj-y                  := irq.o mm.o time.o devices.o gpio.o idle.o reset.o
 
 # Board-specific support
 obj-$(CONFIG_MACH_NAS4220B)    += board-nas4220b.o
index 08bd650c42f3e9cca2c66eb04c3dce163ebbe715..ca8a25bb35217404247bc9163529457289187bdf 100644 (file)
@@ -103,4 +103,5 @@ MACHINE_START(NAS4220B, "Raidsonic NAS IB-4220-B")
        .init_irq       = gemini_init_irq,
        .init_time      = gemini_timer_init,
        .init_machine   = ib4220b_init,
+       .restart        = gemini_restart,
 MACHINE_END
index fa0a36337f4d83dc0d78520e2a1e35775d4b29d2..7a675f88ffd61157879b44e817ccbad768289175 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/leds.h>
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
+#include <linux/sizes.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -87,4 +88,5 @@ MACHINE_START(RUT100, "Teltonika RUT100")
        .init_irq       = gemini_init_irq,
        .init_time      = gemini_timer_init,
        .init_machine   = rut1xx_init,
+       .restart        = gemini_restart,
 MACHINE_END
index 3321cd6cc1f3c60d1c358b316c3562b41b605b70..418188cd1712fe7f6247a8b97fb423e358f4891d 100644 (file)
@@ -130,4 +130,5 @@ MACHINE_START(WBD111, "Wiliboard WBD-111")
        .init_irq       = gemini_init_irq,
        .init_time      = gemini_timer_init,
        .init_machine   = wbd111_init,
+       .restart        = gemini_restart,
 MACHINE_END
index fe33c825fdaf57412e11b498721349958a3be8f4..266b265090cd222034bb6cfd3c1feb64f05ed058 100644 (file)
@@ -130,4 +130,5 @@ MACHINE_START(WBD222, "Wiliboard WBD-222")
        .init_irq       = gemini_init_irq,
        .init_time      = gemini_timer_init,
        .init_machine   = wbd222_init,
+       .restart        = gemini_restart,
 MACHINE_END
index 7670c39acb2f9f3463ccd678c675de4b84c27dba..38a45260a7c8b522dc3b8c163a19d4debe711ca9 100644 (file)
@@ -26,4 +26,6 @@ extern int platform_register_pflash(unsigned int size,
                                    struct mtd_partition *parts,
                                    unsigned int nr_parts);
 
+extern void gemini_restart(char mode, const char *cmd);
+
 #endif /* __GEMINI_COMMON_H__ */
index fdc7ef1391d3868a96bba536fa05fe294cf168ce..70bfa571b24beccc746cc0aa7e492b7872a5642e 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <mach/hardware.h>
 #include <mach/irqs.h>
+#include <mach/gpio.h>
 
 #define GPIO_BASE(x)           IO_ADDRESS(GEMINI_GPIO_BASE(x))
 
@@ -44,7 +45,7 @@
 
 #define GPIO_PORT_NUM          3
 
-static void _set_gpio_irqenable(unsigned int base, unsigned int index,
+static void _set_gpio_irqenable(void __iomem *base, unsigned int index,
                                int enable)
 {
        unsigned int reg;
@@ -57,7 +58,7 @@ static void _set_gpio_irqenable(unsigned int base, unsigned int index,
 static void gpio_ack_irq(struct irq_data *d)
 {
        unsigned int gpio = irq_to_gpio(d->irq);
-       unsigned int base = GPIO_BASE(gpio / 32);
+       void __iomem *base = GPIO_BASE(gpio / 32);
 
        __raw_writel(1 << (gpio % 32), base + GPIO_INT_CLR);
 }
@@ -65,7 +66,7 @@ static void gpio_ack_irq(struct irq_data *d)
 static void gpio_mask_irq(struct irq_data *d)
 {
        unsigned int gpio = irq_to_gpio(d->irq);
-       unsigned int base = GPIO_BASE(gpio / 32);
+       void __iomem *base = GPIO_BASE(gpio / 32);
 
        _set_gpio_irqenable(base, gpio % 32, 0);
 }
@@ -73,7 +74,7 @@ static void gpio_mask_irq(struct irq_data *d)
 static void gpio_unmask_irq(struct irq_data *d)
 {
        unsigned int gpio = irq_to_gpio(d->irq);
-       unsigned int base = GPIO_BASE(gpio / 32);
+       void __iomem *base = GPIO_BASE(gpio / 32);
 
        _set_gpio_irqenable(base, gpio % 32, 1);
 }
@@ -82,7 +83,7 @@ static int gpio_set_irq_type(struct irq_data *d, unsigned int type)
 {
        unsigned int gpio = irq_to_gpio(d->irq);
        unsigned int gpio_mask = 1 << (gpio % 32);
-       unsigned int base = GPIO_BASE(gpio / 32);
+       void __iomem *base = GPIO_BASE(gpio / 32);
        unsigned int reg_both, reg_level, reg_type;
 
        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)
        __raw_writel(reg_level, base + GPIO_INT_LEVEL);
        __raw_writel(reg_both, base + GPIO_INT_BOTH_EDGE);
 
-       gpio_ack_irq(d->irq);
+       gpio_ack_irq(d);
 
        return 0;
 }
@@ -153,7 +154,7 @@ static struct irq_chip gpio_irq_chip = {
 static void _set_gpio_direction(struct gpio_chip *chip, unsigned offset,
                                int dir)
 {
-       unsigned int base = GPIO_BASE(offset / 32);
+       void __iomem *base = GPIO_BASE(offset / 32);
        unsigned int reg;
 
        reg = __raw_readl(base + GPIO_DIR);
@@ -166,7 +167,7 @@ static void _set_gpio_direction(struct gpio_chip *chip, unsigned offset,
 
 static void gemini_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
 {
-       unsigned int base = GPIO_BASE(offset / 32);
+       void __iomem *base = GPIO_BASE(offset / 32);
 
        if (value)
                __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)
 
 static int gemini_gpio_get(struct gpio_chip *chip, unsigned offset)
 {
-       unsigned int base = GPIO_BASE(offset / 32);
+       void __iomem *base = GPIO_BASE(offset / 32);
 
        return (__raw_readl(base + GPIO_DATA_IN) >> (offset % 32)) & 1;
 }
index 8c950e1d06be58064789c966c34dc3350bd9c499..98e7b0f286bfdd137be2b5a01e64c24b07b152a0 100644 (file)
@@ -69,6 +69,6 @@
 /*
  * macro to get at IO space when running virtually
  */
-#define IO_ADDRESS(x)  ((((x) & 0xFFF00000) >> 4) | ((x) & 0x000FFFFF) | 0xF0000000)
+#define IO_ADDRESS(x)  IOMEM((((x) & 0xFFF00000) >> 4) | ((x) & 0x000FFFFF) | 0xF0000000)
 
 #endif
diff --git a/arch/arm/mach-gemini/include/mach/system.h b/arch/arm/mach-gemini/include/mach/system.h
deleted file mode 100644 (file)
index a33b5a1..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- *  Copyright (C) 2001-2006 Storlink, Corp.
- *  Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-#ifndef __MACH_SYSTEM_H
-#define __MACH_SYSTEM_H
-
-#include <linux/io.h>
-#include <mach/hardware.h>
-#include <mach/global_reg.h>
-
-static inline void arch_reset(char mode, const char *cmd)
-{
-       __raw_writel(RESET_GLOBAL | RESET_CPU1,
-                    IO_ADDRESS(GEMINI_GLOBAL_BASE) + GLOBAL_RESET);
-}
-
-#endif /* __MACH_SYSTEM_H */
index 020852d3bdd8bd002710e79aba3e036074fefd55..30bef116691eeb05f30a3d43cfae582261556d57 100644 (file)
@@ -65,8 +65,8 @@ static struct irq_chip gemini_irq_chip = {
 
 static struct resource irq_resource = {
        .name   = "irq_handler",
-       .start  = IO_ADDRESS(GEMINI_INTERRUPT_BASE),
-       .end    = IO_ADDRESS(FIQ_STATUS(GEMINI_INTERRUPT_BASE)) + 4,
+       .start  = GEMINI_INTERRUPT_BASE,
+       .end    = FIQ_STATUS(GEMINI_INTERRUPT_BASE) + 4,
 };
 
 void __init gemini_init_irq(void)
index 51948242ec095bbb013dc51bd0cab6a1c09b2065..2c2cd284bb6ad818f7a59cc0a51dd159db0b9a36 100644 (file)
 /* Page table mapping for I/O region */
 static struct map_desc gemini_io_desc[] __initdata = {
        {
-               .virtual        = IO_ADDRESS(GEMINI_GLOBAL_BASE),
+               .virtual        = (unsigned long)IO_ADDRESS(GEMINI_GLOBAL_BASE),
                .pfn            =__phys_to_pfn(GEMINI_GLOBAL_BASE),
                .length         = SZ_512K,
                .type           = MT_DEVICE,
        }, {
-               .virtual        = IO_ADDRESS(GEMINI_UART_BASE),
+               .virtual        = (unsigned long)IO_ADDRESS(GEMINI_UART_BASE),
                .pfn            = __phys_to_pfn(GEMINI_UART_BASE),
                .length         = SZ_512K,
                .type           = MT_DEVICE,
        }, {
-               .virtual        = IO_ADDRESS(GEMINI_TIMER_BASE),
+               .virtual        = (unsigned long)IO_ADDRESS(GEMINI_TIMER_BASE),
                .pfn            = __phys_to_pfn(GEMINI_TIMER_BASE),
                .length         = SZ_512K,
                .type           = MT_DEVICE,
        }, {
-               .virtual        = IO_ADDRESS(GEMINI_INTERRUPT_BASE),
+               .virtual        = (unsigned long)IO_ADDRESS(GEMINI_INTERRUPT_BASE),
                .pfn            = __phys_to_pfn(GEMINI_INTERRUPT_BASE),
                .length         = SZ_512K,
                .type           = MT_DEVICE,
        }, {
-               .virtual        = IO_ADDRESS(GEMINI_POWER_CTRL_BASE),
+               .virtual        = (unsigned long)IO_ADDRESS(GEMINI_POWER_CTRL_BASE),
                .pfn            = __phys_to_pfn(GEMINI_POWER_CTRL_BASE),
                .length         = SZ_512K,
                .type           = MT_DEVICE,
        }, {
-               .virtual        = IO_ADDRESS(GEMINI_GPIO_BASE(0)),
+               .virtual        = (unsigned long)IO_ADDRESS(GEMINI_GPIO_BASE(0)),
                .pfn            = __phys_to_pfn(GEMINI_GPIO_BASE(0)),
                .length         = SZ_512K,
                .type           = MT_DEVICE,
        }, {
-               .virtual        = IO_ADDRESS(GEMINI_GPIO_BASE(1)),
+               .virtual        = (unsigned long)IO_ADDRESS(GEMINI_GPIO_BASE(1)),
                .pfn            = __phys_to_pfn(GEMINI_GPIO_BASE(1)),
                .length         = SZ_512K,
                .type           = MT_DEVICE,
        }, {
-               .virtual        = IO_ADDRESS(GEMINI_GPIO_BASE(2)),
+               .virtual        = (unsigned long)IO_ADDRESS(GEMINI_GPIO_BASE(2)),
                .pfn            = __phys_to_pfn(GEMINI_GPIO_BASE(2)),
                .length         = SZ_512K,
                .type           = MT_DEVICE,
        }, {
-               .virtual        = IO_ADDRESS(GEMINI_FLASH_CTRL_BASE),
+               .virtual        = (unsigned long)IO_ADDRESS(GEMINI_FLASH_CTRL_BASE),
                .pfn            = __phys_to_pfn(GEMINI_FLASH_CTRL_BASE),
                .length         = SZ_512K,
                .type           = MT_DEVICE,
        }, {
-               .virtual        = IO_ADDRESS(GEMINI_DRAM_CTRL_BASE),
+               .virtual        = (unsigned long)IO_ADDRESS(GEMINI_DRAM_CTRL_BASE),
                .pfn            = __phys_to_pfn(GEMINI_DRAM_CTRL_BASE),
                .length         = SZ_512K,
                .type           = MT_DEVICE,
        }, {
-               .virtual        = IO_ADDRESS(GEMINI_GENERAL_DMA_BASE),
+               .virtual        = (unsigned long)IO_ADDRESS(GEMINI_GENERAL_DMA_BASE),
                .pfn            = __phys_to_pfn(GEMINI_GENERAL_DMA_BASE),
                .length         = SZ_512K,
                .type           = MT_DEVICE,
diff --git a/arch/arm/mach-gemini/reset.c b/arch/arm/mach-gemini/reset.c
new file mode 100644 (file)
index 0000000..b266597
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ *  Copyright (C) 2001-2006 Storlink, Corp.
+ *  Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+#ifndef __MACH_SYSTEM_H
+#define __MACH_SYSTEM_H
+
+#include <linux/io.h>
+#include <mach/hardware.h>
+#include <mach/global_reg.h>
+
+void gemini_restart(char mode, const char *cmd)
+{
+       __raw_writel(RESET_GLOBAL | RESET_CPU1,
+                    IO_ADDRESS(GEMINI_GLOBAL_BASE) + GLOBAL_RESET);
+}
+
+#endif /* __MACH_SYSTEM_H */