4 * Copyright (C) 2013 Atmel,
5 * 2013 Ludovic Desroches <ludovic.desroches@atmel.com>
7 * Licensed under GPLv2 or later.
10 #include <linux/types.h>
11 #include <linux/init.h>
12 #include <linux/module.h>
13 #include <linux/gpio.h>
15 #include <linux/of_irq.h>
16 #include <linux/of_platform.h>
17 #include <linux/clk-provider.h>
19 #include <mach/hardware.h>
21 #include <asm/setup.h>
23 #include <asm/mach/arch.h>
24 #include <asm/mach/map.h>
25 #include <asm/mach/irq.h>
29 static void __init sama5_dt_device_init(void)
31 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
35 static const char *sama5_dt_board_compat[] __initconst = {
40 DT_MACHINE_START(sama5_dt, "Atmel SAMA5")
41 /* Maintainer: Atmel */
42 .map_io = at91_map_io,
43 .init_machine = sama5_dt_device_init,
44 .dt_compat = sama5_dt_board_compat,
47 static struct map_desc at91_io_desc[] __initdata = {
49 .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_MPDDRC),
50 .pfn = __phys_to_pfn(SAMA5D4_BASE_MPDDRC),
55 .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_PMC),
56 .pfn = __phys_to_pfn(SAMA5D4_BASE_PMC),
60 { /* On sama5d4, we use USART3 as serial console */
61 .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_USART3),
62 .pfn = __phys_to_pfn(SAMA5D4_BASE_USART3),
66 { /* A bunch of peripheral with fine grained IO space */
67 .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_SYS2),
68 .pfn = __phys_to_pfn(SAMA5D4_BASE_SYS2),
74 static void __init sama5_alt_map_io(void)
77 iotable_init(at91_io_desc, ARRAY_SIZE(at91_io_desc));
80 static const char *sama5_alt_dt_board_compat[] __initconst = {
85 DT_MACHINE_START(sama5_alt_dt, "Atmel SAMA5")
86 /* Maintainer: Atmel */
87 .map_io = sama5_alt_map_io,
88 .init_machine = sama5_dt_device_init,
89 .dt_compat = sama5_alt_dt_board_compat,