diff options
Diffstat (limited to 'arch/arm/mach-gemini')
-rw-r--r-- | arch/arm/mach-gemini/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-gemini/board-nas4220b.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-gemini/board-rut1xx.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-gemini/board-wbd111.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-gemini/board-wbd222.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-gemini/common.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-gemini/gpio.c | 19 | ||||
-rw-r--r-- | arch/arm/mach-gemini/idle.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-gemini/include/mach/hardware.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-gemini/irq.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-gemini/mm.c | 22 | ||||
-rw-r--r-- | arch/arm/mach-gemini/reset.c (renamed from arch/arm/mach-gemini/include/mach/system.h) | 2 |
12 files changed, 39 insertions, 27 deletions
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 @@ # 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 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") .init_irq = gemini_init_irq, .init_time = gemini_timer_init, .init_machine = ib4220b_init, + .restart = gemini_restart, MACHINE_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 @@ #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 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") .init_irq = gemini_init_irq, .init_time = gemini_timer_init, .init_machine = wbd111_init, + .restart = gemini_restart, MACHINE_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") .init_irq = gemini_init_irq, .init_time = gemini_timer_init, .init_machine = wbd222_init, + .restart = gemini_restart, MACHINE_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, struct mtd_partition *parts, unsigned int nr_parts); +extern void gemini_restart(char mode, const char *cmd); + #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 @@ #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; } diff --git a/arch/arm/mach-gemini/idle.c b/arch/arm/mach-gemini/idle.c index 92bbd6bb600a..87dff4f5059e 100644 --- a/arch/arm/mach-gemini/idle.c +++ b/arch/arm/mach-gemini/idle.c @@ -13,9 +13,11 @@ static void gemini_idle(void) * will never wakeup... Acctualy it is not very good to enable * interrupts first since scheduler can miss a tick, but there is * no other way around this. Platforms that needs it for power saving - * should call enable_hlt() in init code, since by default it is + * should enable it in init code, since by default it is * disabled. */ + + /* FIXME: Enabling interrupts here is racy! */ local_irq_enable(); cpu_do_idle(); } 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 @@ /* * 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/irq.c b/arch/arm/mach-gemini/irq.c index 020852d3bdd8..44f50dcb616d 100644 --- a/arch/arm/mach-gemini/irq.c +++ b/arch/arm/mach-gemini/irq.c @@ -15,6 +15,8 @@ #include <linux/stddef.h> #include <linux/list.h> #include <linux/sched.h> +#include <linux/cpu.h> + #include <asm/irq.h> #include <asm/mach/irq.h> #include <asm/system_misc.h> @@ -65,8 +67,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) @@ -77,7 +79,7 @@ void __init gemini_init_irq(void) * Disable the idle handler by default since it is buggy * For more info see arch/arm/mach-gemini/idle.c */ - disable_hlt(); + cpu_idle_poll_ctrl(true); request_resource(&iomem_resource, &irq_resource); 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 @@ /* 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/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 @@ #include <mach/hardware.h> #include <mach/global_reg.h> -static inline void arch_reset(char mode, const char *cmd) +void gemini_restart(char mode, const char *cmd) { __raw_writel(RESET_GLOBAL | RESET_CPU1, IO_ADDRESS(GEMINI_GLOBAL_BASE) + GLOBAL_RESET); |