aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2017-01-21 16:43:08 -0500
committerLinus Walleij <linus.walleij@linaro.org>2017-03-12 07:27:27 -0400
commit6dbb708a8fb8eef552d8de2b7574d92741b3bb31 (patch)
treeae538d1777ccde044de6ba519f58804fd831814d
parent8e39061ec8910848d537384bc30f574299f0d3f5 (diff)
ARM: gemini: convert to ARMv4 multiplatform
This converts the Gemini platform to ARMv4 multiplatform, deleting the local <mach/*> include directory, moving an idiomatic local idling function into the .machine_init() call and getting rid of the Makefile.boot finally. Cc: Janos Laube <janos.dev@gmail.com> Cc: Paulius Zaleckas <paulius.zaleckas@gmail.com> Cc: Hans Ulli Kroll <ulli.kroll@googlemail.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--arch/arm/Kconfig21
-rw-r--r--arch/arm/mach-gemini/Kconfig13
-rw-r--r--arch/arm/mach-gemini/Makefile2
-rw-r--r--arch/arm/mach-gemini/Makefile.boot1
-rw-r--r--arch/arm/mach-gemini/board-dt.c24
-rw-r--r--arch/arm/mach-gemini/idle.c31
-rw-r--r--arch/arm/mach-gemini/include/mach/hardware.h71
-rw-r--r--arch/arm/mach-gemini/include/mach/uncompress.h42
8 files changed, 40 insertions, 165 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index bfa68a6e4c09..f1e83a7ffdae 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -359,25 +359,6 @@ config ARM_SINGLE_ARMV7M
359 select SPARSE_IRQ 359 select SPARSE_IRQ
360 select USE_OF 360 select USE_OF
361 361
362config ARCH_GEMINI
363 bool "Cortina Systems Gemini"
364 select ARM_APPENDED_DTB # Old Redboot bootloaders deployed
365 select ARM_PATCH_PHYS_VIRT
366 select AUTO_ZRELADDR
367 select CPU_FA526
368 select FARADAY_FTINTC010
369 select FTTMR010_TIMER
370 select GPIO_GEMINI
371 select GPIOLIB
372 select MULTI_IRQ_HANDLER
373 select POWER_RESET
374 select POWER_RESET_SYSCON
375 select SERIAL_OF_PLATFORM
376 select SPARSE_IRQ
377 select USE_OF
378 help
379 Support for the Cortina Systems Gemini family SoCs
380
381config ARCH_EBSA110 362config ARCH_EBSA110
382 bool "EBSA-110" 363 bool "EBSA-110"
383 select ARCH_USES_GETTIMEOFFSET 364 select ARCH_USES_GETTIMEOFFSET
@@ -758,6 +739,8 @@ source "arch/arm/mach-ep93xx/Kconfig"
758 739
759source "arch/arm/mach-footbridge/Kconfig" 740source "arch/arm/mach-footbridge/Kconfig"
760 741
742source "arch/arm/mach-gemini/Kconfig"
743
761source "arch/arm/mach-highbank/Kconfig" 744source "arch/arm/mach-highbank/Kconfig"
762 745
763source "arch/arm/mach-hisi/Kconfig" 746source "arch/arm/mach-hisi/Kconfig"
diff --git a/arch/arm/mach-gemini/Kconfig b/arch/arm/mach-gemini/Kconfig
new file mode 100644
index 000000000000..a5ee5fbab796
--- /dev/null
+++ b/arch/arm/mach-gemini/Kconfig
@@ -0,0 +1,13 @@
1menuconfig ARCH_GEMINI
2 bool "Cortina Systems Gemini"
3 depends on ARCH_MULTI_V4
4 select ARM_APPENDED_DTB # Old Redboot bootloaders deployed
5 select FARADAY_FTINTC010
6 select FTTMR010_TIMER
7 select GPIO_GEMINI
8 select GPIOLIB
9 select POWER_RESET
10 select POWER_RESET_SYSCON
11 select SERIAL_OF_PLATFORM
12 help
13 Support for the Cortina Systems Gemini family SoCs
diff --git a/arch/arm/mach-gemini/Makefile b/arch/arm/mach-gemini/Makefile
index 30c5acffe948..ca0db5477180 100644
--- a/arch/arm/mach-gemini/Makefile
+++ b/arch/arm/mach-gemini/Makefile
@@ -1,2 +1,2 @@
1# Makefile for Cortina systems Gemini 1# Makefile for Cortina systems Gemini
2obj-y := idle.o board-dt.o 2obj-y := board-dt.o
diff --git a/arch/arm/mach-gemini/Makefile.boot b/arch/arm/mach-gemini/Makefile.boot
deleted file mode 100644
index 8e3d1c6e1e38..000000000000
--- a/arch/arm/mach-gemini/Makefile.boot
+++ /dev/null
@@ -1 +0,0 @@
1# Empty on purpose
diff --git a/arch/arm/mach-gemini/board-dt.c b/arch/arm/mach-gemini/board-dt.c
index 208ea99cdc47..c0c0ebdd551e 100644
--- a/arch/arm/mach-gemini/board-dt.c
+++ b/arch/arm/mach-gemini/board-dt.c
@@ -7,6 +7,8 @@
7 7
8#include <asm/mach/arch.h> 8#include <asm/mach/arch.h>
9#include <asm/mach/map.h> 9#include <asm/mach/map.h>
10#include <asm/system_misc.h>
11#include <asm/proc-fns.h>
10 12
11#ifdef CONFIG_DEBUG_GEMINI 13#ifdef CONFIG_DEBUG_GEMINI
12/* This is needed for LL-debug/earlyprintk/debug-macro.S */ 14/* This is needed for LL-debug/earlyprintk/debug-macro.S */
@@ -27,6 +29,27 @@ static void __init gemini_map_io(void)
27#define gemini_map_io NULL 29#define gemini_map_io NULL
28#endif 30#endif
29 31
32static void gemini_idle(void)
33{
34 /*
35 * Because of broken hardware we have to enable interrupts or the CPU
36 * will never wakeup... Acctualy it is not very good to enable
37 * interrupts first since scheduler can miss a tick, but there is
38 * no other way around this. Platforms that needs it for power saving
39 * should enable it in init code, since by default it is
40 * disabled.
41 */
42
43 /* FIXME: Enabling interrupts here is racy! */
44 local_irq_enable();
45 cpu_do_idle();
46}
47
48static void __init gemini_init_machine(void)
49{
50 arm_pm_idle = gemini_idle;
51}
52
30static const char *gemini_board_compat[] = { 53static const char *gemini_board_compat[] = {
31 "cortina,gemini", 54 "cortina,gemini",
32 NULL, 55 NULL,
@@ -34,5 +57,6 @@ static const char *gemini_board_compat[] = {
34 57
35DT_MACHINE_START(GEMINI_DT, "Gemini (Device Tree)") 58DT_MACHINE_START(GEMINI_DT, "Gemini (Device Tree)")
36 .map_io = gemini_map_io, 59 .map_io = gemini_map_io,
60 .init_machine = gemini_init_machine,
37 .dt_compat = gemini_board_compat, 61 .dt_compat = gemini_board_compat,
38MACHINE_END 62MACHINE_END
diff --git a/arch/arm/mach-gemini/idle.c b/arch/arm/mach-gemini/idle.c
deleted file mode 100644
index ddf8ec9d203b..000000000000
--- a/arch/arm/mach-gemini/idle.c
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * arch/arm/mach-gemini/idle.c
3 */
4
5#include <linux/init.h>
6#include <asm/system_misc.h>
7#include <asm/proc-fns.h>
8
9static void gemini_idle(void)
10{
11 /*
12 * Because of broken hardware we have to enable interrupts or the CPU
13 * will never wakeup... Acctualy it is not very good to enable
14 * interrupts first since scheduler can miss a tick, but there is
15 * no other way around this. Platforms that needs it for power saving
16 * should enable it in init code, since by default it is
17 * disabled.
18 */
19
20 /* FIXME: Enabling interrupts here is racy! */
21 local_irq_enable();
22 cpu_do_idle();
23}
24
25static int __init gemini_idle_init(void)
26{
27 arm_pm_idle = gemini_idle;
28 return 0;
29}
30
31arch_initcall(gemini_idle_init);
diff --git a/arch/arm/mach-gemini/include/mach/hardware.h b/arch/arm/mach-gemini/include/mach/hardware.h
deleted file mode 100644
index f0390f184742..000000000000
--- a/arch/arm/mach-gemini/include/mach/hardware.h
+++ /dev/null
@@ -1,71 +0,0 @@
1/*
2 * This file contains the hardware definitions for Gemini.
3 *
4 * Copyright (C) 2001-2006 Storlink, Corp.
5 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12#ifndef __MACH_HARDWARE_H
13#define __MACH_HARDWARE_H
14
15/*
16 * Memory Map definitions
17 */
18#ifdef CONFIG_GEMINI_MEM_SWAP
19# define GEMINI_DRAM_BASE 0x00000000
20# define GEMINI_SRAM_BASE 0x70000000
21#else
22# define GEMINI_SRAM_BASE 0x00000000
23# define GEMINI_DRAM_BASE 0x10000000
24#endif
25#define GEMINI_FLASH_BASE 0x30000000
26#define GEMINI_GLOBAL_BASE 0x40000000
27#define GEMINI_WAQTCHDOG_BASE 0x41000000
28#define GEMINI_UART_BASE 0x42000000
29#define GEMINI_TIMER_BASE 0x43000000
30#define GEMINI_LCD_BASE 0x44000000
31#define GEMINI_RTC_BASE 0x45000000
32#define GEMINI_SATA_BASE 0x46000000
33#define GEMINI_LPC_HOST_BASE 0x47000000
34#define GEMINI_LPC_IO_BASE 0x47800000
35#define GEMINI_INTERRUPT_BASE 0x48000000
36/* TODO: Different interrupt controllers when SMP
37 * #define GEMINI_INTERRUPT0_BASE 0x48000000
38 * #define GEMINI_INTERRUPT1_BASE 0x49000000
39 */
40#define GEMINI_SSP_CTRL_BASE 0x4A000000
41#define GEMINI_POWER_CTRL_BASE 0x4B000000
42#define GEMINI_CIR_BASE 0x4C000000
43#define GEMINI_GPIO_BASE(x) (0x4D000000 + (x) * 0x1000000)
44#define GEMINI_PCI_IO_BASE 0x50000000
45#define GEMINI_PCI_MEM_BASE 0x58000000
46#define GEMINI_TOE_BASE 0x60000000
47#define GEMINI_GMAC0_BASE 0x6000A000
48#define GEMINI_GMAC1_BASE 0x6000E000
49#define GEMINI_SECURITY_BASE 0x62000000
50#define GEMINI_IDE0_BASE 0x63000000
51#define GEMINI_IDE1_BASE 0x63400000
52#define GEMINI_RAID_BASE 0x64000000
53#define GEMINI_FLASH_CTRL_BASE 0x65000000
54#define GEMINI_DRAM_CTRL_BASE 0x66000000
55#define GEMINI_GENERAL_DMA_BASE 0x67000000
56#define GEMINI_USB0_BASE 0x68000000
57#define GEMINI_USB1_BASE 0x69000000
58#define GEMINI_BIG_ENDIAN_BASE 0x80000000
59
60
61/*
62 * UART Clock when System clk is 150MHz
63 */
64#define UART_CLK 48000000
65
66/*
67 * macro to get at IO space when running virtually
68 */
69#define IO_ADDRESS(x) IOMEM((((x) & 0xFFF00000) >> 4) | ((x) & 0x000FFFFF) | 0xF0000000)
70
71#endif
diff --git a/arch/arm/mach-gemini/include/mach/uncompress.h b/arch/arm/mach-gemini/include/mach/uncompress.h
deleted file mode 100644
index 02e225673acb..000000000000
--- a/arch/arm/mach-gemini/include/mach/uncompress.h
+++ /dev/null
@@ -1,42 +0,0 @@
1/*
2 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
3 *
4 * Based on mach-pxa/include/mach/uncompress.h:
5 * Copyright: (C) 2001 MontaVista Software Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef __MACH_UNCOMPRESS_H
14#define __MACH_UNCOMPRESS_H
15
16#include <linux/serial_reg.h>
17#include <mach/hardware.h>
18
19static volatile unsigned long * const UART = (unsigned long *)GEMINI_UART_BASE;
20
21/*
22 * The following code assumes the serial port has already been
23 * initialized by the bootloader. If you didn't setup a port in
24 * your bootloader then nothing will appear (which might be desired).
25 */
26static inline void putc(char c)
27{
28 while (!(UART[UART_LSR] & UART_LSR_THRE))
29 barrier();
30 UART[UART_TX] = c;
31}
32
33static inline void flush(void)
34{
35}
36
37/*
38 * nothing to do
39 */
40#define arch_decomp_setup()
41
42#endif /* __MACH_UNCOMPRESS_H */