Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/mpc512x: add MPC5125 reset module support for system restart

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>

authored by

Matteo Facchinetti and committed by
Anatolij Gustschin
0875a88e a4f4124c

+15 -1
+1
arch/powerpc/platforms/512x/mpc512x.h
··· 17 17 extern void __init mpc512x_setup_arch(void); 18 18 extern int __init mpc5121_clk_init(void); 19 19 extern const char *mpc512x_select_psc_compat(void); 20 + extern const char *mpc512x_select_reset_compat(void); 20 21 extern void mpc512x_restart(char *cmd); 21 22 22 23 #endif /* __MPC512X_H__ */
+14 -1
arch/powerpc/platforms/512x/mpc512x_shared.c
··· 35 35 static void __init mpc512x_restart_init(void) 36 36 { 37 37 struct device_node *np; 38 + const char *reset_compat; 38 39 39 - np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-reset"); 40 + reset_compat = mpc512x_select_reset_compat(); 41 + np = of_find_compatible_node(NULL, NULL, reset_compat); 40 42 if (!np) 41 43 return; 42 44 ··· 353 351 354 352 if (of_machine_is_compatible("fsl,mpc5125")) 355 353 return "fsl,mpc5125-psc"; 354 + 355 + return NULL; 356 + } 357 + 358 + const char *mpc512x_select_reset_compat(void) 359 + { 360 + if (of_machine_is_compatible("fsl,mpc5121")) 361 + return "fsl,mpc5121-reset"; 362 + 363 + if (of_machine_is_compatible("fsl,mpc5125")) 364 + return "fsl,mpc5125-reset"; 356 365 357 366 return NULL; 358 367 }