diff options
author | Nicolas Ferre <nicolas.ferre@atmel.com> | 2015-01-27 15:51:34 +0100 |
---|---|---|
committer | Nicolas Ferre <nicolas.ferre@atmel.com> | 2015-02-02 11:01:27 +0100 |
commit | 6bd3e3f491062f075c689345763b6172d8438007 (patch) | |
tree | e880a2f5663f037738940f73d737d6fee8d34fa7 /arch/arm/mach-at91/board-dt-sama5.c | |
parent | 2b019a43cc70d35c3af97c8d673b2b4581f98297 (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>
Diffstat (limited to 'arch/arm/mach-at91/board-dt-sama5.c')
-rw-r--r-- | arch/arm/mach-at91/board-dt-sama5.c | 37 |
1 files changed, 36 insertions, 1 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 @@ #include <linux/clk-provider.h> #include <linux/phy.h> +#include <mach/hardware.h> + #include <asm/setup.h> #include <asm/irq.h> #include <asm/mach/arch.h> @@ -63,6 +65,39 @@ DT_MACHINE_START(sama5_dt, "Atmel SAMA5 (Device Tree)") .dt_compat = sama5_dt_board_compat, MACHINE_END +static struct map_desc at91_io_desc[] __initdata = { + { + .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_MPDDRC), + .pfn = __phys_to_pfn(SAMA5D4_BASE_MPDDRC), + .length = SZ_512, + .type = MT_DEVICE, + }, + { + .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_PMC), + .pfn = __phys_to_pfn(SAMA5D4_BASE_PMC), + .length = SZ_512, + .type = MT_DEVICE, + }, + { /* On sama5d4, we use USART3 as serial console */ + .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_USART3), + .pfn = __phys_to_pfn(SAMA5D4_BASE_USART3), + .length = SZ_256, + .type = MT_DEVICE, + }, + { /* A bunch of peripheral with fine grained IO space */ + .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_SYS2), + .pfn = __phys_to_pfn(SAMA5D4_BASE_SYS2), + .length = SZ_2K, + .type = MT_DEVICE, + }, +}; + +static void __init sama5_alt_map_io(void) +{ + at91_alt_map_io(); + iotable_init(at91_io_desc, ARRAY_SIZE(at91_io_desc)); +} + static const char *sama5_alt_dt_board_compat[] __initconst = { "atmel,sama5d4", NULL @@ -70,7 +105,7 @@ static const char *sama5_alt_dt_board_compat[] __initconst = { DT_MACHINE_START(sama5_alt_dt, "Atmel SAMA5 (Device Tree)") /* Maintainer: Atmel */ - .map_io = at91_alt_map_io, + .map_io = sama5_alt_map_io, .init_early = at91_dt_initialize, .init_machine = sama5_dt_device_init, .dt_compat = sama5_alt_dt_board_compat, |