diff options
author | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2015-03-12 10:54:28 -0400 |
---|---|---|
committer | Nicolas Ferre <nicolas.ferre@atmel.com> | 2015-03-13 10:11:04 -0400 |
commit | 7735f03822bc6bba156bc5166c85e636e0fee403 (patch) | |
tree | b8f9259577103bfcf9e288f9369702066298d786 | |
parent | ea4abe7f3a3216f5d98dcc7a884e10f20b264429 (diff) |
ARM: at91: at91rm9200 use SoC detection infrastructure
Use the soc detection infrastructure for at91rm9200 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/at91rm9200.c | 29 | ||||
-rw-r--r-- | arch/arm/mach-at91/soc.h | 2 |
2 files changed, 17 insertions, 14 deletions
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c index 8fcfb70f7124..bfc9aed90b91 100644 --- a/arch/arm/mach-at91/at91rm9200.c +++ b/arch/arm/mach-at91/at91rm9200.c | |||
@@ -8,25 +8,22 @@ | |||
8 | * Licensed under GPLv2 or later. | 8 | * Licensed under GPLv2 or later. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/types.h> | 11 | #include <linux/clk-provider.h> |
12 | #include <linux/init.h> | ||
13 | #include <linux/module.h> | ||
14 | #include <linux/gpio.h> | ||
15 | #include <linux/of.h> | 12 | #include <linux/of.h> |
16 | #include <linux/of_irq.h> | ||
17 | #include <linux/of_platform.h> | 13 | #include <linux/of_platform.h> |
18 | #include <linux/clk-provider.h> | ||
19 | 14 | ||
20 | #include <asm/setup.h> | ||
21 | #include <asm/irq.h> | ||
22 | #include <asm/mach/arch.h> | 15 | #include <asm/mach/arch.h> |
23 | #include <asm/mach/map.h> | ||
24 | #include <asm/mach/irq.h> | ||
25 | #include <asm/system_misc.h> | 16 | #include <asm/system_misc.h> |
26 | 17 | ||
27 | #include <mach/at91_st.h> | 18 | #include <mach/at91_st.h> |
28 | 19 | ||
29 | #include "generic.h" | 20 | #include "generic.h" |
21 | #include "soc.h" | ||
22 | |||
23 | static const struct at91_soc rm9200_socs[] = { | ||
24 | AT91_SOC(AT91RM9200_CIDR_MATCH, 0, "at91rm9200 BGA", "at91rm9200"), | ||
25 | { /* sentinel */ }, | ||
26 | }; | ||
30 | 27 | ||
31 | static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd) | 28 | static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd) |
32 | { | 29 | { |
@@ -45,15 +42,20 @@ static void __init at91rm9200_dt_timer_init(void) | |||
45 | 42 | ||
46 | static void __init at91rm9200_dt_device_init(void) | 43 | static void __init at91rm9200_dt_device_init(void) |
47 | { | 44 | { |
48 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 45 | struct soc_device *soc; |
46 | struct device *soc_dev = NULL; | ||
47 | |||
48 | soc = at91_soc_init(rm9200_socs); | ||
49 | if (soc != NULL) | ||
50 | soc_dev = soc_device_to_device(soc); | ||
51 | |||
52 | of_platform_populate(NULL, of_default_bus_match_table, NULL, soc_dev); | ||
49 | 53 | ||
50 | arm_pm_idle = at91rm9200_idle; | 54 | arm_pm_idle = at91rm9200_idle; |
51 | arm_pm_restart = at91rm9200_restart; | 55 | arm_pm_restart = at91rm9200_restart; |
52 | at91rm9200_pm_init(); | 56 | at91rm9200_pm_init(); |
53 | } | 57 | } |
54 | 58 | ||
55 | |||
56 | |||
57 | static const char *at91rm9200_dt_board_compat[] __initconst = { | 59 | static const char *at91rm9200_dt_board_compat[] __initconst = { |
58 | "atmel,at91rm9200", | 60 | "atmel,at91rm9200", |
59 | NULL | 61 | NULL |
@@ -61,7 +63,6 @@ static const char *at91rm9200_dt_board_compat[] __initconst = { | |||
61 | 63 | ||
62 | DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200") | 64 | DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200") |
63 | .init_time = at91rm9200_dt_timer_init, | 65 | .init_time = at91rm9200_dt_timer_init, |
64 | .map_io = at91_map_io, | ||
65 | .init_machine = at91rm9200_dt_device_init, | 66 | .init_machine = at91rm9200_dt_device_init, |
66 | .dt_compat = at91rm9200_dt_board_compat, | 67 | .dt_compat = at91rm9200_dt_board_compat, |
67 | MACHINE_END | 68 | MACHINE_END |
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h index 9678a3b2d282..ab5bc4be3d41 100644 --- a/arch/arm/mach-at91/soc.h +++ b/arch/arm/mach-at91/soc.h | |||
@@ -32,4 +32,6 @@ struct at91_soc { | |||
32 | struct soc_device * __init | 32 | struct soc_device * __init |
33 | at91_soc_init(const struct at91_soc *socs); | 33 | at91_soc_init(const struct at91_soc *socs); |
34 | 34 | ||
35 | #define AT91RM9200_CIDR_MATCH 0x09290780 | ||
36 | |||
35 | #endif /* __AT91_SOC_H */ | 37 | #endif /* __AT91_SOC_H */ |