2 * GE Fanuc SBC610 board support
4 * Author: Martyn Welch <martyn.welch@gefanuc.com>
6 * Copyright 2008 GE Fanuc Intelligent Platforms Embedded Systems, Inc.
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
13 * Based on: mpc86xx_hpcn.c (MPC86xx HPCN board specific routines)
14 * Copyright 2006 Freescale Semiconductor Inc.
17 #include <linux/stddef.h>
18 #include <linux/kernel.h>
19 #include <linux/pci.h>
20 #include <linux/kdev_t.h>
21 #include <linux/delay.h>
22 #include <linux/seq_file.h>
23 #include <linux/of_platform.h>
25 #include <asm/system.h>
27 #include <asm/machdep.h>
28 #include <asm/pci-bridge.h>
29 #include <asm/mpc86xx.h>
31 #include <mm/mmu_decl.h>
36 #include <sysdev/fsl_pci.h>
37 #include <sysdev/fsl_soc.h>
44 #define DBG (fmt...) do { printk(KERN_ERR "SBC610: " fmt); } while (0)
46 #define DBG (fmt...) do { } while (0)
49 static void __init gef_sbc610_setup_arch(void)
52 struct device_node *np;
54 for_each_compatible_node(np, "pci", "fsl,mpc8641-pcie") {
55 fsl_add_bridge(np, 1);
59 printk(KERN_INFO "GE Fanuc Intelligent Platforms SBC610 6U VPX SBC\n");
67 static void gef_sbc610_show_cpuinfo(struct seq_file *m)
69 uint memsize = total_memory;
70 uint svid = mfspr(SPRN_SVR);
72 seq_printf(m, "Vendor\t\t: GE Fanuc Intelligent Platforms\n");
74 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
75 seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
80 * Called very early, device-tree isn't unflattened
82 * This function is called to determine whether the BSP is compatible with the
83 * supplied device-tree, which is assumed to be the correct one for the actual
84 * board. It is expected thati, in the future, a kernel may support multiple
87 static int __init gef_sbc610_probe(void)
89 unsigned long root = of_get_flat_dt_root();
91 if (of_flat_dt_is_compatible(root, "gef,sbc610"))
97 static long __init mpc86xx_time_init(void)
101 /* Set the time base to zero */
105 temp = mfspr(SPRN_HID0);
107 mtspr(SPRN_HID0, temp);
108 asm volatile("isync");
113 static __initdata struct of_device_id of_bus_ids[] = {
114 { .compatible = "simple-bus", },
118 static int __init declare_of_platform_devices(void)
120 printk(KERN_DEBUG "Probe platform devices\n");
121 of_platform_bus_probe(NULL, of_bus_ids, NULL);
125 machine_device_initcall(gef_sbc610, declare_of_platform_devices);
127 define_machine(gef_sbc610) {
128 .name = "GE Fanuc SBC610",
129 .probe = gef_sbc610_probe,
130 .setup_arch = gef_sbc610_setup_arch,
131 .init_IRQ = mpc86xx_init_irq,
132 .show_cpuinfo = gef_sbc610_show_cpuinfo,
133 .get_irq = mpic_get_irq,
134 .restart = fsl_rstcr_restart,
135 .time_init = mpc86xx_time_init,
136 .calibrate_decr = generic_calibrate_decr,
137 .progress = udbg_progress,
139 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,