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 | |
Nicolas Ferre | 8014d6f | 2012-02-14 18:08:14 +0100 | [diff] [blame] | 10 | #include <linux/of.h> |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 11 | #include <linux/of_platform.h> |
Nicolas Ferre | 49fe2ba | 2011-10-10 18:29:24 +0200 | [diff] [blame] | 12 | |
Nicolas Ferre | 49fe2ba | 2011-10-10 18:29:24 +0200 | [diff] [blame] | 13 | #include <asm/mach/arch.h> |
Alexandre Belloni | d18032d | 2015-03-12 15:54:29 +0100 | [diff] [blame] | 14 | #include <asm/system_misc.h> |
Nicolas Ferre | 49fe2ba | 2011-10-10 18:29:24 +0200 | [diff] [blame] | 15 | |
Nicolas Ferre | 49fe2ba | 2011-10-10 18:29:24 +0200 | [diff] [blame] | 16 | #include "generic.h" |
Alexandre Belloni | d18032d | 2015-03-12 15:54:29 +0100 | [diff] [blame] | 17 | #include "soc.h" |
| 18 | |
| 19 | static const struct at91_soc at91sam9_socs[] = { |
| 20 | AT91_SOC(AT91SAM9260_CIDR_MATCH, 0, "at91sam9260", NULL), |
| 21 | AT91_SOC(AT91SAM9261_CIDR_MATCH, 0, "at91sam9261", NULL), |
| 22 | AT91_SOC(AT91SAM9263_CIDR_MATCH, 0, "at91sam9263", NULL), |
| 23 | AT91_SOC(AT91SAM9G20_CIDR_MATCH, 0, "at91sam9g20", NULL), |
| 24 | AT91_SOC(AT91SAM9RL64_CIDR_MATCH, 0, "at91sam9rl64", NULL), |
| 25 | AT91_SOC(AT91SAM9G45_CIDR_MATCH, AT91SAM9M11_EXID_MATCH, |
| 26 | "at91sam9m11", "at91sam9g45"), |
| 27 | AT91_SOC(AT91SAM9G45_CIDR_MATCH, AT91SAM9M10_EXID_MATCH, |
| 28 | "at91sam9m10", "at91sam9g45"), |
| 29 | AT91_SOC(AT91SAM9G45_CIDR_MATCH, AT91SAM9G46_EXID_MATCH, |
| 30 | "at91sam9g46", "at91sam9g45"), |
| 31 | AT91_SOC(AT91SAM9G45_CIDR_MATCH, AT91SAM9G45_EXID_MATCH, |
| 32 | "at91sam9g45", "at91sam9g45"), |
| 33 | AT91_SOC(AT91SAM9X5_CIDR_MATCH, AT91SAM9G15_EXID_MATCH, |
| 34 | "at91sam9g15", "at91sam9x5"), |
| 35 | AT91_SOC(AT91SAM9X5_CIDR_MATCH, AT91SAM9G35_EXID_MATCH, |
| 36 | "at91sam9g35", "at91sam9x5"), |
| 37 | AT91_SOC(AT91SAM9X5_CIDR_MATCH, AT91SAM9X35_EXID_MATCH, |
| 38 | "at91sam9x35", "at91sam9x5"), |
| 39 | AT91_SOC(AT91SAM9X5_CIDR_MATCH, AT91SAM9G25_EXID_MATCH, |
| 40 | "at91sam9g25", "at91sam9x5"), |
| 41 | AT91_SOC(AT91SAM9X5_CIDR_MATCH, AT91SAM9X25_EXID_MATCH, |
| 42 | "at91sam9x25", "at91sam9x5"), |
| 43 | AT91_SOC(AT91SAM9N12_CIDR_MATCH, AT91SAM9CN12_EXID_MATCH, |
| 44 | "at91sam9cn12", "at91sam9n12"), |
| 45 | AT91_SOC(AT91SAM9N12_CIDR_MATCH, AT91SAM9N12_EXID_MATCH, |
| 46 | "at91sam9n12", "at91sam9n12"), |
| 47 | AT91_SOC(AT91SAM9N12_CIDR_MATCH, AT91SAM9CN11_EXID_MATCH, |
| 48 | "at91sam9cn11", "at91sam9n12"), |
| 49 | AT91_SOC(AT91SAM9XE128_CIDR_MATCH, 0, "at91sam9xe128", "at91sam9xe128"), |
| 50 | AT91_SOC(AT91SAM9XE256_CIDR_MATCH, 0, "at91sam9xe256", "at91sam9xe256"), |
| 51 | AT91_SOC(AT91SAM9XE512_CIDR_MATCH, 0, "at91sam9xe512", "at91sam9xe512"), |
| 52 | { /* sentinel */ }, |
| 53 | }; |
| 54 | |
| 55 | static void __init at91sam9_common_init(void) |
| 56 | { |
| 57 | struct soc_device *soc; |
| 58 | struct device *soc_dev = NULL; |
| 59 | |
| 60 | soc = at91_soc_init(at91sam9_socs); |
| 61 | if (soc != NULL) |
| 62 | soc_dev = soc_device_to_device(soc); |
| 63 | |
| 64 | of_platform_populate(NULL, of_default_bus_match_table, NULL, soc_dev); |
| 65 | |
| 66 | arm_pm_idle = at91sam9_idle; |
| 67 | } |
Nicolas Ferre | 49fe2ba | 2011-10-10 18:29:24 +0200 | [diff] [blame] | 68 | |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame] | 69 | static void __init at91sam9_dt_device_init(void) |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 70 | { |
Alexandre Belloni | d18032d | 2015-03-12 15:54:29 +0100 | [diff] [blame] | 71 | at91sam9_common_init(); |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame] | 72 | at91sam9260_pm_init(); |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 73 | } |
| 74 | |
Nicolas Pitre | 19c233b | 2015-07-27 18:27:52 -0400 | [diff] [blame] | 75 | static const char *const at91_dt_board_compat[] __initconst = { |
Jean-Christophe PLAGNIOL-VILLARD | 7c8a98c | 2012-03-01 14:47:44 +0800 | [diff] [blame] | 76 | "atmel,at91sam9", |
Nicolas Ferre | 49fe2ba | 2011-10-10 18:29:24 +0200 | [diff] [blame] | 77 | NULL |
| 78 | }; |
| 79 | |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame] | 80 | DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM9") |
Nicolas Ferre | 49fe2ba | 2011-10-10 18:29:24 +0200 | [diff] [blame] | 81 | /* Maintainer: Atmel */ |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame] | 82 | .init_machine = at91sam9_dt_device_init, |
Nicolas Ferre | 49fe2ba | 2011-10-10 18:29:24 +0200 | [diff] [blame] | 83 | .dt_compat = at91_dt_board_compat, |
| 84 | MACHINE_END |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 85 | |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame] | 86 | static void __init at91sam9g45_dt_device_init(void) |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 87 | { |
Alexandre Belloni | d18032d | 2015-03-12 15:54:29 +0100 | [diff] [blame] | 88 | at91sam9_common_init(); |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame] | 89 | at91sam9g45_pm_init(); |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 90 | } |
| 91 | |
Nicolas Pitre | 19c233b | 2015-07-27 18:27:52 -0400 | [diff] [blame] | 92 | static const char *const at91sam9g45_board_compat[] __initconst = { |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 93 | "atmel,at91sam9g45", |
| 94 | NULL |
| 95 | }; |
| 96 | |
| 97 | DT_MACHINE_START(at91sam9g45_dt, "Atmel AT91SAM9G45") |
| 98 | /* Maintainer: Atmel */ |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame] | 99 | .init_machine = at91sam9g45_dt_device_init, |
| 100 | .dt_compat = at91sam9g45_board_compat, |
Alexandre Belloni | 4db0ba2 | 2015-01-15 15:59:27 +0100 | [diff] [blame] | 101 | MACHINE_END |
Nicolas Ferre | bf02280 | 2015-01-22 16:54:50 +0100 | [diff] [blame] | 102 | |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame] | 103 | static void __init at91sam9x5_dt_device_init(void) |
Nicolas Ferre | bf02280 | 2015-01-22 16:54:50 +0100 | [diff] [blame] | 104 | { |
Alexandre Belloni | d18032d | 2015-03-12 15:54:29 +0100 | [diff] [blame] | 105 | at91sam9_common_init(); |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame] | 106 | at91sam9x5_pm_init(); |
Nicolas Ferre | bf02280 | 2015-01-22 16:54:50 +0100 | [diff] [blame] | 107 | } |
| 108 | |
Nicolas Pitre | 19c233b | 2015-07-27 18:27:52 -0400 | [diff] [blame] | 109 | static const char *const at91sam9x5_board_compat[] __initconst = { |
Nicolas Ferre | bf02280 | 2015-01-22 16:54:50 +0100 | [diff] [blame] | 110 | "atmel,at91sam9x5", |
| 111 | "atmel,at91sam9n12", |
| 112 | NULL |
| 113 | }; |
| 114 | |
| 115 | DT_MACHINE_START(at91sam9x5_dt, "Atmel AT91SAM9") |
| 116 | /* Maintainer: Atmel */ |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame] | 117 | .init_machine = at91sam9x5_dt_device_init, |
| 118 | .dt_compat = at91sam9x5_board_compat, |
Nicolas Ferre | bf02280 | 2015-01-22 16:54:50 +0100 | [diff] [blame] | 119 | MACHINE_END |