23 #define PCI_DEVFN(slot,func) ((((slot) & 0x1f) << 3) | ((func) & 0x07))
25 #define MV64x60_CPU2MEM_WINDOWS 4
26 #define MV64x60_CPU2MEM_0_BASE 0x0008
27 #define MV64x60_CPU2MEM_0_SIZE 0x0010
28 #define MV64x60_CPU2MEM_1_BASE 0x0208
29 #define MV64x60_CPU2MEM_1_SIZE 0x0210
30 #define MV64x60_CPU2MEM_2_BASE 0x0018
31 #define MV64x60_CPU2MEM_2_SIZE 0x0020
32 #define MV64x60_CPU2MEM_3_BASE 0x0218
33 #define MV64x60_CPU2MEM_3_SIZE 0x0220
35 #define MV64x60_ENET2MEM_BAR_ENABLE 0x2290
36 #define MV64x60_ENET2MEM_0_BASE 0x2200
37 #define MV64x60_ENET2MEM_0_SIZE 0x2204
38 #define MV64x60_ENET2MEM_1_BASE 0x2208
39 #define MV64x60_ENET2MEM_1_SIZE 0x220c
40 #define MV64x60_ENET2MEM_2_BASE 0x2210
41 #define MV64x60_ENET2MEM_2_SIZE 0x2214
42 #define MV64x60_ENET2MEM_3_BASE 0x2218
43 #define MV64x60_ENET2MEM_3_SIZE 0x221c
44 #define MV64x60_ENET2MEM_4_BASE 0x2220
45 #define MV64x60_ENET2MEM_4_SIZE 0x2224
46 #define MV64x60_ENET2MEM_5_BASE 0x2228
47 #define MV64x60_ENET2MEM_5_SIZE 0x222c
48 #define MV64x60_ENET2MEM_ACC_PROT_0 0x2294
49 #define MV64x60_ENET2MEM_ACC_PROT_1 0x2298
50 #define MV64x60_ENET2MEM_ACC_PROT_2 0x229c
52 #define MV64x60_MPSC2MEM_BAR_ENABLE 0xf250
53 #define MV64x60_MPSC2MEM_0_BASE 0xf200
54 #define MV64x60_MPSC2MEM_0_SIZE 0xf204
55 #define MV64x60_MPSC2MEM_1_BASE 0xf208
56 #define MV64x60_MPSC2MEM_1_SIZE 0xf20c
57 #define MV64x60_MPSC2MEM_2_BASE 0xf210
58 #define MV64x60_MPSC2MEM_2_SIZE 0xf214
59 #define MV64x60_MPSC2MEM_3_BASE 0xf218
60 #define MV64x60_MPSC2MEM_3_SIZE 0xf21c
61 #define MV64x60_MPSC_0_REMAP 0xf240
62 #define MV64x60_MPSC_1_REMAP 0xf244
63 #define MV64x60_MPSC2MEM_ACC_PROT_0 0xf254
64 #define MV64x60_MPSC2MEM_ACC_PROT_1 0xf258
65 #define MV64x60_MPSC2REGS_BASE 0xf25c
67 #define MV64x60_IDMA2MEM_BAR_ENABLE 0x0a80
68 #define MV64x60_IDMA2MEM_0_BASE 0x0a00
69 #define MV64x60_IDMA2MEM_0_SIZE 0x0a04
70 #define MV64x60_IDMA2MEM_1_BASE 0x0a08
71 #define MV64x60_IDMA2MEM_1_SIZE 0x0a0c
72 #define MV64x60_IDMA2MEM_2_BASE 0x0a10
73 #define MV64x60_IDMA2MEM_2_SIZE 0x0a14
74 #define MV64x60_IDMA2MEM_3_BASE 0x0a18
75 #define MV64x60_IDMA2MEM_3_SIZE 0x0a1c
76 #define MV64x60_IDMA2MEM_4_BASE 0x0a20
77 #define MV64x60_IDMA2MEM_4_SIZE 0x0a24
78 #define MV64x60_IDMA2MEM_5_BASE 0x0a28
79 #define MV64x60_IDMA2MEM_5_SIZE 0x0a2c
80 #define MV64x60_IDMA2MEM_6_BASE 0x0a30
81 #define MV64x60_IDMA2MEM_6_SIZE 0x0a34
82 #define MV64x60_IDMA2MEM_7_BASE 0x0a38
83 #define MV64x60_IDMA2MEM_7_SIZE 0x0a3c
84 #define MV64x60_IDMA2MEM_ACC_PROT_0 0x0a70
85 #define MV64x60_IDMA2MEM_ACC_PROT_1 0x0a74
86 #define MV64x60_IDMA2MEM_ACC_PROT_2 0x0a78
87 #define MV64x60_IDMA2MEM_ACC_PROT_3 0x0a7c
89 #define MV64x60_PCI_ACC_CNTL_WINDOWS 6
90 #define MV64x60_PCI0_PCI_DECODE_CNTL 0x0d3c
91 #define MV64x60_PCI1_PCI_DECODE_CNTL 0x0dbc
93 #define MV64x60_PCI0_BAR_ENABLE 0x0c3c
94 #define MV64x60_PCI02MEM_0_SIZE 0x0c08
95 #define MV64x60_PCI0_ACC_CNTL_0_BASE_LO 0x1e00
96 #define MV64x60_PCI0_ACC_CNTL_0_BASE_HI 0x1e04
97 #define MV64x60_PCI0_ACC_CNTL_0_SIZE 0x1e08
98 #define MV64x60_PCI0_ACC_CNTL_1_BASE_LO 0x1e10
99 #define MV64x60_PCI0_ACC_CNTL_1_BASE_HI 0x1e14
100 #define MV64x60_PCI0_ACC_CNTL_1_SIZE 0x1e18
101 #define MV64x60_PCI0_ACC_CNTL_2_BASE_LO 0x1e20
102 #define MV64x60_PCI0_ACC_CNTL_2_BASE_HI 0x1e24
103 #define MV64x60_PCI0_ACC_CNTL_2_SIZE 0x1e28
104 #define MV64x60_PCI0_ACC_CNTL_3_BASE_LO 0x1e30
105 #define MV64x60_PCI0_ACC_CNTL_3_BASE_HI 0x1e34
106 #define MV64x60_PCI0_ACC_CNTL_3_SIZE 0x1e38
107 #define MV64x60_PCI0_ACC_CNTL_4_BASE_LO 0x1e40
108 #define MV64x60_PCI0_ACC_CNTL_4_BASE_HI 0x1e44
109 #define MV64x60_PCI0_ACC_CNTL_4_SIZE 0x1e48
110 #define MV64x60_PCI0_ACC_CNTL_5_BASE_LO 0x1e50
111 #define MV64x60_PCI0_ACC_CNTL_5_BASE_HI 0x1e54
112 #define MV64x60_PCI0_ACC_CNTL_5_SIZE 0x1e58
114 #define MV64x60_PCI1_BAR_ENABLE 0x0cbc
115 #define MV64x60_PCI12MEM_0_SIZE 0x0c88
116 #define MV64x60_PCI1_ACC_CNTL_0_BASE_LO 0x1e80
117 #define MV64x60_PCI1_ACC_CNTL_0_BASE_HI 0x1e84
118 #define MV64x60_PCI1_ACC_CNTL_0_SIZE 0x1e88
119 #define MV64x60_PCI1_ACC_CNTL_1_BASE_LO 0x1e90
120 #define MV64x60_PCI1_ACC_CNTL_1_BASE_HI 0x1e94
121 #define MV64x60_PCI1_ACC_CNTL_1_SIZE 0x1e98
122 #define MV64x60_PCI1_ACC_CNTL_2_BASE_LO 0x1ea0
123 #define MV64x60_PCI1_ACC_CNTL_2_BASE_HI 0x1ea4
124 #define MV64x60_PCI1_ACC_CNTL_2_SIZE 0x1ea8
125 #define MV64x60_PCI1_ACC_CNTL_3_BASE_LO 0x1eb0
126 #define MV64x60_PCI1_ACC_CNTL_3_BASE_HI 0x1eb4
127 #define MV64x60_PCI1_ACC_CNTL_3_SIZE 0x1eb8
128 #define MV64x60_PCI1_ACC_CNTL_4_BASE_LO 0x1ec0
129 #define MV64x60_PCI1_ACC_CNTL_4_BASE_HI 0x1ec4
130 #define MV64x60_PCI1_ACC_CNTL_4_SIZE 0x1ec8
131 #define MV64x60_PCI1_ACC_CNTL_5_BASE_LO 0x1ed0
132 #define MV64x60_PCI1_ACC_CNTL_5_BASE_HI 0x1ed4
133 #define MV64x60_PCI1_ACC_CNTL_5_SIZE 0x1ed8
135 #define MV64x60_CPU2PCI_SWAP_NONE 0x01000000
137 #define MV64x60_CPU2PCI0_IO_BASE 0x0048
138 #define MV64x60_CPU2PCI0_IO_SIZE 0x0050
139 #define MV64x60_CPU2PCI0_IO_REMAP 0x00f0
140 #define MV64x60_CPU2PCI0_MEM_0_BASE 0x0058
141 #define MV64x60_CPU2PCI0_MEM_0_SIZE 0x0060
142 #define MV64x60_CPU2PCI0_MEM_0_REMAP_LO 0x00f8
143 #define MV64x60_CPU2PCI0_MEM_0_REMAP_HI 0x0320
145 #define MV64x60_CPU2PCI1_IO_BASE 0x0090
146 #define MV64x60_CPU2PCI1_IO_SIZE 0x0098
147 #define MV64x60_CPU2PCI1_IO_REMAP 0x0108
148 #define MV64x60_CPU2PCI1_MEM_0_BASE 0x00a0
149 #define MV64x60_CPU2PCI1_MEM_0_SIZE 0x00a8
150 #define MV64x60_CPU2PCI1_MEM_0_REMAP_LO 0x0110
151 #define MV64x60_CPU2PCI1_MEM_0_REMAP_HI 0x0340
184 (1 << 31) | (bus << 16) | (devfn << 8) | offset);
192 (1 << 31) | (bus << 16) | (devfn << 8) | offset);
291 snoop_bits = 0x2 << 12;
296 if (enables & (1 << i))
299 base =
in_le32((
u32 *)(bridge_base + mv64x60_cpu2mem[i].
lo))
301 base |= snoop_bits | (mv64x60_dram_selects[
i] << 8);
302 size =
in_le32((
u32 *)(bridge_base + mv64x60_cpu2mem[i].size))
304 prot |= (0x3 << (i << 1));
306 out_le32((
u32 *)(bridge_base + mv64x60_enet2mem[i].lo), base);
307 out_le32((
u32 *)(bridge_base + mv64x60_enet2mem[i].size), size);
308 out_le32((
u32 *)(bridge_base + mv64x60_mpsc2mem[i].lo), base);
309 out_le32((
u32 *)(bridge_base + mv64x60_mpsc2mem[i].size), size);
310 out_le32((
u32 *)(bridge_base + mv64x60_idma2mem[i].lo), base);
311 out_le32((
u32 *)(bridge_base + mv64x60_idma2mem[i].size), size);
419 out_le32((
u32 *)(bridge_base + bar_enable), enables);
422 out_le32((
u32 *)(bridge_base + mv64x60_pci_acc[hose][i].
lo), 0);
434 mem_size = (mem_size - 1) & 0xfffff000;
439 mv64x60_pci2mem[hose].
hi, 0);
442 mv64x60_pci2mem[hose].lo, 0);
446 out_le32((
u32 *)(bridge_base + mv64x60_pci_acc[hose][0].hi), 0);
447 out_le32((
u32 *)(bridge_base + mv64x60_pci_acc[hose][0].lo), acc_bits);
448 out_le32((
u32 *)(bridge_base + mv64x60_pci_acc[hose][0].size),mem_size);
451 i = (
u32)bridge_base;
455 mv64x60_pci2reg[hose].hi, 0);
457 mv64x60_pci2reg[hose].lo, i);
460 out_le32((
u32 *)(bridge_base + bar_enable), enables);
501 out_le32((
u32 *)(bridge_base + offset_tbl[hose].
lo), cpu_base);
509 size = (size - 1) >> 16;
510 out_le32((
u32 *)(bridge_base + offset_tbl[hose].size), size);
522 if (!(enables & (1<<i))) {
524 + mv64x60_cpu2mem[i].
size));
525 v = ((v & 0xffff) + 1) << 16;
538 devp = find_node_by_compatible(
NULL,
"marvell,mv64360");
541 if (getprop(devp,
"reg", v,
sizeof(v)) !=
sizeof(v))
556 devp = find_node_by_compatible(
NULL,
"marvell,mv64360");
559 if (getprop(devp,
"virtual-reg", &v,
sizeof(v)) !=
sizeof(v))
573 devp = finddevice(
"/");
577 if (getprop(devp,
"coherency-off", &v,
sizeof(v)) < 0)