1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25#include <linux/pci.h>
26#include <linux/of.h>
27#include <linux/of_platform.h>
28#include <linux/of_address.h>
29#include <asm/udbg.h>
30#include <asm/mpic.h>
31#include <sysdev/fsl_soc.h>
32#include <sysdev/fsl_pci.h>
33
34#include "mpc86xx.h"
35
36#define MVME7100_INTERRUPT_REG_2_OFFSET 0x05
37#define MVME7100_DS1375_MASK 0x40
38#define MVME7100_MAX6649_MASK 0x20
39#define MVME7100_ABORT_MASK 0x10
40
41
42
43
44static void __init mvme7100_setup_arch(void)
45{
46 struct device_node *bcsr_node;
47 void __iomem *mvme7100_regs = NULL;
48 u8 reg;
49
50 if (ppc_md.progress)
51 ppc_md.progress("mvme7100_setup_arch()", 0);
52
53#ifdef CONFIG_SMP
54 mpc86xx_smp_init();
55#endif
56
57 fsl_pci_assign_primary();
58
59
60 bcsr_node = of_find_compatible_node(NULL, NULL,
61 "artesyn,mvme7100-bcsr");
62 if (bcsr_node) {
63 mvme7100_regs = of_iomap(bcsr_node, 0);
64 of_node_put(bcsr_node);
65 }
66
67 if (mvme7100_regs) {
68
69 reg = readb(mvme7100_regs + MVME7100_INTERRUPT_REG_2_OFFSET);
70 reg |= MVME7100_DS1375_MASK | MVME7100_MAX6649_MASK
71 | MVME7100_ABORT_MASK;
72 writeb(reg, mvme7100_regs + MVME7100_INTERRUPT_REG_2_OFFSET);
73 } else
74 pr_warn("Unable to map board registers\n");
75
76 pr_info("MVME7100 board from Artesyn\n");
77}
78
79
80
81
82static int __init mvme7100_probe(void)
83{
84 unsigned long root = of_get_flat_dt_root();
85
86 return of_flat_dt_is_compatible(root, "artesyn,MVME7100");
87}
88
89static void mvme7100_usb_host_fixup(struct pci_dev *pdev)
90{
91 unsigned int val;
92
93 if (!machine_is(mvme7100))
94 return;
95
96
97 pci_read_config_dword(pdev, 0xe0, &val);
98 pci_write_config_dword(pdev, 0xe0, (val & ~7) | 0x2);
99
100
101 pci_write_config_dword(pdev, 0xe4, 1 << 5);
102}
103DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_USB,
104 mvme7100_usb_host_fixup);
105
106machine_arch_initcall(mvme7100, mpc86xx_common_publish_devices);
107
108define_machine(mvme7100) {
109 .name = "MVME7100",
110 .probe = mvme7100_probe,
111 .setup_arch = mvme7100_setup_arch,
112 .init_IRQ = mpc86xx_init_irq,
113 .get_irq = mpic_get_irq,
114 .time_init = mpc86xx_time_init,
115 .calibrate_decr = generic_calibrate_decr,
116 .progress = udbg_progress,
117#ifdef CONFIG_PCI
118 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
119#endif
120};
121