2 * SBC8641D board specific routines
4 * Copyright 2008 Wind River Systems Inc.
6 * By Paul Gortmaker (see MAINTAINERS for contact information)
8 * Based largely on the 8641 HPCN support by Freescale Semiconductor Inc.
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
16 #include <linux/stddef.h>
17 #include <linux/kernel.h>
18 #include <linux/pci.h>
19 #include <linux/kdev_t.h>
20 #include <linux/delay.h>
21 #include <linux/seq_file.h>
22 #include <linux/of_platform.h>
24 #include <asm/system.h>
26 #include <asm/machdep.h>
27 #include <asm/pci-bridge.h>
28 #include <asm/mpc86xx.h>
30 #include <mm/mmu_decl.h>
35 #include <sysdev/fsl_pci.h>
36 #include <sysdev/fsl_soc.h>
41 sbc8641_init_irq(void)
44 struct device_node *np;
47 /* Determine PIC address. */
48 np = of_find_node_by_type(NULL, "open-pic");
51 of_address_to_resource(np, 0, &res);
53 /* Alloc mpic structure and per isu has 16 INT entries. */
54 mpic1 = mpic_alloc(np, res.start,
55 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
58 BUG_ON(mpic1 == NULL);
64 sbc8641_setup_arch(void)
67 struct device_node *np;
71 ppc_md.progress("sbc8641_setup_arch()", 0);
74 for_each_compatible_node(np, "pci", "fsl,mpc8641-pcie")
75 fsl_add_bridge(np, 0);
78 printk("SBC8641 board from Wind River\n");
87 sbc8641_show_cpuinfo(struct seq_file *m)
89 struct device_node *root;
90 uint memsize = total_memory;
91 const char *model = "";
92 uint svid = mfspr(SPRN_SVR);
94 seq_printf(m, "Vendor\t\t: Wind River Systems\n");
96 root = of_find_node_by_path("/");
98 model = of_get_property(root, "model", NULL);
99 seq_printf(m, "Machine\t\t: %s\n", model);
102 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
103 seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
108 * Called very early, device-tree isn't unflattened
110 static int __init sbc8641_probe(void)
112 unsigned long root = of_get_flat_dt_root();
114 if (of_flat_dt_is_compatible(root, "wind,sbc8641"))
115 return 1; /* Looks good */
121 mpc86xx_time_init(void)
125 /* Set the time base to zero */
129 temp = mfspr(SPRN_HID0);
131 mtspr(SPRN_HID0, temp);
132 asm volatile("isync");
137 static __initdata struct of_device_id of_bus_ids[] = {
138 { .compatible = "simple-bus", },
142 static int __init declare_of_platform_devices(void)
144 of_platform_bus_probe(NULL, of_bus_ids, NULL);
148 machine_device_initcall(sbc8641, declare_of_platform_devices);
150 define_machine(sbc8641) {
152 .probe = sbc8641_probe,
153 .setup_arch = sbc8641_setup_arch,
154 .init_IRQ = sbc8641_init_irq,
155 .show_cpuinfo = sbc8641_show_cpuinfo,
156 .get_irq = mpic_get_irq,
157 .restart = fsl_rstcr_restart,
158 .time_init = mpc86xx_time_init,
159 .calibrate_decr = generic_calibrate_decr,
160 .progress = udbg_progress,
162 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,