Nicolas Ferre | 49fe2ba | 2011-10-10 18:29:24 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Setup code for AT91SAM Evaluation Kits with Device Tree support |
| 3 | * |
Nicolas Ferre | 49fe2ba | 2011-10-10 18:29:24 +0200 | [diff] [blame] | 4 | * 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 Ferre | 8014d6f4 | 2012-02-14 18:08:14 +0100 | [diff] [blame] | 14 | #include <linux/of.h> |
| 15 | #include <linux/of_irq.h> |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 16 | #include <linux/of_platform.h> |
Boris BREZILLON | 2db5a93 | 2014-03-12 10:43:41 +0100 | [diff] [blame] | 17 | #include <linux/clk-provider.h> |
Nicolas Ferre | 49fe2ba | 2011-10-10 18:29:24 +0200 | [diff] [blame] | 18 | |
Alexandre Belloni | b9f122cc | 2015-01-15 22:58:08 +0100 | [diff] [blame] | 19 | #include <asm/system_misc.h> |
Nicolas Ferre | 49fe2ba | 2011-10-10 18:29:24 +0200 | [diff] [blame] | 20 | #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 Ferre | 49fe2ba | 2011-10-10 18:29:24 +0200 | [diff] [blame] | 26 | #include "generic.h" |
| 27 | |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 28 | static void __init sam9_dt_device_init(void) |
| 29 | { |
Nicolas Ferre | ea69f99 | 2015-01-23 11:47:37 +0100 | [diff] [blame^] | 30 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
| 31 | |
Alexandre Belloni | b9f122cc | 2015-01-15 22:58:08 +0100 | [diff] [blame] | 32 | arm_pm_idle = at91sam9_idle; |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 33 | at91_sam9260_pm_init(); |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 34 | } |
| 35 | |
Alexandre Belloni | 37e9c4d | 2015-01-22 17:19:04 +0100 | [diff] [blame] | 36 | static const char *at91_dt_board_compat[] __initconst = { |
Jean-Christophe PLAGNIOL-VILLARD | 7c8a98c | 2012-03-01 14:47:44 +0800 | [diff] [blame] | 37 | "atmel,at91sam9", |
Nicolas Ferre | 49fe2ba | 2011-10-10 18:29:24 +0200 | [diff] [blame] | 38 | NULL |
| 39 | }; |
| 40 | |
| 41 | DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)") |
| 42 | /* Maintainer: Atmel */ |
Nicolas Ferre | 49fe2ba | 2011-10-10 18:29:24 +0200 | [diff] [blame] | 43 | .map_io = at91_map_io, |
Jean-Christophe PLAGNIOL-VILLARD | 2b11ea5 | 2012-02-28 13:57:51 +0800 | [diff] [blame] | 44 | .init_early = at91_dt_initialize, |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 45 | .init_machine = sam9_dt_device_init, |
Nicolas Ferre | 49fe2ba | 2011-10-10 18:29:24 +0200 | [diff] [blame] | 46 | .dt_compat = at91_dt_board_compat, |
| 47 | MACHINE_END |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 48 | |
| 49 | static void __init sam9g45_dt_device_init(void) |
| 50 | { |
Nicolas Ferre | ea69f99 | 2015-01-23 11:47:37 +0100 | [diff] [blame^] | 51 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
| 52 | |
Alexandre Belloni | b9f122cc | 2015-01-15 22:58:08 +0100 | [diff] [blame] | 53 | arm_pm_idle = at91sam9_idle; |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 54 | at91_sam9g45_pm_init(); |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | static const char *at91_9g45_board_compat[] __initconst = { |
| 58 | "atmel,at91sam9g45", |
| 59 | NULL |
| 60 | }; |
| 61 | |
| 62 | DT_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, |
| 68 | MACHINE_END |
Nicolas Ferre | bf02280 | 2015-01-22 16:54:50 +0100 | [diff] [blame] | 69 | |
| 70 | static void __init sam9x5_dt_device_init(void) |
| 71 | { |
Nicolas Ferre | ea69f99 | 2015-01-23 11:47:37 +0100 | [diff] [blame^] | 72 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
| 73 | |
Alexandre Belloni | b9f122cc | 2015-01-15 22:58:08 +0100 | [diff] [blame] | 74 | arm_pm_idle = at91sam9_idle; |
Nicolas Ferre | bf02280 | 2015-01-22 16:54:50 +0100 | [diff] [blame] | 75 | at91_sam9x5_pm_init(); |
Nicolas Ferre | bf02280 | 2015-01-22 16:54:50 +0100 | [diff] [blame] | 76 | } |
| 77 | |
| 78 | static const char *at91_9x5_board_compat[] __initconst = { |
| 79 | "atmel,at91sam9x5", |
| 80 | "atmel,at91sam9n12", |
| 81 | NULL |
| 82 | }; |
| 83 | |
| 84 | DT_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, |
| 90 | MACHINE_END |