aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/netlogic/xlp/nlm_hal.c
diff options
context:
space:
mode:
authorJayachandran C <jchandra@broadcom.com>2015-01-07 06:28:25 -0500
committerRalf Baechle <ralf@linux-mips.org>2015-04-01 11:21:48 -0400
commit72e0605b4346c3b018a5926ab0b3f535ab1f9b82 (patch)
treed3df6d1e256c8480237b5b826ac8dfb852ac032a /arch/mips/netlogic/xlp/nlm_hal.c
parent9bbc6c7d35e2b3370e5e447f3d165892882d35a8 (diff)
MIPS: Netlogic: Disable writing IRT for disabled blocks
If the device header of a block is not present, return invalid IRT value so that we do not program an incorrect offset. Signed-off-by: Jayachandran C <jchandra@broadcom.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/8882/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/netlogic/xlp/nlm_hal.c')
-rw-r--r--arch/mips/netlogic/xlp/nlm_hal.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/arch/mips/netlogic/xlp/nlm_hal.c b/arch/mips/netlogic/xlp/nlm_hal.c
index 7e0d22419e9b..de41fb5dec4c 100644
--- a/arch/mips/netlogic/xlp/nlm_hal.c
+++ b/arch/mips/netlogic/xlp/nlm_hal.c
@@ -170,16 +170,23 @@ static int xlp_irq_to_irt(int irq)
170 } 170 }
171 171
172 if (devoff != 0) { 172 if (devoff != 0) {
173 uint32_t val;
174
173 pcibase = nlm_pcicfg_base(devoff); 175 pcibase = nlm_pcicfg_base(devoff);
174 irt = nlm_read_reg(pcibase, XLP_PCI_IRTINFO_REG) & 0xffff; 176 val = nlm_read_reg(pcibase, XLP_PCI_IRTINFO_REG);
175 /* HW weirdness, I2C IRT entry has to be fixed up */ 177 if (val == 0xffffffff) {
176 switch (irq) { 178 irt = -1;
177 case PIC_I2C_1_IRQ: 179 } else {
178 irt = irt + 1; break; 180 irt = val & 0xffff;
179 case PIC_I2C_2_IRQ: 181 /* HW weirdness, I2C IRT entry has to be fixed up */
180 irt = irt + 2; break; 182 switch (irq) {
181 case PIC_I2C_3_IRQ: 183 case PIC_I2C_1_IRQ:
182 irt = irt + 3; break; 184 irt = irt + 1; break;
185 case PIC_I2C_2_IRQ:
186 irt = irt + 2; break;
187 case PIC_I2C_3_IRQ:
188 irt = irt + 3; break;
189 }
183 } 190 }
184 } else if (irq >= PIC_PCIE_LINK_LEGACY_IRQ(0) && 191 } else if (irq >= PIC_PCIE_LINK_LEGACY_IRQ(0) &&
185 irq <= PIC_PCIE_LINK_LEGACY_IRQ(3)) { 192 irq <= PIC_PCIE_LINK_LEGACY_IRQ(3)) {