[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-mips-cvs
Subject:    MIPS: Malta: Don't reinitialise RTC
From:       linux-mips () linux-mips ! org
Date:       2015-07-23 10:08:43
Message-ID: S27010576AbbGWKIp4wHNl/20150723100845Z+15 () eddie ! linux-mips ! org
[Download RAW message or body]

Author: James Hogan <james.hogan@imgtec.com> Fri Jul 17 15:54:41 2015 +0100
Comitter: Ralf Baechle <ralf@linux-mips.org> Mon Jul 20 08:00:51 2015 +0200
Commit: a157fa14e857813045399ee874bd77aa243ae9bb
Gitweb: http://git.linux-mips.org/g/ralf/linux/a157fa14e857
Branch: linux-3.18-stable

On Malta, since commit a87ea88d8f6c ("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: a87ea88d8f6c ("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>
(cherry picked from commit 4ed15cced4463be065c085f84dfddc2d53f2204a)

---

 arch/mips/mti-malta/malta-time.c |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic