Ludovic Desroches | 8f4b479 | 2013-03-22 13:24:12 +0000 | [diff] [blame] | 1 | /* |
Nicolas Ferre | cac0172 | 2015-01-27 16:41:55 +0100 | [diff] [blame] | 2 | * Setup code for SAMA5 |
Ludovic Desroches | 8f4b479 | 2013-03-22 13:24:12 +0000 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2013 Atmel, |
| 5 | * 2013 Ludovic Desroches <ludovic.desroches@atmel.com> |
| 6 | * |
| 7 | * Licensed under GPLv2 or later. |
| 8 | */ |
| 9 | |
Ludovic Desroches | 8f4b479 | 2013-03-22 13:24:12 +0000 | [diff] [blame] | 10 | #include <linux/of.h> |
Ludovic Desroches | 8f4b479 | 2013-03-22 13:24:12 +0000 | [diff] [blame] | 11 | #include <linux/of_platform.h> |
Alexandre Belloni | e733608 | 2015-03-12 15:54:30 +0100 | [diff] [blame] | 12 | |
| 13 | #include <asm/mach/arch.h> |
| 14 | #include <asm/mach/map.h> |
| 15 | #include <asm/system_misc.h> |
Ludovic Desroches | 8f4b479 | 2013-03-22 13:24:12 +0000 | [diff] [blame] | 16 | |
Ludovic Desroches | 8f4b479 | 2013-03-22 13:24:12 +0000 | [diff] [blame] | 17 | #include "generic.h" |
Alexandre Belloni | e733608 | 2015-03-12 15:54:30 +0100 | [diff] [blame] | 18 | #include "soc.h" |
| 19 | |
| 20 | static const struct at91_soc sama5_socs[] = { |
Ludovic Desroches | c07f98a | 2016-03-18 08:21:20 +0100 | [diff] [blame] | 21 | AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D21CU_EXID_MATCH, |
| 22 | "sama5d21", "sama5d2"), |
| 23 | AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D22CU_EXID_MATCH, |
| 24 | "sama5d22", "sama5d2"), |
| 25 | AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D23CU_EXID_MATCH, |
| 26 | "sama5d23", "sama5d2"), |
| 27 | AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D24CX_EXID_MATCH, |
| 28 | "sama5d24", "sama5d2"), |
| 29 | AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D24CU_EXID_MATCH, |
| 30 | "sama5d24", "sama5d2"), |
| 31 | AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D26CU_EXID_MATCH, |
| 32 | "sama5d26", "sama5d2"), |
| 33 | AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D27CU_EXID_MATCH, |
Nicolas Ferre | c268a74 | 2015-07-30 19:12:12 +0200 | [diff] [blame] | 34 | "sama5d27", "sama5d2"), |
Ludovic Desroches | c07f98a | 2016-03-18 08:21:20 +0100 | [diff] [blame] | 35 | AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D27CN_EXID_MATCH, |
| 36 | "sama5d27", "sama5d2"), |
| 37 | AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D28CU_EXID_MATCH, |
| 38 | "sama5d28", "sama5d2"), |
| 39 | AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D28CN_EXID_MATCH, |
| 40 | "sama5d28", "sama5d2"), |
Alexandre Belloni | e733608 | 2015-03-12 15:54:30 +0100 | [diff] [blame] | 41 | AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D31_EXID_MATCH, |
| 42 | "sama5d31", "sama5d3"), |
| 43 | AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D33_EXID_MATCH, |
| 44 | "sama5d33", "sama5d3"), |
| 45 | AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D34_EXID_MATCH, |
| 46 | "sama5d34", "sama5d3"), |
| 47 | AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D35_EXID_MATCH, |
| 48 | "sama5d35", "sama5d3"), |
| 49 | AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D36_EXID_MATCH, |
| 50 | "sama5d36", "sama5d3"), |
| 51 | AT91_SOC(SAMA5D4_CIDR_MATCH, SAMA5D41_EXID_MATCH, |
| 52 | "sama5d41", "sama5d4"), |
| 53 | AT91_SOC(SAMA5D4_CIDR_MATCH, SAMA5D42_EXID_MATCH, |
| 54 | "sama5d42", "sama5d4"), |
| 55 | AT91_SOC(SAMA5D4_CIDR_MATCH, SAMA5D43_EXID_MATCH, |
| 56 | "sama5d43", "sama5d4"), |
| 57 | AT91_SOC(SAMA5D4_CIDR_MATCH, SAMA5D44_EXID_MATCH, |
| 58 | "sama5d44", "sama5d4"), |
| 59 | { /* sentinel */ }, |
| 60 | }; |
Ludovic Desroches | 8f4b479 | 2013-03-22 13:24:12 +0000 | [diff] [blame] | 61 | |
Ludovic Desroches | 8f4b479 | 2013-03-22 13:24:12 +0000 | [diff] [blame] | 62 | static void __init sama5_dt_device_init(void) |
| 63 | { |
Alexandre Belloni | e733608 | 2015-03-12 15:54:30 +0100 | [diff] [blame] | 64 | struct soc_device *soc; |
| 65 | struct device *soc_dev = NULL; |
| 66 | |
| 67 | soc = at91_soc_init(sama5_socs); |
| 68 | if (soc != NULL) |
| 69 | soc_dev = soc_device_to_device(soc); |
| 70 | |
Kefeng Wang | 435ebcb | 2016-06-01 14:53:05 +0800 | [diff] [blame] | 71 | of_platform_default_populate(NULL, NULL, soc_dev); |
Alexandre Belloni | fbc7edc | 2015-09-30 01:58:40 +0200 | [diff] [blame] | 72 | sama5_pm_init(); |
Ludovic Desroches | 8f4b479 | 2013-03-22 13:24:12 +0000 | [diff] [blame] | 73 | } |
| 74 | |
Nicolas Pitre | 19c233b | 2015-07-27 18:27:52 -0400 | [diff] [blame] | 75 | static const char *const sama5_dt_board_compat[] __initconst = { |
Ludovic Desroches | 8f4b479 | 2013-03-22 13:24:12 +0000 | [diff] [blame] | 76 | "atmel,sama5", |
| 77 | NULL |
| 78 | }; |
| 79 | |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame] | 80 | DT_MACHINE_START(sama5_dt, "Atmel SAMA5") |
Ludovic Desroches | 8f4b479 | 2013-03-22 13:24:12 +0000 | [diff] [blame] | 81 | /* Maintainer: Atmel */ |
Ludovic Desroches | 8f4b479 | 2013-03-22 13:24:12 +0000 | [diff] [blame] | 82 | .init_machine = sama5_dt_device_init, |
| 83 | .dt_compat = sama5_dt_board_compat, |
| 84 | MACHINE_END |
Nicolas Ferre | 726d32b | 2014-09-15 18:15:55 +0200 | [diff] [blame] | 85 | |
Nicolas Pitre | 19c233b | 2015-07-27 18:27:52 -0400 | [diff] [blame] | 86 | static const char *const sama5_alt_dt_board_compat[] __initconst = { |
Nicolas Ferre | c268a74 | 2015-07-30 19:12:12 +0200 | [diff] [blame] | 87 | "atmel,sama5d2", |
Nicolas Ferre | 726d32b | 2014-09-15 18:15:55 +0200 | [diff] [blame] | 88 | "atmel,sama5d4", |
| 89 | NULL |
| 90 | }; |
| 91 | |
Nicolas Ferre | ad3fc3e | 2015-01-27 18:41:33 +0100 | [diff] [blame] | 92 | DT_MACHINE_START(sama5_alt_dt, "Atmel SAMA5") |
Nicolas Ferre | 726d32b | 2014-09-15 18:15:55 +0200 | [diff] [blame] | 93 | /* Maintainer: Atmel */ |
Nicolas Ferre | 726d32b | 2014-09-15 18:15:55 +0200 | [diff] [blame] | 94 | .init_machine = sama5_dt_device_init, |
| 95 | .dt_compat = sama5_alt_dt_board_compat, |
| 96 | .l2c_aux_mask = ~0UL, |
| 97 | MACHINE_END |