diff options
Diffstat (limited to 'arch/arm/mach-at91/at91sam9.c')
-rw-r--r-- | arch/arm/mach-at91/at91sam9.c | 76 |
1 files changed, 54 insertions, 22 deletions
diff --git a/arch/arm/mach-at91/at91sam9.c b/arch/arm/mach-at91/at91sam9.c index 56e3ba73ec40..e47a2093a0e7 100644 --- a/arch/arm/mach-at91/at91sam9.c +++ b/arch/arm/mach-at91/at91sam9.c | |||
@@ -7,29 +7,68 @@ | |||
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 <asm/system_misc.h> | ||
20 | #include <asm/setup.h> | ||
21 | #include <asm/irq.h> | ||
22 | #include <asm/mach/arch.h> | 13 | #include <asm/mach/arch.h> |
23 | #include <asm/mach/map.h> | 14 | #include <asm/system_misc.h> |
24 | #include <asm/mach/irq.h> | ||
25 | 15 | ||
26 | #include "generic.h" | 16 | #include "generic.h" |
17 | #include "soc.h" | ||
27 | 18 | ||
28 | static void __init at91sam9_dt_device_init(void) | 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) | ||
29 | { | 56 | { |
30 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 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); | ||
31 | 65 | ||
32 | arm_pm_idle = at91sam9_idle; | 66 | arm_pm_idle = at91sam9_idle; |
67 | } | ||
68 | |||
69 | static void __init at91sam9_dt_device_init(void) | ||
70 | { | ||
71 | at91sam9_common_init(); | ||
33 | at91sam9260_pm_init(); | 72 | at91sam9260_pm_init(); |
34 | } | 73 | } |
35 | 74 | ||
@@ -40,16 +79,13 @@ static const char *at91_dt_board_compat[] __initconst = { | |||
40 | 79 | ||
41 | DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM9") | 80 | DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM9") |
42 | /* Maintainer: Atmel */ | 81 | /* Maintainer: Atmel */ |
43 | .map_io = at91_map_io, | ||
44 | .init_machine = at91sam9_dt_device_init, | 82 | .init_machine = at91sam9_dt_device_init, |
45 | .dt_compat = at91_dt_board_compat, | 83 | .dt_compat = at91_dt_board_compat, |
46 | MACHINE_END | 84 | MACHINE_END |
47 | 85 | ||
48 | static void __init at91sam9g45_dt_device_init(void) | 86 | static void __init at91sam9g45_dt_device_init(void) |
49 | { | 87 | { |
50 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 88 | at91sam9_common_init(); |
51 | |||
52 | arm_pm_idle = at91sam9_idle; | ||
53 | at91sam9g45_pm_init(); | 89 | at91sam9g45_pm_init(); |
54 | } | 90 | } |
55 | 91 | ||
@@ -60,16 +96,13 @@ static const char *at91sam9g45_board_compat[] __initconst = { | |||
60 | 96 | ||
61 | DT_MACHINE_START(at91sam9g45_dt, "Atmel AT91SAM9G45") | 97 | DT_MACHINE_START(at91sam9g45_dt, "Atmel AT91SAM9G45") |
62 | /* Maintainer: Atmel */ | 98 | /* Maintainer: Atmel */ |
63 | .map_io = at91_map_io, | ||
64 | .init_machine = at91sam9g45_dt_device_init, | 99 | .init_machine = at91sam9g45_dt_device_init, |
65 | .dt_compat = at91sam9g45_board_compat, | 100 | .dt_compat = at91sam9g45_board_compat, |
66 | MACHINE_END | 101 | MACHINE_END |
67 | 102 | ||
68 | static void __init at91sam9x5_dt_device_init(void) | 103 | static void __init at91sam9x5_dt_device_init(void) |
69 | { | 104 | { |
70 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 105 | at91sam9_common_init(); |
71 | |||
72 | arm_pm_idle = at91sam9_idle; | ||
73 | at91sam9x5_pm_init(); | 106 | at91sam9x5_pm_init(); |
74 | } | 107 | } |
75 | 108 | ||
@@ -81,7 +114,6 @@ static const char *at91sam9x5_board_compat[] __initconst = { | |||
81 | 114 | ||
82 | DT_MACHINE_START(at91sam9x5_dt, "Atmel AT91SAM9") | 115 | DT_MACHINE_START(at91sam9x5_dt, "Atmel AT91SAM9") |
83 | /* Maintainer: Atmel */ | 116 | /* Maintainer: Atmel */ |
84 | .map_io = at91_map_io, | ||
85 | .init_machine = at91sam9x5_dt_device_init, | 117 | .init_machine = at91sam9x5_dt_device_init, |
86 | .dt_compat = at91sam9x5_board_compat, | 118 | .dt_compat = at91sam9x5_board_compat, |
87 | MACHINE_END | 119 | MACHINE_END |