Skip to content

Commit

Permalink
powerpc/mpc512x: add MPC5125 reset module support for system restart
Browse files Browse the repository at this point in the history
Only part of MPC5125 reset module is like as MPC5121.
In detail, RCWH register doesn't contain informations about:
- PCI arbiter
- NAND flash page size
- NAND flash port size

For this reason, in device tree, this module has a different name then
MPC5121 reset module but use the same "struct mpc512x_reset_module"
register definition and the same restart procedure.

Signed-off-by: Matteo Facchinetti <engineering@sirius-es.it>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
  • Loading branch information
Matteo Facchinetti authored and Anatolij Gustschin committed Jun 24, 2013
1 parent a4f4124 commit 0875a88
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions arch/powerpc/platforms/512x/mpc512x.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ extern void __init mpc512x_init(void);
extern void __init mpc512x_setup_arch(void);
extern int __init mpc5121_clk_init(void);
extern const char *mpc512x_select_psc_compat(void);
extern const char *mpc512x_select_reset_compat(void);
extern void mpc512x_restart(char *cmd);

#endif /* __MPC512X_H__ */
15 changes: 14 additions & 1 deletion arch/powerpc/platforms/512x/mpc512x_shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ static struct mpc512x_reset_module __iomem *reset_module_base;
static void __init mpc512x_restart_init(void)
{
struct device_node *np;
const char *reset_compat;

np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-reset");
reset_compat = mpc512x_select_reset_compat();
np = of_find_compatible_node(NULL, NULL, reset_compat);
if (!np)
return;

Expand Down Expand Up @@ -355,6 +357,17 @@ const char *mpc512x_select_psc_compat(void)
return NULL;
}

const char *mpc512x_select_reset_compat(void)
{
if (of_machine_is_compatible("fsl,mpc5121"))
return "fsl,mpc5121-reset";

if (of_machine_is_compatible("fsl,mpc5125"))
return "fsl,mpc5125-reset";

return NULL;
}

static unsigned int __init get_fifo_size(struct device_node *np,
char *prop_name)
{
Expand Down

0 comments on commit 0875a88

Please sign in to comment.