aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Ferre <nicolas.ferre@atmel.com>2015-01-27 09:51:34 -0500
committerNicolas Ferre <nicolas.ferre@atmel.com>2015-02-02 05:01:27 -0500
commit6bd3e3f491062f075c689345763b6172d8438007 (patch)
treee880a2f5663f037738940f73d737d6fee8d34fa7
parent2b019a43cc70d35c3af97c8d673b2b4581f98297 (diff)
ARM: at91: move alternative initial mapping to board-dt-sama5.c
For sama5d4, remove an indirection and the remaining need for at91_boot_soc structure. This will allow further cleanup. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
-rw-r--r--arch/arm/mach-at91/board-dt-sama5.c37
-rw-r--r--arch/arm/mach-at91/sama5d4.c33
-rw-r--r--arch/arm/mach-at91/setup.c6
3 files changed, 36 insertions, 40 deletions
diff --git a/arch/arm/mach-at91/board-dt-sama5.c b/arch/arm/mach-at91/board-dt-sama5.c
index 3ffe46c2bd4c..f9a1b0261f72 100644
--- a/arch/arm/mach-at91/board-dt-sama5.c
+++ b/arch/arm/mach-at91/board-dt-sama5.c
@@ -19,6 +19,8 @@
19#include <linux/clk-provider.h> 19#include <linux/clk-provider.h>
20#include <linux/phy.h> 20#include <linux/phy.h>
21 21
22#include <mach/hardware.h>
23
22#include <asm/setup.h> 24#include <asm/setup.h>
23#include <asm/irq.h> 25#include <asm/irq.h>
24#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
@@ -63,6 +65,39 @@ DT_MACHINE_START(sama5_dt, "Atmel SAMA5 (Device Tree)")
63 .dt_compat = sama5_dt_board_compat, 65 .dt_compat = sama5_dt_board_compat,
64MACHINE_END 66MACHINE_END
65 67
68static struct map_desc at91_io_desc[] __initdata = {
69 {
70 .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_MPDDRC),
71 .pfn = __phys_to_pfn(SAMA5D4_BASE_MPDDRC),
72 .length = SZ_512,
73 .type = MT_DEVICE,
74 },
75 {
76 .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_PMC),
77 .pfn = __phys_to_pfn(SAMA5D4_BASE_PMC),
78 .length = SZ_512,
79 .type = MT_DEVICE,
80 },
81 { /* On sama5d4, we use USART3 as serial console */
82 .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_USART3),
83 .pfn = __phys_to_pfn(SAMA5D4_BASE_USART3),
84 .length = SZ_256,
85 .type = MT_DEVICE,
86 },
87 { /* A bunch of peripheral with fine grained IO space */
88 .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_SYS2),
89 .pfn = __phys_to_pfn(SAMA5D4_BASE_SYS2),
90 .length = SZ_2K,
91 .type = MT_DEVICE,
92 },
93};
94
95static void __init sama5_alt_map_io(void)
96{
97 at91_alt_map_io();
98 iotable_init(at91_io_desc, ARRAY_SIZE(at91_io_desc));
99}
100
66static const char *sama5_alt_dt_board_compat[] __initconst = { 101static const char *sama5_alt_dt_board_compat[] __initconst = {
67 "atmel,sama5d4", 102 "atmel,sama5d4",
68 NULL 103 NULL
@@ -70,7 +105,7 @@ static const char *sama5_alt_dt_board_compat[] __initconst = {
70 105
71DT_MACHINE_START(sama5_alt_dt, "Atmel SAMA5 (Device Tree)") 106DT_MACHINE_START(sama5_alt_dt, "Atmel SAMA5 (Device Tree)")
72 /* Maintainer: Atmel */ 107 /* Maintainer: Atmel */
73 .map_io = at91_alt_map_io, 108 .map_io = sama5_alt_map_io,
74 .init_early = at91_dt_initialize, 109 .init_early = at91_dt_initialize,
75 .init_machine = sama5_dt_device_init, 110 .init_machine = sama5_dt_device_init,
76 .dt_compat = sama5_alt_dt_board_compat, 111 .dt_compat = sama5_alt_dt_board_compat,
diff --git a/arch/arm/mach-at91/sama5d4.c b/arch/arm/mach-at91/sama5d4.c
index fa127fb79221..268f2d238f80 100644
--- a/arch/arm/mach-at91/sama5d4.c
+++ b/arch/arm/mach-at91/sama5d4.c
@@ -25,39 +25,6 @@
25/* -------------------------------------------------------------------- 25/* --------------------------------------------------------------------
26 * Processor initialization 26 * Processor initialization
27 * -------------------------------------------------------------------- */ 27 * -------------------------------------------------------------------- */
28static struct map_desc at91_io_desc[] __initdata = {
29 {
30 .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_MPDDRC),
31 .pfn = __phys_to_pfn(SAMA5D4_BASE_MPDDRC),
32 .length = SZ_512,
33 .type = MT_DEVICE,
34 },
35 {
36 .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_PMC),
37 .pfn = __phys_to_pfn(SAMA5D4_BASE_PMC),
38 .length = SZ_512,
39 .type = MT_DEVICE,
40 },
41 { /* On sama5d4, we use USART3 as serial console */
42 .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_USART3),
43 .pfn = __phys_to_pfn(SAMA5D4_BASE_USART3),
44 .length = SZ_256,
45 .type = MT_DEVICE,
46 },
47 { /* A bunch of peripheral with fine grained IO space */
48 .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_SYS2),
49 .pfn = __phys_to_pfn(SAMA5D4_BASE_SYS2),
50 .length = SZ_2K,
51 .type = MT_DEVICE,
52 },
53};
54
55
56static void __init sama5d4_map_io(void)
57{
58 iotable_init(at91_io_desc, ARRAY_SIZE(at91_io_desc));
59}
60 28
61AT91_SOC_START(sama5d4) 29AT91_SOC_START(sama5d4)
62 .map_io = sama5d4_map_io,
63AT91_SOC_END 30AT91_SOC_END
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index 41abd1708496..af6086b69bb1 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -327,12 +327,6 @@ void __init at91_alt_map_io(void)
327 if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE) 327 if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
328 pr_info("AT91: Detected soc subtype: %s\n", 328 pr_info("AT91: Detected soc subtype: %s\n",
329 at91_get_soc_subtype(&at91_soc_initdata)); 329 at91_get_soc_subtype(&at91_soc_initdata));
330
331 if (!at91_soc_is_enabled())
332 panic("AT91: Soc not enabled");
333
334 if (at91_boot_soc.map_io)
335 at91_boot_soc.map_io();
336} 330}
337 331
338void __iomem *at91_matrix_base; 332void __iomem *at91_matrix_base;