Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196620
b: refs/heads/master
c: a32fe93
h: refs/heads/master
v: v3
  • Loading branch information
Stefan Roese authored and Josh Boyer committed May 5, 2010
1 parent 4d251e6 commit 7849bc3
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 101c192e1163c1c7e8d29748108b582929975038
refs/heads/master: a32fe93daf9c6b6ffbab1d9b9e2a8e4c335bda5c
18 changes: 18 additions & 0 deletions trunk/Documentation/powerpc/dts-bindings/4xx/reboot.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Reboot property to control system reboot on PPC4xx systems:

By setting "reset_type" to one of the following values, the default
software reset mechanism may be overidden. Here the possible values of
"reset_type":

1 - PPC4xx core reset
2 - PPC4xx chip reset
3 - PPC4xx system reset (default)

Example:

cpu@0 {
device_type = "cpu";
model = "PowerPC,440SPe";
...
reset-type = <2>; /* Use chip-reset */
};
24 changes: 22 additions & 2 deletions trunk/arch/powerpc/sysdev/ppc4xx_soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,31 @@ static int __init ppc4xx_l2c_probe(void)
arch_initcall(ppc4xx_l2c_probe);

/*
* At present, this routine just applies a system reset.
* Apply a system reset. Alternatively a board specific value may be
* provided via the "reset-type" property in the cpu node.
*/
void ppc4xx_reset_system(char *cmd)
{
mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_RST_SYSTEM);
struct device_node *np;
u32 reset_type = DBCR0_RST_SYSTEM;
const u32 *prop;

np = of_find_node_by_type(NULL, "cpu");
if (np) {
prop = of_get_property(np, "reset-type", NULL);

/*
* Check if property exists and if it is in range:
* 1 - PPC4xx core reset
* 2 - PPC4xx chip reset
* 3 - PPC4xx system reset (default)
*/
if ((prop) && ((prop[0] >= 1) && (prop[0] <= 3)))
reset_type = prop[0] << 28;
}

mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | reset_type);

while (1)
; /* Just in case the reset doesn't work */
}

0 comments on commit 7849bc3

Please sign in to comment.