]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: Malta: Don't reinitialise RTC
authorJames Hogan <james.hogan@imgtec.com>
Fri, 17 Jul 2015 14:54:41 +0000 (15:54 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 3 Aug 2015 07:25:07 +0000 (09:25 +0200)
commitc9d1674d5f89b350ddcb8630b1ea8c1f54821a6f
tree1754728ac92eaf13122d28718d760c9d12b5d6c8
parentb3dbe06b1767070c6fce96f202968a6dfa242bef
MIPS: Malta: Don't reinitialise RTC

On Malta, since commit f18393ae9bda ("MIPS: Malta: initialise the RTC at
boot"), the RTC is reinitialised and forced into binary coded decimal
(BCD) mode during init, even if the bootloader has already initialised
it, and may even have already put it into binary mode (as YAMON does).
This corrupts the current time, can result in the RTC seconds being an
invalid BCD (e.g. 0x1a..0x1f) for up to 6 seconds, as well as confusing
YAMON for a while after reset, enough for it to report timeouts when
attempting to load from TFTP (it actually uses the RTC in that code).

Therefore only initialise the RTC to the extent that is necessary so
that Linux avoids interfering with the bootloader setup, while also
allowing it to estimate the CPU frequency without hanging, without a
bootloader necessarily having done anything with the RTC (for example
when the kernel is loaded via EJTAG).

The divider control is configured for a 32KHZ reference clock if
necessary, and the SET bit of the RTC_CONTROL register is cleared if
necessary without changing any other bits (this bit will be set when
coming out of reset if the battery has been disconnected).

Fixes: f18393ae9bda ("MIPS: Malta: initialise the RTC at boot")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Paul Burton <paul.burton@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: <stable@vger.kernel.org> # 3.14+
Patchwork: https://patchwork.linux-mips.org/patch/10739/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/mti-malta/malta-time.c