aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-mv78xx0/pcie.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/arch/arm/mach-mv78xx0/pcie.c b/arch/arm/mach-mv78xx0/pcie.c
index dc26a654c496..445e553f4a28 100644
--- a/arch/arm/mach-mv78xx0/pcie.c
+++ b/arch/arm/mach-mv78xx0/pcie.c
@@ -18,6 +18,11 @@
18#include <mach/mv78xx0.h> 18#include <mach/mv78xx0.h>
19#include "common.h" 19#include "common.h"
20 20
21#define MV78XX0_MBUS_PCIE_MEM_TARGET(port, lane) ((port) ? 8 : 4)
22#define MV78XX0_MBUS_PCIE_MEM_ATTR(port, lane) (0xf8 & ~(0x10 << (lane)))
23#define MV78XX0_MBUS_PCIE_IO_TARGET(port, lane) ((port) ? 8 : 4)
24#define MV78XX0_MBUS_PCIE_IO_ATTR(port, lane) (0xf0 & ~(0x10 << (lane)))
25
21struct pcie_port { 26struct pcie_port {
22 u8 maj; 27 u8 maj;
23 u8 min; 28 u8 min;
@@ -71,7 +76,6 @@ static void __init mv78xx0_pcie_preinit(void)
71 start = MV78XX0_PCIE_MEM_PHYS_BASE; 76 start = MV78XX0_PCIE_MEM_PHYS_BASE;
72 for (i = 0; i < num_pcie_ports; i++) { 77 for (i = 0; i < num_pcie_ports; i++) {
73 struct pcie_port *pp = pcie_port + i; 78 struct pcie_port *pp = pcie_port + i;
74 char winname[MVEBU_MBUS_MAX_WINNAME_SZ];
75 79
76 snprintf(pp->mem_space_name, sizeof(pp->mem_space_name), 80 snprintf(pp->mem_space_name, sizeof(pp->mem_space_name),
77 "PCIe %d.%d MEM", pp->maj, pp->min); 81 "PCIe %d.%d MEM", pp->maj, pp->min);
@@ -85,17 +89,12 @@ static void __init mv78xx0_pcie_preinit(void)
85 if (request_resource(&iomem_resource, &pp->res)) 89 if (request_resource(&iomem_resource, &pp->res))
86 panic("can't allocate PCIe MEM sub-space"); 90 panic("can't allocate PCIe MEM sub-space");
87 91
88 snprintf(winname, sizeof(winname), "pcie%d.%d", 92 mvebu_mbus_add_window_by_id(MV78XX0_MBUS_PCIE_MEM_TARGET(pp->maj, pp->min),
89 pp->maj, pp->min); 93 MV78XX0_MBUS_PCIE_MEM_ATTR(pp->maj, pp->min),
90 94 pp->res.start, resource_size(&pp->res));
91 mvebu_mbus_add_window_remap_flags(winname, 95 mvebu_mbus_add_window_remap_by_id(MV78XX0_MBUS_PCIE_IO_TARGET(pp->maj, pp->min),
92 pp->res.start, 96 MV78XX0_MBUS_PCIE_IO_ATTR(pp->maj, pp->min),
93 resource_size(&pp->res), 97 i * SZ_64K, SZ_64K, 0);
94 MVEBU_MBUS_NO_REMAP,
95 MVEBU_MBUS_PCI_MEM);
96 mvebu_mbus_add_window_remap_flags(winname,
97 i * SZ_64K, SZ_64K,
98 0, MVEBU_MBUS_PCI_IO);
99 } 98 }
100} 99}
101 100