summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/86xx/common.c
diff options
context:
space:
mode:
authorAlessio Igor Bogani <alessio.bogani@elettra.eu>2016-02-11 15:38:46 +0100
committerScott Wood <oss@buserror.net>2016-03-11 19:14:12 -0600
commit4f9d6e95bc31592f0900650cb86c3c74aca4fd53 (patch)
treeb25a5af5b11dcca62d4595a478e5b9f694820c7c /arch/powerpc/platforms/86xx/common.c
parent737b01fca3f853a1f3373a79c06e4ee3a574e5b7 (diff)
downloadlinux-4f9d6e95bc31592f0900650cb86c3c74aca4fd53.tar.gz
linux-4f9d6e95bc31592f0900650cb86c3c74aca4fd53.tar.bz2
linux-4f9d6e95bc31592f0900650cb86c3c74aca4fd53.zip
powerpc/86xx: Consolidate common platform code
Signed-off-by: Alessio Igor Bogani <alessio.bogani@elettra.eu> Signed-off-by: Scott Wood <oss@buserror.net>
Diffstat (limited to 'arch/powerpc/platforms/86xx/common.c')
-rw-r--r--arch/powerpc/platforms/86xx/common.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/86xx/common.c b/arch/powerpc/platforms/86xx/common.c
new file mode 100644
index 000000000000..0f7b7fcf1ba2
--- /dev/null
+++ b/arch/powerpc/platforms/86xx/common.c
@@ -0,0 +1,43 @@
+/*
+ * Routines common to most mpc86xx-based boards.
+ *
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/of_platform.h>
+#include <asm/synch.h>
+
+#include "mpc86xx.h"
+
+static const struct of_device_id mpc86xx_common_ids[] __initconst = {
+ { .type = "soc", },
+ { .compatible = "soc", },
+ { .compatible = "simple-bus", },
+ { .name = "localbus", },
+ { .compatible = "gianfar", },
+ { .compatible = "fsl,mpc8641-pcie", },
+ {},
+};
+
+int __init mpc86xx_common_publish_devices(void)
+{
+ return of_platform_bus_probe(NULL, mpc86xx_common_ids, NULL);
+}
+
+long __init mpc86xx_time_init(void)
+{
+ unsigned int temp;
+
+ /* Set the time base to zero */
+ mtspr(SPRN_TBWL, 0);
+ mtspr(SPRN_TBWU, 0);
+
+ temp = mfspr(SPRN_HID0);
+ temp |= HID0_TBEN;
+ mtspr(SPRN_HID0, temp);
+ isync();
+
+ return 0;
+}