diff options
author | Jayachandran C <jchandra@broadcom.com> | 2015-01-07 16:58:25 +0530 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-04-01 17:21:48 +0200 |
commit | 72e0605b4346c3b018a5926ab0b3f535ab1f9b82 (patch) | |
tree | d3df6d1e256c8480237b5b826ac8dfb852ac032a /arch/mips/netlogic/xlp | |
parent | 9bbc6c7d35e2b3370e5e447f3d165892882d35a8 (diff) | |
download | blackbird-obmc-linux-72e0605b4346c3b018a5926ab0b3f535ab1f9b82.tar.gz blackbird-obmc-linux-72e0605b4346c3b018a5926ab0b3f535ab1f9b82.zip |
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')
-rw-r--r-- | arch/mips/netlogic/xlp/nlm_hal.c | 25 |
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) } if (devoff != 0) { + uint32_t val; + pcibase = nlm_pcicfg_base(devoff); - irt = nlm_read_reg(pcibase, XLP_PCI_IRTINFO_REG) & 0xffff; - /* HW weirdness, I2C IRT entry has to be fixed up */ - switch (irq) { - case PIC_I2C_1_IRQ: - irt = irt + 1; break; - case PIC_I2C_2_IRQ: - irt = irt + 2; break; - case PIC_I2C_3_IRQ: - irt = irt + 3; break; + val = nlm_read_reg(pcibase, XLP_PCI_IRTINFO_REG); + if (val == 0xffffffff) { + irt = -1; + } else { + irt = val & 0xffff; + /* HW weirdness, I2C IRT entry has to be fixed up */ + switch (irq) { + case PIC_I2C_1_IRQ: + irt = irt + 1; break; + case PIC_I2C_2_IRQ: + irt = irt + 2; break; + case PIC_I2C_3_IRQ: + irt = irt + 3; break; + } } } else if (irq >= PIC_PCIE_LINK_LEGACY_IRQ(0) && irq <= PIC_PCIE_LINK_LEGACY_IRQ(3)) { |