1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * Routines common to most mpc86xx-based boards.
4  */
5 
6 #include <linux/of_platform.h>
7 #include <asm/synch.h>
8 
9 #include "mpc86xx.h"
10 
11 static const struct of_device_id mpc86xx_common_ids[] __initconst = {
12 	{ .type = "soc", },
13 	{ .compatible = "soc", },
14 	{ .compatible = "simple-bus", },
15 	{ .name = "localbus", },
16 	{ .compatible = "gianfar", },
17 	{ .compatible = "fsl,mpc8641-pcie", },
18 	{},
19 };
20 
21 int __init mpc86xx_common_publish_devices(void)
22 {
23 	return of_platform_bus_probe(NULL, mpc86xx_common_ids, NULL);
24 }
25 
26 long __init mpc86xx_time_init(void)
27 {
28 	unsigned int temp;
29 
30 	/* Set the time base to zero */
31 	mtspr(SPRN_TBWL, 0);
32 	mtspr(SPRN_TBWU, 0);
33 
34 	temp = mfspr(SPRN_HID0);
35 	temp |= HID0_TBEN;
36 	mtspr(SPRN_HID0, temp);
37 	isync();
38 
39 	return 0;
40 }
41