GNU Linux-libre 4.9.317-gnu1
[releases.git] / arch / powerpc / platforms / 86xx / common.c
1 /*
2  * Routines common to most mpc86xx-based boards.
3  *
4  * This is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  */
8
9 #include <linux/of_platform.h>
10 #include <asm/synch.h>
11
12 #include "mpc86xx.h"
13
14 static const struct of_device_id mpc86xx_common_ids[] __initconst = {
15         { .type = "soc", },
16         { .compatible = "soc", },
17         { .compatible = "simple-bus", },
18         { .name = "localbus", },
19         { .compatible = "gianfar", },
20         { .compatible = "fsl,mpc8641-pcie", },
21         {},
22 };
23
24 int __init mpc86xx_common_publish_devices(void)
25 {
26         return of_platform_bus_probe(NULL, mpc86xx_common_ids, NULL);
27 }
28
29 long __init mpc86xx_time_init(void)
30 {
31         unsigned int temp;
32
33         /* Set the time base to zero */
34         mtspr(SPRN_TBWL, 0);
35         mtspr(SPRN_TBWU, 0);
36
37         temp = mfspr(SPRN_HID0);
38         temp |= HID0_TBEN;
39         mtspr(SPRN_HID0, temp);
40         isync();
41
42         return 0;
43 }