提交 0487de91 编写于 作者: D Dmitri Vorobiev 提交者: Ralf Baechle

[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: NDmitri Vorobiev <dmitri.vorobiev@gmail.com>
Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 c2a04c4f
...@@ -149,7 +149,7 @@ void __init plat_mem_setup(void) ...@@ -149,7 +149,7 @@ void __init plat_mem_setup(void)
/* Check PCI clock */ /* Check PCI clock */
{ {
unsigned int __iomem *jmpr_p = (unsigned int *) ioremap(MALTA_JMPRS_REG, sizeof(unsigned int)); unsigned int __iomem *jmpr_p = (unsigned int *) ioremap(MALTA_JMPRS_REG, sizeof(unsigned int));
int jmpr = (readw(jmpr_p) >> 2) & 0x07; int jmpr = (__raw_readl(jmpr_p) >> 2) & 0x07;
static const int pciclocks[] __initdata = { static const int pciclocks[] __initdata = {
33, 20, 25, 30, 12, 16, 37, 10 33, 20, 25, 30, 12, 16, 37, 10
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册