]> git.baikalelectronics.ru Git - kernel.git/commit
[MIPS] Malta: Fix software reset on big endian
authorDmitri Vorobiev <dmitri.vorobiev@gmail.com>
Tue, 8 Jan 2008 03:44:00 +0000 (06:44 +0300)
committerRalf Baechle <ralf@linux-mips.org>
Fri, 11 Jan 2008 17:05:41 +0000 (17:05 +0000)
commitfa06863c7d16467d6fb280d92c381d5a41a950c4
tree77d0c87cd919fded83e70caae461afbbae7a6eae
parent9554242b7bf6d9a067fc622aa64967018ee07c67
[MIPS] Malta: Fix software reset on big endian

I noticed that the commit e021f1f06eaad8977a4defad8aff8c89028dc242
(MIPS Tech: Get rid of volatile in core code) broke the software
reset functionality for MIPS Malta boards in big-endian mode.

According to the MIPS Malta board user's manual, writing the magic
32-bit GORESET value into the SOFTRES register initiates board soft
reset. My experimentation has shown that the endianness of the GORESET
integer should thereby be the same as the endianness, which has been
set for the CPU itself. The writew() function used to write the magic
value in the code introduced by the commit mentioned above, however,
swaps bytes for big-endian kernels and transfers 16 bits instead of 32.

The patch below replaces the writew() function by the __raw_writel()
routine, which leaves the byte order intact and transfers the whole
MIPS machine word. Trivial code cleanup (replacing spaces by a tab
and cutting oversized lines to make checkpatch.pl happy) is also
included.

The patch was tested using a Malta evaluation board running in both
BE and LE modes. For both modes, software reset was fully functional
after the change.

P.S. I suspect that the same commit broke the "standby" functionality
for MIPS Atlas boards. However, I did not touch the Atlas code as I
don't have such board at my disposal and also because the linux-mips.org
Web site claims that Atlas support is scheduled for removal.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/mips-boards/generic/reset.c