Commit 0487de91427925e7c43debeb948bdf53b10ef32c
Committed by
Ralf Baechle
1 parent
c2a04c4f0e
Exists in
master
and in
7 other branches
[MIPS] Malta: Fix reading the PCI clock frequency on big-endian
The JMPRS register on Malta boards keeps a 32-bit CPU-endian value. The readw() function assumes that the value it reads is a little-endian 16-bit number. Therefore, using readw() to obtain the value of the JMPRS register is a mistake. This error leads to incorrect reading of the PCI clock frequency on big-endian during board start-up. Change readw() to __raw_readl(). This was tested by injecting a call to printk() and verifying that the value of the jmpr variable was consistent with current setting of the JP4 "PCI CLK" jumper. Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff
arch/mips/mips-boards/malta/malta_setup.c
... | ... | @@ -149,7 +149,7 @@ |
149 | 149 | /* Check PCI clock */ |
150 | 150 | { |
151 | 151 | unsigned int __iomem *jmpr_p = (unsigned int *) ioremap(MALTA_JMPRS_REG, sizeof(unsigned int)); |
152 | - int jmpr = (readw(jmpr_p) >> 2) & 0x07; | |
152 | + int jmpr = (__raw_readl(jmpr_p) >> 2) & 0x07; | |
153 | 153 | static const int pciclocks[] __initdata = { |
154 | 154 | 33, 20, 25, 30, 12, 16, 37, 10 |
155 | 155 | }; |