提交 695e38d8 编写于 作者: M Mathieu Malaterre 提交者: Alexandre Belloni

rtc: jz4740: fix loading of rtc driver

The current timeout for waiting for WRDY is not always sufficient. Always
increase it to 10000 even on JZ4740. This is technically only required on
JZ4780, where the current symptoms seen after a hard reboot are:

  jz4740-rtc 10003000.rtc: rtc core: registered 10003000.rtc as rtc0
  jz4740-rtc 10003000.rtc: Could not write to RTC registers
  jz4740-rtc: probe of 10003000.rtc failed with error -5
Suggested-by: NAlex Smith <alex.smith@imgtec.com>
Cc: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Signed-off-by: NMathieu Malaterre <malat@debian.org>
Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
上级 49de9828
...@@ -82,7 +82,7 @@ static inline uint32_t jz4740_rtc_reg_read(struct jz4740_rtc *rtc, size_t reg) ...@@ -82,7 +82,7 @@ static inline uint32_t jz4740_rtc_reg_read(struct jz4740_rtc *rtc, size_t reg)
static int jz4740_rtc_wait_write_ready(struct jz4740_rtc *rtc) static int jz4740_rtc_wait_write_ready(struct jz4740_rtc *rtc)
{ {
uint32_t ctrl; uint32_t ctrl;
int timeout = 1000; int timeout = 10000;
do { do {
ctrl = jz4740_rtc_reg_read(rtc, JZ_REG_RTC_CTRL); ctrl = jz4740_rtc_reg_read(rtc, JZ_REG_RTC_CTRL);
...@@ -94,7 +94,7 @@ static int jz4740_rtc_wait_write_ready(struct jz4740_rtc *rtc) ...@@ -94,7 +94,7 @@ static int jz4740_rtc_wait_write_ready(struct jz4740_rtc *rtc)
static inline int jz4780_rtc_enable_write(struct jz4740_rtc *rtc) static inline int jz4780_rtc_enable_write(struct jz4740_rtc *rtc)
{ {
uint32_t ctrl; uint32_t ctrl;
int ret, timeout = 1000; int ret, timeout = 10000;
ret = jz4740_rtc_wait_write_ready(rtc); ret = jz4740_rtc_wait_write_ready(rtc);
if (ret != 0) if (ret != 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册