Skip to content

Commit

Permalink
core: drivers: imx_wdog: fix register access
Browse files Browse the repository at this point in the history
The registers's base address are 16bytes aligned, so read32/write32
should be replaced with read16/write16.

Signed-off-by: Peng Fan <[email protected]>
Acked-by: Jens Wiklander <[email protected]>
  • Loading branch information
MrVan committed Nov 23, 2017
1 parent b1469ba commit 2ca8fb7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/drivers/imx_wdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ void imx_wdog_restart(void)
write16(val, wdog_base + WCR_OFF);
dsb();

if (read32(wdog_base + WDT_WCR) & WDT_WCR_WDE) {
write32(WDT_SEQ1, wdog_base + WDT_WSR);
write32(WDT_SEQ2, wdog_base + WDT_WSR);
if (read16(wdog_base + WDT_WCR) & WDT_WCR_WDE) {
write16(WDT_SEQ1, wdog_base + WDT_WSR);
write16(WDT_SEQ2, wdog_base + WDT_WSR);
}

write16(val, wdog_base + WCR_OFF);
Expand Down

0 comments on commit 2ca8fb7

Please sign in to comment.