diff options
author | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2015-03-12 10:54:30 -0400 |
---|---|---|
committer | Nicolas Ferre <nicolas.ferre@atmel.com> | 2015-03-13 11:23:36 -0400 |
commit | e7336083e61c915e84e87b52243c4c437e8776a1 (patch) | |
tree | 755ce02a9befc2ac185d5bdff1bb557ee58a516d | |
parent | d18032d62fe7a84a8bc4867de98233ba5342254b (diff) |
ARM: at91: sama5 use SoC detection infrastructure
Use the soc detection infrastructure for sama5 initialization.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
-rw-r--r-- | arch/arm/mach-at91/sama5.c | 48 | ||||
-rw-r--r-- | arch/arm/mach-at91/soc.h | 13 |
2 files changed, 47 insertions, 14 deletions
diff --git a/arch/arm/mach-at91/sama5.c b/arch/arm/mach-at91/sama5.c index 23d067a91cff..5b13ad7c82ef 100644 --- a/arch/arm/mach-at91/sama5.c +++ b/arch/arm/mach-at91/sama5.c | |||
@@ -7,28 +7,50 @@ | |||
7 | * Licensed under GPLv2 or later. | 7 | * Licensed under GPLv2 or later. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/types.h> | ||
11 | #include <linux/init.h> | ||
12 | #include <linux/module.h> | ||
13 | #include <linux/gpio.h> | ||
14 | #include <linux/of.h> | 10 | #include <linux/of.h> |
15 | #include <linux/of_irq.h> | ||
16 | #include <linux/of_platform.h> | 11 | #include <linux/of_platform.h> |
17 | #include <linux/clk-provider.h> | ||
18 | 12 | ||
19 | #include <mach/hardware.h> | ||
20 | |||
21 | #include <asm/setup.h> | ||
22 | #include <asm/irq.h> | ||
23 | #include <asm/mach/arch.h> | 13 | #include <asm/mach/arch.h> |
24 | #include <asm/mach/map.h> | 14 | #include <asm/mach/map.h> |
25 | #include <asm/mach/irq.h> | 15 | #include <asm/system_misc.h> |
16 | |||
17 | #include <mach/hardware.h> | ||
26 | 18 | ||
27 | #include "generic.h" | 19 | #include "generic.h" |
20 | #include "soc.h" | ||
21 | |||
22 | static const struct at91_soc sama5_socs[] = { | ||
23 | AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D31_EXID_MATCH, | ||
24 | "sama5d31", "sama5d3"), | ||
25 | AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D33_EXID_MATCH, | ||
26 | "sama5d33", "sama5d3"), | ||
27 | AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D34_EXID_MATCH, | ||
28 | "sama5d34", "sama5d3"), | ||
29 | AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D35_EXID_MATCH, | ||
30 | "sama5d35", "sama5d3"), | ||
31 | AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D36_EXID_MATCH, | ||
32 | "sama5d36", "sama5d3"), | ||
33 | AT91_SOC(SAMA5D4_CIDR_MATCH, SAMA5D41_EXID_MATCH, | ||
34 | "sama5d41", "sama5d4"), | ||
35 | AT91_SOC(SAMA5D4_CIDR_MATCH, SAMA5D42_EXID_MATCH, | ||
36 | "sama5d42", "sama5d4"), | ||
37 | AT91_SOC(SAMA5D4_CIDR_MATCH, SAMA5D43_EXID_MATCH, | ||
38 | "sama5d43", "sama5d4"), | ||
39 | AT91_SOC(SAMA5D4_CIDR_MATCH, SAMA5D44_EXID_MATCH, | ||
40 | "sama5d44", "sama5d4"), | ||
41 | { /* sentinel */ }, | ||
42 | }; | ||
28 | 43 | ||
29 | static void __init sama5_dt_device_init(void) | 44 | static void __init sama5_dt_device_init(void) |
30 | { | 45 | { |
31 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 46 | struct soc_device *soc; |
47 | struct device *soc_dev = NULL; | ||
48 | |||
49 | soc = at91_soc_init(sama5_socs); | ||
50 | if (soc != NULL) | ||
51 | soc_dev = soc_device_to_device(soc); | ||
52 | |||
53 | of_platform_populate(NULL, of_default_bus_match_table, NULL, soc_dev); | ||
32 | at91sam9x5_pm_init(); | 54 | at91sam9x5_pm_init(); |
33 | } | 55 | } |
34 | 56 | ||
@@ -39,7 +61,6 @@ static const char *sama5_dt_board_compat[] __initconst = { | |||
39 | 61 | ||
40 | DT_MACHINE_START(sama5_dt, "Atmel SAMA5") | 62 | DT_MACHINE_START(sama5_dt, "Atmel SAMA5") |
41 | /* Maintainer: Atmel */ | 63 | /* Maintainer: Atmel */ |
42 | .map_io = at91_map_io, | ||
43 | .init_machine = sama5_dt_device_init, | 64 | .init_machine = sama5_dt_device_init, |
44 | .dt_compat = sama5_dt_board_compat, | 65 | .dt_compat = sama5_dt_board_compat, |
45 | MACHINE_END | 66 | MACHINE_END |
@@ -73,7 +94,6 @@ static struct map_desc at91_io_desc[] __initdata = { | |||
73 | 94 | ||
74 | static void __init sama5_alt_map_io(void) | 95 | static void __init sama5_alt_map_io(void) |
75 | { | 96 | { |
76 | at91_alt_map_io(); | ||
77 | iotable_init(at91_io_desc, ARRAY_SIZE(at91_io_desc)); | 97 | iotable_init(at91_io_desc, ARRAY_SIZE(at91_io_desc)); |
78 | } | 98 | } |
79 | 99 | ||
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h index 2510c211f291..be23c400596b 100644 --- a/arch/arm/mach-at91/soc.h +++ b/arch/arm/mach-at91/soc.h | |||
@@ -62,4 +62,17 @@ at91_soc_init(const struct at91_soc *socs); | |||
62 | #define AT91SAM9XE256_CIDR_MATCH 0x329a93a0 | 62 | #define AT91SAM9XE256_CIDR_MATCH 0x329a93a0 |
63 | #define AT91SAM9XE512_CIDR_MATCH 0x329aa3a0 | 63 | #define AT91SAM9XE512_CIDR_MATCH 0x329aa3a0 |
64 | 64 | ||
65 | #define SAMA5D3_CIDR_MATCH 0x0a5c07c0 | ||
66 | #define SAMA5D31_EXID_MATCH 0x00444300 | ||
67 | #define SAMA5D33_EXID_MATCH 0x00414300 | ||
68 | #define SAMA5D34_EXID_MATCH 0x00414301 | ||
69 | #define SAMA5D35_EXID_MATCH 0x00584300 | ||
70 | #define SAMA5D36_EXID_MATCH 0x00004301 | ||
71 | |||
72 | #define SAMA5D4_CIDR_MATCH 0x0a5c07c0 | ||
73 | #define SAMA5D41_EXID_MATCH 0x00000001 | ||
74 | #define SAMA5D42_EXID_MATCH 0x00000002 | ||
75 | #define SAMA5D43_EXID_MATCH 0x00000003 | ||
76 | #define SAMA5D44_EXID_MATCH 0x00000004 | ||
77 | |||
65 | #endif /* __AT91_SOC_H */ | 78 | #endif /* __AT91_SOC_H */ |