Nicolas Ferre | 49fe2ba | 2011-10-10 18:29:24 +0200 | [diff] [blame] | 1 | /* |
Nicolas Ferre | cac0172 | 2015-01-27 16:41:55 +0100 | [diff] [blame] | 2 | * Setup code for AT91SAM9 |
Nicolas Ferre | 49fe2ba | 2011-10-10 18:29:24 +0200 | [diff] [blame] | 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 | |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame^] | 28 | static void __init at91sam9_dt_device_init(void) |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 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; |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame^] | 33 | at91sam9260_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 | |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame^] | 41 | DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM9") |
Nicolas Ferre | 49fe2ba | 2011-10-10 18:29:24 +0200 | [diff] [blame] | 42 | /* Maintainer: Atmel */ |
Nicolas Ferre | 49fe2ba | 2011-10-10 18:29:24 +0200 | [diff] [blame] | 43 | .map_io = at91_map_io, |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame^] | 44 | .init_machine = at91sam9_dt_device_init, |
Nicolas Ferre | 49fe2ba | 2011-10-10 18:29:24 +0200 | [diff] [blame] | 45 | .dt_compat = at91_dt_board_compat, |
| 46 | MACHINE_END |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 47 | |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame^] | 48 | static void __init at91sam9g45_dt_device_init(void) |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 49 | { |
Nicolas Ferre | ea69f99 | 2015-01-23 11:47:37 +0100 | [diff] [blame] | 50 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
| 51 | |
Alexandre Belloni | b9f122cc | 2015-01-15 22:58:08 +0100 | [diff] [blame] | 52 | arm_pm_idle = at91sam9_idle; |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame^] | 53 | at91sam9g45_pm_init(); |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 54 | } |
| 55 | |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame^] | 56 | static const char *at91sam9g45_board_compat[] __initconst = { |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 57 | "atmel,at91sam9g45", |
| 58 | NULL |
| 59 | }; |
| 60 | |
| 61 | DT_MACHINE_START(at91sam9g45_dt, "Atmel AT91SAM9G45") |
| 62 | /* Maintainer: Atmel */ |
| 63 | .map_io = at91_map_io, |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame^] | 64 | .init_machine = at91sam9g45_dt_device_init, |
| 65 | .dt_compat = at91sam9g45_board_compat, |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 66 | MACHINE_END |
Nicolas Ferre | bf02280 | 2015-01-22 16:54:50 +0100 | [diff] [blame] | 67 | |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame^] | 68 | static void __init at91sam9x5_dt_device_init(void) |
Nicolas Ferre | bf02280 | 2015-01-22 16:54:50 +0100 | [diff] [blame] | 69 | { |
Nicolas Ferre | ea69f99 | 2015-01-23 11:47:37 +0100 | [diff] [blame] | 70 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
| 71 | |
Alexandre Belloni | b9f122cc | 2015-01-15 22:58:08 +0100 | [diff] [blame] | 72 | arm_pm_idle = at91sam9_idle; |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame^] | 73 | at91sam9x5_pm_init(); |
Nicolas Ferre | bf02280 | 2015-01-22 16:54:50 +0100 | [diff] [blame] | 74 | } |
| 75 | |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame^] | 76 | static const char *at91sam9x5_board_compat[] __initconst = { |
Nicolas Ferre | bf02280 | 2015-01-22 16:54:50 +0100 | [diff] [blame] | 77 | "atmel,at91sam9x5", |
| 78 | "atmel,at91sam9n12", |
| 79 | NULL |
| 80 | }; |
| 81 | |
| 82 | DT_MACHINE_START(at91sam9x5_dt, "Atmel AT91SAM9") |
| 83 | /* Maintainer: Atmel */ |
| 84 | .map_io = at91_map_io, |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame^] | 85 | .init_machine = at91sam9x5_dt_device_init, |
| 86 | .dt_compat = at91sam9x5_board_compat, |
Nicolas Ferre | bf02280 | 2015-01-22 16:54:50 +0100 | [diff] [blame] | 87 | MACHINE_END |