2 * Copyright (C) 2007,2008 Freescale Semiconductor, Inc. All rights reserved.
4 * Author: John Rigby <jrigby@freescale.com>
9 * This is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
15 #include <linux/kernel.h>
17 #include <linux/irq.h>
18 #include <linux/of_platform.h>
20 #include <asm/machdep.h>
24 #include <asm/mpc5121.h>
28 static struct mpc512x_reset_module __iomem
*reset_module_base
;
30 static void __init
mpc512x_restart_init(void)
32 struct device_node
*np
;
34 np
= of_find_compatible_node(NULL
, NULL
, "fsl,mpc5121-reset");
38 reset_module_base
= of_iomap(np
, 0);
42 void mpc512x_restart(char *cmd
)
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);
50 pr_err("Restart module not mapped.\n");
56 void __init
mpc512x_init_IRQ(void)
58 struct device_node
*np
;
60 np
= of_find_compatible_node(NULL
, NULL
, "fsl,mpc5121-ipic");
68 * Initialize the default interrupt mapping priorities,
69 * in case the boot rom changed something on us.
71 ipic_set_default_priority();
75 * Nodes to do bus probe on, soc and localbus
77 static struct of_device_id __initdata of_bus_ids
[] = {
78 { .compatible
= "fsl,mpc5121-immr", },
79 { .compatible
= "fsl,mpc5121-localbus", },
83 void __init
mpc512x_declare_of_platform_devices(void)
85 if (of_platform_bus_probe(NULL
, of_bus_ids
, NULL
))
86 printk(KERN_ERR __FILE__
": "
87 "Error while probing of_platform bus\n");
90 void __init
mpc512x_init(void)
92 mpc512x_declare_of_platform_devices();
94 mpc512x_restart_init();