blob: f5d922e57655dd542ab215be3b2c179e09f4da7c [file] [log] [blame]
Nicolas Ferre49fe2ba2011-10-10 18:29:24 +02001/*
2 * Setup code for AT91SAM Evaluation Kits with Device Tree support
3 *
Nicolas Ferre49fe2ba2011-10-10 18:29:24 +02004 * Copyright (C) 2011 Atmel,
5 * 2011 Nicolas Ferre <nicolas.ferre@atmel.com>
6 *
7 * Licensed under GPLv2 or later.
8 */
9
10#include <linux/types.h>
11#include <linux/init.h>
12#include <linux/module.h>
13#include <linux/gpio.h>
Nicolas Ferre8014d6f42012-02-14 18:08:14 +010014#include <linux/of.h>
15#include <linux/of_irq.h>
Alexandre Belloni4db0ba22015-01-15 15:59:27 +010016#include <linux/of_platform.h>
Boris BREZILLON2db5a932014-03-12 10:43:41 +010017#include <linux/clk-provider.h>
Nicolas Ferre49fe2ba2011-10-10 18:29:24 +020018
Alexandre Bellonib9f122cc2015-01-15 22:58:08 +010019#include <asm/system_misc.h>
Nicolas Ferre49fe2ba2011-10-10 18:29:24 +020020#include <asm/setup.h>
21#include <asm/irq.h>
22#include <asm/mach/arch.h>
23#include <asm/mach/map.h>
24#include <asm/mach/irq.h>
25
Nicolas Ferre49fe2ba2011-10-10 18:29:24 +020026#include "generic.h"
27
Alexandre Belloni4db0ba22015-01-15 15:59:27 +010028static void __init sam9_dt_device_init(void)
29{
Nicolas Ferreea69f992015-01-23 11:47:37 +010030 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
31
Alexandre Bellonib9f122cc2015-01-15 22:58:08 +010032 arm_pm_idle = at91sam9_idle;
Alexandre Belloni4db0ba22015-01-15 15:59:27 +010033 at91_sam9260_pm_init();
Alexandre Belloni4db0ba22015-01-15 15:59:27 +010034}
35
Alexandre Belloni37e9c4d2015-01-22 17:19:04 +010036static const char *at91_dt_board_compat[] __initconst = {
Jean-Christophe PLAGNIOL-VILLARD7c8a98c2012-03-01 14:47:44 +080037 "atmel,at91sam9",
Nicolas Ferre49fe2ba2011-10-10 18:29:24 +020038 NULL
39};
40
41DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)")
42 /* Maintainer: Atmel */
Nicolas Ferre49fe2ba2011-10-10 18:29:24 +020043 .map_io = at91_map_io,
Jean-Christophe PLAGNIOL-VILLARD2b11ea52012-02-28 13:57:51 +080044 .init_early = at91_dt_initialize,
Alexandre Belloni4db0ba22015-01-15 15:59:27 +010045 .init_machine = sam9_dt_device_init,
Nicolas Ferre49fe2ba2011-10-10 18:29:24 +020046 .dt_compat = at91_dt_board_compat,
47MACHINE_END
Alexandre Belloni4db0ba22015-01-15 15:59:27 +010048
49static void __init sam9g45_dt_device_init(void)
50{
Nicolas Ferreea69f992015-01-23 11:47:37 +010051 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
52
Alexandre Bellonib9f122cc2015-01-15 22:58:08 +010053 arm_pm_idle = at91sam9_idle;
Alexandre Belloni4db0ba22015-01-15 15:59:27 +010054 at91_sam9g45_pm_init();
Alexandre Belloni4db0ba22015-01-15 15:59:27 +010055}
56
57static const char *at91_9g45_board_compat[] __initconst = {
58 "atmel,at91sam9g45",
59 NULL
60};
61
62DT_MACHINE_START(at91sam9g45_dt, "Atmel AT91SAM9G45")
63 /* Maintainer: Atmel */
64 .map_io = at91_map_io,
65 .init_early = at91_dt_initialize,
66 .init_machine = sam9g45_dt_device_init,
67 .dt_compat = at91_9g45_board_compat,
68MACHINE_END
Nicolas Ferrebf022802015-01-22 16:54:50 +010069
70static void __init sam9x5_dt_device_init(void)
71{
Nicolas Ferreea69f992015-01-23 11:47:37 +010072 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
73
Alexandre Bellonib9f122cc2015-01-15 22:58:08 +010074 arm_pm_idle = at91sam9_idle;
Nicolas Ferrebf022802015-01-22 16:54:50 +010075 at91_sam9x5_pm_init();
Nicolas Ferrebf022802015-01-22 16:54:50 +010076}
77
78static const char *at91_9x5_board_compat[] __initconst = {
79 "atmel,at91sam9x5",
80 "atmel,at91sam9n12",
81 NULL
82};
83
84DT_MACHINE_START(at91sam9x5_dt, "Atmel AT91SAM9")
85 /* Maintainer: Atmel */
86 .map_io = at91_map_io,
87 .init_early = at91_dt_initialize,
88 .init_machine = sam9x5_dt_device_init,
89 .dt_compat = at91_9x5_board_compat,
90MACHINE_END