diff options
author | Prabhakar Kushwaha <prabhakar@freescale.com> | 2011-02-24 04:35:04 -0500 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2011-03-15 10:29:56 -0400 |
commit | f4154e160aa2a40dccc963110768b63ce004fed9 (patch) | |
tree | 699a97ec24ea13b34a19e93065cef6b72d83791e /arch/powerpc/sysdev | |
parent | decbb280bb8e3bceebcf5defb4f61dfbfdb23e18 (diff) |
powerpc/fsl_pci: Add support for FSL PCIe controllers v2.x
FSL PCIe controller v2.1:
- New MSI inbound window
- Same Inbound windows address as PCIe controller v1.x
Added new pit_t member(pmit) to struct ccsr_pci for MSI inbound window
FSL PCIe controller v2.2 and v2.3:
- Different addresses for PCIe inbound window 3,2,1
- Exposed PCIe inbound window 0
- New PCIe interrupt status register
Added new config and interrupt Status register to struct ccsr_pci & updated
pit_t array size to reflect the 4 inbound windows.
Device tree is used to maintain backward compatibility i.e. update inbound
window 1 index depending upon "compatible" field witin PCIE node.
Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
Acked-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r-- | arch/powerpc/sysdev/fsl_pci.c | 15 | ||||
-rw-r--r-- | arch/powerpc/sysdev/fsl_pci.h | 17 |
2 files changed, 21 insertions, 11 deletions
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 818f7c6c8fa1..f8f7f28c6343 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * MPC83xx/85xx/86xx PCI/PCIE support routing. | 2 | * MPC83xx/85xx/86xx PCI/PCIE support routing. |
3 | * | 3 | * |
4 | * Copyright 2007-2010 Freescale Semiconductor, Inc. | 4 | * Copyright 2007-2011 Freescale Semiconductor, Inc. |
5 | * Copyright 2008-2009 MontaVista Software, Inc. | 5 | * Copyright 2008-2009 MontaVista Software, Inc. |
6 | * | 6 | * |
7 | * Initial author: Xianghua Xiao <x.xiao@freescale.com> | 7 | * Initial author: Xianghua Xiao <x.xiao@freescale.com> |
@@ -99,7 +99,7 @@ static void __init setup_pci_atmu(struct pci_controller *hose, | |||
99 | struct resource *rsrc) | 99 | struct resource *rsrc) |
100 | { | 100 | { |
101 | struct ccsr_pci __iomem *pci; | 101 | struct ccsr_pci __iomem *pci; |
102 | int i, j, n, mem_log, win_idx = 2; | 102 | int i, j, n, mem_log, win_idx = 3, start_idx = 1, end_idx = 4; |
103 | u64 mem, sz, paddr_hi = 0; | 103 | u64 mem, sz, paddr_hi = 0; |
104 | u64 paddr_lo = ULLONG_MAX; | 104 | u64 paddr_lo = ULLONG_MAX; |
105 | u32 pcicsrbar = 0, pcicsrbar_sz; | 105 | u32 pcicsrbar = 0, pcicsrbar_sz; |
@@ -109,6 +109,13 @@ static void __init setup_pci_atmu(struct pci_controller *hose, | |||
109 | 109 | ||
110 | pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n", | 110 | pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n", |
111 | (u64)rsrc->start, (u64)rsrc->end - (u64)rsrc->start + 1); | 111 | (u64)rsrc->start, (u64)rsrc->end - (u64)rsrc->start + 1); |
112 | |||
113 | if (of_device_is_compatible(hose->dn, "fsl,qoriq-pcie-v2.2")) { | ||
114 | win_idx = 2; | ||
115 | start_idx = 0; | ||
116 | end_idx = 3; | ||
117 | } | ||
118 | |||
112 | pci = ioremap(rsrc->start, rsrc->end - rsrc->start + 1); | 119 | pci = ioremap(rsrc->start, rsrc->end - rsrc->start + 1); |
113 | if (!pci) { | 120 | if (!pci) { |
114 | dev_err(hose->parent, "Unable to map ATMU registers\n"); | 121 | dev_err(hose->parent, "Unable to map ATMU registers\n"); |
@@ -118,7 +125,7 @@ static void __init setup_pci_atmu(struct pci_controller *hose, | |||
118 | /* Disable all windows (except powar0 since it's ignored) */ | 125 | /* Disable all windows (except powar0 since it's ignored) */ |
119 | for(i = 1; i < 5; i++) | 126 | for(i = 1; i < 5; i++) |
120 | out_be32(&pci->pow[i].powar, 0); | 127 | out_be32(&pci->pow[i].powar, 0); |
121 | for(i = 0; i < 3; i++) | 128 | for (i = start_idx; i < end_idx; i++) |
122 | out_be32(&pci->piw[i].piwar, 0); | 129 | out_be32(&pci->piw[i].piwar, 0); |
123 | 130 | ||
124 | /* Setup outbound MEM window */ | 131 | /* Setup outbound MEM window */ |
@@ -204,7 +211,7 @@ static void __init setup_pci_atmu(struct pci_controller *hose, | |||
204 | mem_log++; | 211 | mem_log++; |
205 | } | 212 | } |
206 | 213 | ||
207 | piwar |= (mem_log - 1); | 214 | piwar |= ((mem_log - 1) & PIWAR_SZ_MASK); |
208 | 215 | ||
209 | /* Setup inbound memory window */ | 216 | /* Setup inbound memory window */ |
210 | out_be32(&pci->piw[win_idx].pitar, 0x00000000); | 217 | out_be32(&pci->piw[win_idx].pitar, 0x00000000); |
diff --git a/arch/powerpc/sysdev/fsl_pci.h b/arch/powerpc/sysdev/fsl_pci.h index 8ad72a11f77b..a39ed5cc2c5a 100644 --- a/arch/powerpc/sysdev/fsl_pci.h +++ b/arch/powerpc/sysdev/fsl_pci.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * MPC85xx/86xx PCI Express structure define | 2 | * MPC85xx/86xx PCI Express structure define |
3 | * | 3 | * |
4 | * Copyright 2007 Freescale Semiconductor, Inc | 4 | * Copyright 2007,2011 Freescale Semiconductor, Inc |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License as published by the | 7 | * under the terms of the GNU General Public License as published by the |
@@ -21,6 +21,7 @@ | |||
21 | #define PIWAR_TGI_LOCAL 0x00f00000 /* target - local memory */ | 21 | #define PIWAR_TGI_LOCAL 0x00f00000 /* target - local memory */ |
22 | #define PIWAR_READ_SNOOP 0x00050000 | 22 | #define PIWAR_READ_SNOOP 0x00050000 |
23 | #define PIWAR_WRITE_SNOOP 0x00005000 | 23 | #define PIWAR_WRITE_SNOOP 0x00005000 |
24 | #define PIWAR_SZ_MASK 0x0000003f | ||
24 | 25 | ||
25 | /* PCI/PCI Express outbound window reg */ | 26 | /* PCI/PCI Express outbound window reg */ |
26 | struct pci_outbound_window_regs { | 27 | struct pci_outbound_window_regs { |
@@ -49,7 +50,9 @@ struct ccsr_pci { | |||
49 | __be32 int_ack; /* 0x.008 - PCI Interrupt Acknowledge Register */ | 50 | __be32 int_ack; /* 0x.008 - PCI Interrupt Acknowledge Register */ |
50 | __be32 pex_otb_cpl_tor; /* 0x.00c - PCIE Outbound completion timeout register */ | 51 | __be32 pex_otb_cpl_tor; /* 0x.00c - PCIE Outbound completion timeout register */ |
51 | __be32 pex_conf_tor; /* 0x.010 - PCIE configuration timeout register */ | 52 | __be32 pex_conf_tor; /* 0x.010 - PCIE configuration timeout register */ |
52 | u8 res2[12]; | 53 | __be32 pex_config; /* 0x.014 - PCIE CONFIG Register */ |
54 | __be32 pex_int_status; /* 0x.018 - PCIE interrupt status */ | ||
55 | u8 res2[4]; | ||
53 | __be32 pex_pme_mes_dr; /* 0x.020 - PCIE PME and message detect register */ | 56 | __be32 pex_pme_mes_dr; /* 0x.020 - PCIE PME and message detect register */ |
54 | __be32 pex_pme_mes_disr; /* 0x.024 - PCIE PME and message disable register */ | 57 | __be32 pex_pme_mes_disr; /* 0x.024 - PCIE PME and message disable register */ |
55 | __be32 pex_pme_mes_ier; /* 0x.028 - PCIE PME and message interrupt enable register */ | 58 | __be32 pex_pme_mes_ier; /* 0x.028 - PCIE PME and message interrupt enable register */ |
@@ -62,14 +65,14 @@ struct ccsr_pci { | |||
62 | * in all of the other outbound windows. | 65 | * in all of the other outbound windows. |
63 | */ | 66 | */ |
64 | struct pci_outbound_window_regs pow[5]; | 67 | struct pci_outbound_window_regs pow[5]; |
65 | 68 | u8 res14[96]; | |
66 | u8 res14[256]; | 69 | struct pci_inbound_window_regs pmit; /* 0xd00 - 0xd9c Inbound MSI */ |
67 | 70 | u8 res6[96]; | |
68 | /* PCI/PCI Express inbound window 3-1 | 71 | /* PCI/PCI Express inbound window 3-0 |
69 | * inbound window 1 supports only a 32-bit base address and does not | 72 | * inbound window 1 supports only a 32-bit base address and does not |
70 | * define an inbound window base extended address register. | 73 | * define an inbound window base extended address register. |
71 | */ | 74 | */ |
72 | struct pci_inbound_window_regs piw[3]; | 75 | struct pci_inbound_window_regs piw[4]; |
73 | 76 | ||
74 | __be32 pex_err_dr; /* 0x.e00 - PCI/PCIE error detect register */ | 77 | __be32 pex_err_dr; /* 0x.e00 - PCI/PCIE error detect register */ |
75 | u8 res21[4]; | 78 | u8 res21[4]; |