diff options
author | Ganesan Ramalingam <ganesanr@broadcom.com> | 2013-08-11 05:13:58 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2013-09-03 17:22:20 -0400 |
commit | e5be1fd007e4fcbab3dd6e2b0993a7ee305c6628 (patch) | |
tree | e98e4e2d287949241f0fa8dab022db661f7398f6 /arch/mips/netlogic | |
parent | c49e42aba8e8471e30e0ee4d29f9871a4ba67ae9 (diff) |
MIPS: Netlogic: XLP2xx update for I2C controller
XLP2xx has a new I2C controller which has 4 buses connected to
it. Update the IO offset and IRQ mapping code to reflect this.
Signed-off-by: Ganesan Ramalingam <ganesanr@broadcom.com>
Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5707/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/netlogic')
-rw-r--r-- | arch/mips/netlogic/xlp/nlm_hal.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/arch/mips/netlogic/xlp/nlm_hal.c b/arch/mips/netlogic/xlp/nlm_hal.c index 22e2e028fbe4..04adb75850f8 100644 --- a/arch/mips/netlogic/xlp/nlm_hal.c +++ b/arch/mips/netlogic/xlp/nlm_hal.c | |||
@@ -93,11 +93,14 @@ int nlm_irq_to_irt(int irq) | |||
93 | case PIC_MMC_IRQ: | 93 | case PIC_MMC_IRQ: |
94 | devoff = XLP_IO_SD_OFFSET(0); | 94 | devoff = XLP_IO_SD_OFFSET(0); |
95 | break; | 95 | break; |
96 | case PIC_I2C_0_IRQ: | 96 | case PIC_I2C_0_IRQ: /* I2C will be fixed up */ |
97 | devoff = XLP_IO_I2C0_OFFSET(0); | ||
98 | break; | ||
99 | case PIC_I2C_1_IRQ: | 97 | case PIC_I2C_1_IRQ: |
100 | devoff = XLP_IO_I2C1_OFFSET(0); | 98 | case PIC_I2C_2_IRQ: |
99 | case PIC_I2C_3_IRQ: | ||
100 | if (cpu_is_xlpii()) | ||
101 | devoff = XLP2XX_IO_I2C_OFFSET(0); | ||
102 | else | ||
103 | devoff = XLP_IO_I2C0_OFFSET(0); | ||
101 | break; | 104 | break; |
102 | default: | 105 | default: |
103 | devoff = 0; | 106 | devoff = 0; |
@@ -107,9 +110,15 @@ int nlm_irq_to_irt(int irq) | |||
107 | if (devoff != 0) { | 110 | if (devoff != 0) { |
108 | pcibase = nlm_pcicfg_base(devoff); | 111 | pcibase = nlm_pcicfg_base(devoff); |
109 | irt = nlm_read_reg(pcibase, XLP_PCI_IRTINFO_REG) & 0xffff; | 112 | irt = nlm_read_reg(pcibase, XLP_PCI_IRTINFO_REG) & 0xffff; |
110 | /* HW bug, I2C 1 irt entry is off by one */ | 113 | /* HW weirdness, I2C IRT entry has to be fixed up */ |
111 | if (irq == PIC_I2C_1_IRQ) | 114 | switch (irq) { |
112 | irt = irt + 1; | 115 | case PIC_I2C_1_IRQ: |
116 | irt = irt + 1; break; | ||
117 | case PIC_I2C_2_IRQ: | ||
118 | irt = irt + 2; break; | ||
119 | case PIC_I2C_3_IRQ: | ||
120 | irt = irt + 3; break; | ||
121 | } | ||
113 | } else if (irq >= PIC_PCIE_LINK_0_IRQ && irq <= PIC_PCIE_LINK_3_IRQ) { | 122 | } else if (irq >= PIC_PCIE_LINK_0_IRQ && irq <= PIC_PCIE_LINK_3_IRQ) { |
114 | /* HW bug, PCI IRT entries are bad on early silicon, fix */ | 123 | /* HW bug, PCI IRT entries are bad on early silicon, fix */ |
115 | irt = PIC_IRT_PCIE_LINK_INDEX(irq - PIC_PCIE_LINK_0_IRQ); | 124 | irt = PIC_IRT_PCIE_LINK_INDEX(irq - PIC_PCIE_LINK_0_IRQ); |