19 #include <linux/stddef.h>
20 #include <linux/kernel.h>
21 #include <linux/pci.h>
22 #include <linux/kdev_t.h>
28 #include <asm/machdep.h>
29 #include <asm/pci-bridge.h>
35 #include <asm/nvram.h>
46 #define DBG (fmt...) do { printk(KERN_ERR "SBC310: " fmt); } while (0)
48 #define DBG (fmt...) do { } while (0)
53 static void __init gef_sbc310_init_irq(
void)
70 of_node_put(cascade_node);
73 static void __init gef_sbc310_setup_arch(
void)
82 fsl_pci_assign_primary();
93 #if defined(CONFIG_MMIO_NVRAM)
99 static unsigned int gef_sbc310_get_board_id(
void)
108 static unsigned int gef_sbc310_get_pcb_rev(
void)
113 return (reg >> 8) & 0xff;
117 static unsigned int gef_sbc310_get_board_rev(
void)
122 return (reg >> 16) & 0xff;
126 static unsigned int gef_sbc310_get_fpga_rev(
void)
131 return (reg >> 24) & 0xf;
134 static void gef_sbc310_show_cpuinfo(
struct seq_file *
m)
138 seq_printf(m,
"Vendor\t\t: GE Intelligent Platforms\n");
140 seq_printf(m,
"Board ID\t: 0x%2.2x\n", gef_sbc310_get_board_id());
141 seq_printf(m,
"Revision\t: %u%c\n", gef_sbc310_get_pcb_rev(),
142 (
'A' + gef_sbc310_get_board_rev() - 1));
143 seq_printf(m,
"FPGA Revision\t: %u\n", gef_sbc310_get_fpga_rev());
154 if (!machine_is(gef_sbc310))
160 pci_read_config_dword(pdev, 0xe0, &val);
161 pci_write_config_dword(pdev, 0xe0, (val & ~7) | 0x2);
164 pci_write_config_dword(pdev, 0xe4, 1 << 5);
167 gef_sbc310_nec_fixup);
177 static int __init gef_sbc310_probe(
void)
179 unsigned long root = of_get_flat_dt_root();
181 if (of_flat_dt_is_compatible(root,
"gef,sbc310"))
187 static long __init mpc86xx_time_init(
void)
195 temp =
mfspr(SPRN_HID0);
197 mtspr(SPRN_HID0, temp);
198 asm volatile(
"isync");
204 { .compatible =
"simple-bus", },
205 { .compatible =
"gianfar", },
206 { .compatible =
"fsl,mpc8641-pcie", },
210 static int __init declare_of_platform_devices(
void)
213 of_platform_bus_probe(
NULL, of_bus_ids,
NULL);
221 .probe = gef_sbc310_probe,
222 .setup_arch = gef_sbc310_setup_arch,
223 .init_IRQ = gef_sbc310_init_irq,
224 .show_cpuinfo = gef_sbc310_show_cpuinfo,
226 .restart = fsl_rstcr_restart,
227 .time_init = mpc86xx_time_init,
231 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,