aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot
diff options
context:
space:
mode:
authorAlistair Popple <alistair@popple.id.au>2014-03-05 22:52:28 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-04-30 18:26:30 -0400
commite2c37d908336dc27c8b405f063c2a163124947fa (patch)
tree2a5582122d13305abcd4558ed6810329369ea211 /arch/powerpc/boot
parent2a2c74b2efcb1a0ca3fdcb5fbb96ad8de6a29177 (diff)
powerpc: Added PCI MSI support using the HSTA module
The PPC476GTR SoC supports message signalled interrupts (MSI) by writing to special addresses within the High Speed Transfer Assist (HSTA) module. This patch adds support for PCI MSI with a new system device. The DMA window is also updated to allow access to the entire 42-bit address range to allow PCI devices write access to the HSTA module. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/boot')
-rw-r--r--arch/powerpc/boot/dts/akebono.dts46
-rw-r--r--arch/powerpc/boot/treeboot-akebono.c15
2 files changed, 38 insertions, 23 deletions
diff --git a/arch/powerpc/boot/dts/akebono.dts b/arch/powerpc/boot/dts/akebono.dts
index 96ac13b2a02d..f92ecfed3d2f 100644
--- a/arch/powerpc/boot/dts/akebono.dts
+++ b/arch/powerpc/boot/dts/akebono.dts
@@ -82,6 +82,28 @@
82 ranges; 82 ranges;
83 clock-frequency = <200000000>; // 200Mhz 83 clock-frequency = <200000000>; // 200Mhz
84 84
85 HSTA0: hsta@310000e0000 {
86 compatible = "ibm,476gtr-hsta-msi", "ibm,hsta-msi";
87 reg = <0x310 0x000e0000 0x0 0xf0>;
88 interrupt-parent = <&MPIC>;
89 interrupts = <108 0
90 109 0
91 110 0
92 111 0
93 112 0
94 113 0
95 114 0
96 115 0
97 116 0
98 117 0
99 118 0
100 119 0
101 120 0
102 121 0
103 122 0
104 123 0>;
105 };
106
85 MAL0: mcmal { 107 MAL0: mcmal {
86 compatible = "ibm,mcmal-476gtr", "ibm,mcmal2"; 108 compatible = "ibm,mcmal-476gtr", "ibm,mcmal2";
87 dcr-reg = <0xc0000000 0x062>; 109 dcr-reg = <0xc0000000 0x062>;
@@ -242,8 +264,10 @@
242 ranges = <0x02000000 0x00000000 0x80000000 0x00000110 0x80000000 0x0 0x80000000 264 ranges = <0x02000000 0x00000000 0x80000000 0x00000110 0x80000000 0x0 0x80000000
243 0x01000000 0x0 0x0 0x00000140 0x0 0x0 0x00010000>; 265 0x01000000 0x0 0x0 0x00000140 0x0 0x0 0x00010000>;
244 266
245 /* Inbound starting at 0 to memsize filled in by zImage */ 267 /* Inbound starting at 0x0 to 0x40000000000. In order to use MSI
246 dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x0>; 268 * PCI devices must be able to write to the HSTA module.
269 */
270 dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x400 0x0>;
247 271
248 /* This drives busses 0 to 0xf */ 272 /* This drives busses 0 to 0xf */
249 bus-range = <0x0 0xf>; 273 bus-range = <0x0 0xf>;
@@ -280,8 +304,10 @@
280 ranges = <0x02000000 0x00000000 0x80000000 0x00000210 0x80000000 0x0 0x80000000 304 ranges = <0x02000000 0x00000000 0x80000000 0x00000210 0x80000000 0x0 0x80000000
281 0x01000000 0x0 0x0 0x00000240 0x0 0x0 0x00010000>; 305 0x01000000 0x0 0x0 0x00000240 0x0 0x0 0x00010000>;
282 306
283 /* Inbound starting at 0 to memsize filled in by zImage */ 307 /* Inbound starting at 0x0 to 0x40000000000. In order to use MSI
284 dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x0>; 308 * PCI devices must be able to write to the HSTA module.
309 */
310 dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x400 0x0>;
285 311
286 /* This drives busses 0 to 0xf */ 312 /* This drives busses 0 to 0xf */
287 bus-range = <0x0 0xf>; 313 bus-range = <0x0 0xf>;
@@ -318,8 +344,10 @@
318 ranges = <0x02000000 0x00000000 0x80000000 0x00000190 0x80000000 0x0 0x80000000 344 ranges = <0x02000000 0x00000000 0x80000000 0x00000190 0x80000000 0x0 0x80000000
319 0x01000000 0x0 0x0 0x000001c0 0x0 0x0 0x00010000>; 345 0x01000000 0x0 0x0 0x000001c0 0x0 0x0 0x00010000>;
320 346
321 /* Inbound starting at 0 to memsize filled in by zImage */ 347 /* Inbound starting at 0x0 to 0x40000000000. In order to use MSI
322 dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x0>; 348 * PCI devices must be able to write to the HSTA module.
349 */
350 dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x400 0x0>;
323 351
324 /* This drives busses 0 to 0xf */ 352 /* This drives busses 0 to 0xf */
325 bus-range = <0x0 0xf>; 353 bus-range = <0x0 0xf>;
@@ -356,8 +384,10 @@
356 ranges = <0x02000000 0x00000000 0x80000000 0x00000290 0x80000000 0x0 0x80000000 384 ranges = <0x02000000 0x00000000 0x80000000 0x00000290 0x80000000 0x0 0x80000000
357 0x01000000 0x0 0x0 0x000002c0 0x0 0x0 0x00010000>; 385 0x01000000 0x0 0x0 0x000002c0 0x0 0x0 0x00010000>;
358 386
359 /* Inbound starting at 0 to memsize filled in by zImage */ 387 /* Inbound starting at 0x0 to 0x40000000000. In order to use MSI
360 dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x0>; 388 * PCI devices must be able to write to the HSTA module.
389 */
390 dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x400 0x0>;
361 391
362 /* This drives busses 0 to 0xf */ 392 /* This drives busses 0 to 0xf */
363 bus-range = <0x0 0xf>; 393 bus-range = <0x0 0xf>;
diff --git a/arch/powerpc/boot/treeboot-akebono.c b/arch/powerpc/boot/treeboot-akebono.c
index 070a20f2f5d1..b73174c34fe4 100644
--- a/arch/powerpc/boot/treeboot-akebono.c
+++ b/arch/powerpc/boot/treeboot-akebono.c
@@ -75,24 +75,9 @@ static void ibm_akebono_fixups(void)
75{ 75{
76 void *emac; 76 void *emac;
77 u32 reg; 77 u32 reg;
78 void *devp = finddevice("/");
79 u32 dma_ranges[7];
80 78
81 dt_fixup_memory(0x0ULL, ibm_akebono_memsize); 79 dt_fixup_memory(0x0ULL, ibm_akebono_memsize);
82 80
83 while ((devp = find_node_by_devtype(devp, "pci"))) {
84 if (getprop(devp, "dma-ranges", dma_ranges,
85 sizeof(dma_ranges)) < 0) {
86 printf("%s: Failed to get dma-ranges\r\n", __func__);
87 continue;
88 }
89
90 dma_ranges[5] = ibm_akebono_memsize >> 32;
91 dma_ranges[6] = ibm_akebono_memsize & 0xffffffffUL;
92
93 setprop(devp, "dma-ranges", dma_ranges, sizeof(dma_ranges));
94 }
95
96 /* Fixup the SD timeout frequency */ 81 /* Fixup the SD timeout frequency */
97 mtdcrx(CCTL0_MCO4, 0x1); 82 mtdcrx(CCTL0_MCO4, 0x1);
98 83