diff options
-rw-r--r-- | Documentation/powerpc/dts-bindings/4xx/reboot.txt | 18 | ||||
-rw-r--r-- | arch/powerpc/sysdev/ppc4xx_soc.c | 24 |
2 files changed, 40 insertions, 2 deletions
diff --git a/Documentation/powerpc/dts-bindings/4xx/reboot.txt b/Documentation/powerpc/dts-bindings/4xx/reboot.txt new file mode 100644 index 000000000000..d7217260589c --- /dev/null +++ b/Documentation/powerpc/dts-bindings/4xx/reboot.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | Reboot property to control system reboot on PPC4xx systems: | ||
2 | |||
3 | By setting "reset_type" to one of the following values, the default | ||
4 | software reset mechanism may be overidden. Here the possible values of | ||
5 | "reset_type": | ||
6 | |||
7 | 1 - PPC4xx core reset | ||
8 | 2 - PPC4xx chip reset | ||
9 | 3 - PPC4xx system reset (default) | ||
10 | |||
11 | Example: | ||
12 | |||
13 | cpu@0 { | ||
14 | device_type = "cpu"; | ||
15 | model = "PowerPC,440SPe"; | ||
16 | ... | ||
17 | reset-type = <2>; /* Use chip-reset */ | ||
18 | }; | ||
diff --git a/arch/powerpc/sysdev/ppc4xx_soc.c b/arch/powerpc/sysdev/ppc4xx_soc.c index 5c014350bf16..d3d6ce3c33b4 100644 --- a/arch/powerpc/sysdev/ppc4xx_soc.c +++ b/arch/powerpc/sysdev/ppc4xx_soc.c | |||
@@ -191,11 +191,31 @@ static int __init ppc4xx_l2c_probe(void) | |||
191 | arch_initcall(ppc4xx_l2c_probe); | 191 | arch_initcall(ppc4xx_l2c_probe); |
192 | 192 | ||
193 | /* | 193 | /* |
194 | * At present, this routine just applies a system reset. | 194 | * Apply a system reset. Alternatively a board specific value may be |
195 | * provided via the "reset-type" property in the cpu node. | ||
195 | */ | 196 | */ |
196 | void ppc4xx_reset_system(char *cmd) | 197 | void ppc4xx_reset_system(char *cmd) |
197 | { | 198 | { |
198 | mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_RST_SYSTEM); | 199 | struct device_node *np; |
200 | u32 reset_type = DBCR0_RST_SYSTEM; | ||
201 | const u32 *prop; | ||
202 | |||
203 | np = of_find_node_by_type(NULL, "cpu"); | ||
204 | if (np) { | ||
205 | prop = of_get_property(np, "reset-type", NULL); | ||
206 | |||
207 | /* | ||
208 | * Check if property exists and if it is in range: | ||
209 | * 1 - PPC4xx core reset | ||
210 | * 2 - PPC4xx chip reset | ||
211 | * 3 - PPC4xx system reset (default) | ||
212 | */ | ||
213 | if ((prop) && ((prop[0] >= 1) && (prop[0] <= 3))) | ||
214 | reset_type = prop[0] << 28; | ||
215 | } | ||
216 | |||
217 | mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | reset_type); | ||
218 | |||
199 | while (1) | 219 | while (1) |
200 | ; /* Just in case the reset doesn't work */ | 220 | ; /* Just in case the reset doesn't work */ |
201 | } | 221 | } |