diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-02-18 22:38:23 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-02-18 22:38:23 -0500 |
commit | 87d31345c0a90ccdf185feed9923ed14764f45dc (patch) | |
tree | 2816764e59f93379e0e3843fa0c417aafe02c503 /arch/powerpc/platforms | |
parent | e98efaf303ccbff11522a054d155593d7f2bb41f (diff) | |
parent | d24720a45ad2928f687c6371482cdfba19b74fc5 (diff) |
Merge commit 'gcl/next' into next
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/512x/clock.c | 6 | ||||
-rw-r--r-- | arch/powerpc/platforms/512x/mpc5121_ads.c | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/512x/mpc5121_generic.c | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/512x/mpc512x.h | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/512x/mpc512x_shared.c | 43 |
5 files changed, 51 insertions, 7 deletions
diff --git a/arch/powerpc/platforms/512x/clock.c b/arch/powerpc/platforms/512x/clock.c index 84544d072043..4c42246b86a7 100644 --- a/arch/powerpc/platforms/512x/clock.c +++ b/arch/powerpc/platforms/512x/clock.c | |||
@@ -698,8 +698,7 @@ static struct clk_interface mpc5121_clk_functions = { | |||
698 | .clk_get_parent = NULL, | 698 | .clk_get_parent = NULL, |
699 | }; | 699 | }; |
700 | 700 | ||
701 | static int | 701 | int __init mpc5121_clk_init(void) |
702 | mpc5121_clk_init(void) | ||
703 | { | 702 | { |
704 | struct device_node *np; | 703 | struct device_node *np; |
705 | 704 | ||
@@ -724,6 +723,3 @@ mpc5121_clk_init(void) | |||
724 | clk_functions = mpc5121_clk_functions; | 723 | clk_functions = mpc5121_clk_functions; |
725 | return 0; | 724 | return 0; |
726 | } | 725 | } |
727 | |||
728 | |||
729 | arch_initcall(mpc5121_clk_init); | ||
diff --git a/arch/powerpc/platforms/512x/mpc5121_ads.c b/arch/powerpc/platforms/512x/mpc5121_ads.c index 441abc488851..ee6ae129c25c 100644 --- a/arch/powerpc/platforms/512x/mpc5121_ads.c +++ b/arch/powerpc/platforms/512x/mpc5121_ads.c | |||
@@ -64,8 +64,9 @@ define_machine(mpc5121_ads) { | |||
64 | .name = "MPC5121 ADS", | 64 | .name = "MPC5121 ADS", |
65 | .probe = mpc5121_ads_probe, | 65 | .probe = mpc5121_ads_probe, |
66 | .setup_arch = mpc5121_ads_setup_arch, | 66 | .setup_arch = mpc5121_ads_setup_arch, |
67 | .init = mpc512x_declare_of_platform_devices, | 67 | .init = mpc512x_init, |
68 | .init_IRQ = mpc5121_ads_init_IRQ, | 68 | .init_IRQ = mpc5121_ads_init_IRQ, |
69 | .get_irq = ipic_get_irq, | 69 | .get_irq = ipic_get_irq, |
70 | .calibrate_decr = generic_calibrate_decr, | 70 | .calibrate_decr = generic_calibrate_decr, |
71 | .restart = mpc512x_restart, | ||
71 | }; | 72 | }; |
diff --git a/arch/powerpc/platforms/512x/mpc5121_generic.c b/arch/powerpc/platforms/512x/mpc5121_generic.c index 2479de9e2d12..a6c0e3a2615d 100644 --- a/arch/powerpc/platforms/512x/mpc5121_generic.c +++ b/arch/powerpc/platforms/512x/mpc5121_generic.c | |||
@@ -51,8 +51,9 @@ static int __init mpc5121_generic_probe(void) | |||
51 | define_machine(mpc5121_generic) { | 51 | define_machine(mpc5121_generic) { |
52 | .name = "MPC5121 generic", | 52 | .name = "MPC5121 generic", |
53 | .probe = mpc5121_generic_probe, | 53 | .probe = mpc5121_generic_probe, |
54 | .init = mpc512x_declare_of_platform_devices, | 54 | .init = mpc512x_init, |
55 | .init_IRQ = mpc512x_init_IRQ, | 55 | .init_IRQ = mpc512x_init_IRQ, |
56 | .get_irq = ipic_get_irq, | 56 | .get_irq = ipic_get_irq, |
57 | .calibrate_decr = generic_calibrate_decr, | 57 | .calibrate_decr = generic_calibrate_decr, |
58 | .restart = mpc512x_restart, | ||
58 | }; | 59 | }; |
diff --git a/arch/powerpc/platforms/512x/mpc512x.h b/arch/powerpc/platforms/512x/mpc512x.h index 22a5352407e0..b2daca0d1488 100644 --- a/arch/powerpc/platforms/512x/mpc512x.h +++ b/arch/powerpc/platforms/512x/mpc512x.h | |||
@@ -12,5 +12,8 @@ | |||
12 | #ifndef __MPC512X_H__ | 12 | #ifndef __MPC512X_H__ |
13 | #define __MPC512X_H__ | 13 | #define __MPC512X_H__ |
14 | extern void __init mpc512x_init_IRQ(void); | 14 | extern void __init mpc512x_init_IRQ(void); |
15 | extern void __init mpc512x_init(void); | ||
16 | extern int __init mpc5121_clk_init(void); | ||
15 | void __init mpc512x_declare_of_platform_devices(void); | 17 | void __init mpc512x_declare_of_platform_devices(void); |
18 | extern void mpc512x_restart(char *cmd); | ||
16 | #endif /* __MPC512X_H__ */ | 19 | #endif /* __MPC512X_H__ */ |
diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c index 434d683df5a0..b7f518a60f03 100644 --- a/arch/powerpc/platforms/512x/mpc512x_shared.c +++ b/arch/powerpc/platforms/512x/mpc512x_shared.c | |||
@@ -21,9 +21,38 @@ | |||
21 | #include <asm/ipic.h> | 21 | #include <asm/ipic.h> |
22 | #include <asm/prom.h> | 22 | #include <asm/prom.h> |
23 | #include <asm/time.h> | 23 | #include <asm/time.h> |
24 | #include <asm/mpc5121.h> | ||
24 | 25 | ||
25 | #include "mpc512x.h" | 26 | #include "mpc512x.h" |
26 | 27 | ||
28 | static struct mpc512x_reset_module __iomem *reset_module_base; | ||
29 | |||
30 | static void __init mpc512x_restart_init(void) | ||
31 | { | ||
32 | struct device_node *np; | ||
33 | |||
34 | np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-reset"); | ||
35 | if (!np) | ||
36 | return; | ||
37 | |||
38 | reset_module_base = of_iomap(np, 0); | ||
39 | of_node_put(np); | ||
40 | } | ||
41 | |||
42 | void mpc512x_restart(char *cmd) | ||
43 | { | ||
44 | if (reset_module_base) { | ||
45 | /* Enable software reset "RSTE" */ | ||
46 | out_be32(&reset_module_base->rpr, 0x52535445); | ||
47 | /* Set software hard reset */ | ||
48 | out_be32(&reset_module_base->rcr, 0x2); | ||
49 | } else { | ||
50 | pr_err("Restart module not mapped.\n"); | ||
51 | } | ||
52 | for (;;) | ||
53 | ; | ||
54 | } | ||
55 | |||
27 | void __init mpc512x_init_IRQ(void) | 56 | void __init mpc512x_init_IRQ(void) |
28 | { | 57 | { |
29 | struct device_node *np; | 58 | struct device_node *np; |
@@ -53,8 +82,22 @@ static struct of_device_id __initdata of_bus_ids[] = { | |||
53 | 82 | ||
54 | void __init mpc512x_declare_of_platform_devices(void) | 83 | void __init mpc512x_declare_of_platform_devices(void) |
55 | { | 84 | { |
85 | struct device_node *np; | ||
86 | |||
56 | if (of_platform_bus_probe(NULL, of_bus_ids, NULL)) | 87 | if (of_platform_bus_probe(NULL, of_bus_ids, NULL)) |
57 | printk(KERN_ERR __FILE__ ": " | 88 | printk(KERN_ERR __FILE__ ": " |
58 | "Error while probing of_platform bus\n"); | 89 | "Error while probing of_platform bus\n"); |
90 | |||
91 | np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-nfc"); | ||
92 | if (np) { | ||
93 | of_platform_device_create(np, NULL, NULL); | ||
94 | of_node_put(np); | ||
95 | } | ||
59 | } | 96 | } |
60 | 97 | ||
98 | void __init mpc512x_init(void) | ||
99 | { | ||
100 | mpc512x_declare_of_platform_devices(); | ||
101 | mpc5121_clk_init(); | ||
102 | mpc512x_restart_init(); | ||
103 | } | ||