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