rcar_gen3: drivers: Change to restore timer counter value at resume
Changed to save and restore cntpct_el0 using memory mapped
register for generic timer when System Suspend and Resume.
Reported by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>
Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Change-Id: I40fd9f5434c4d52b320cd1d20322b9b8e4e67155
diff --git a/drivers/renesas/rcar/pwrc/call_sram.S b/drivers/renesas/rcar/pwrc/call_sram.S
index 7c96b7e..aa8644c 100644
--- a/drivers/renesas/rcar/pwrc/call_sram.S
+++ b/drivers/renesas/rcar/pwrc/call_sram.S
@@ -1,21 +1,13 @@
/*
- * Copyright (c) 2018, Renesas Electronics Corporation. All rights reserved.
+ * Copyright (c) 2015-2019, Renesas Electronics Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch.h>
#include <asm_macros.S>
-#include "rcar_def.h"
.global rcar_pwrc_switch_stack
-.global rcar_pwrc_save_generic_timer
-.global rcar_pwrc_restore_generic_timer
-
-#define OFFSET_SP_X9_X10 (0x00)
-#define OFFSET_CNTFID0 (0x10)
-#define OFFSET_CNTPCT_EL0 (0x18)
-#define OFFSET_TIMER_COUNT (0x20)
/*
* x0 : jump address,
@@ -54,37 +46,3 @@
ldp x29, x30, [sp,#-16]
ret
endfunc rcar_pwrc_switch_stack
-
-/* x0 : stack pointer base address */
-func rcar_pwrc_save_generic_timer
-
- stp x9, x10, [x0, #OFFSET_SP_X9_X10]
-
- /* save CNTFID0 and cntpct_el0 */
- mov_imm x10, (RCAR_CNTC_BASE + CNTFID_OFF)
- ldr x9, [x10]
- mrs x10, cntpct_el0
- stp x9, x10, [x0, #OFFSET_CNTFID0]
-
- ldp x9, x10, [x0, #OFFSET_SP_X9_X10]
-
- ret
-endfunc rcar_pwrc_save_generic_timer
-
-/* x0 : Stack pointer base address */
-func rcar_pwrc_restore_generic_timer
-
- stp x9, x10, [x0, #OFFSET_SP_X9_X10]
-
- /* restore CNTFID0 and cntpct_el0 */
- ldr x10, [x0, #OFFSET_CNTFID0]
- mov_imm x9, (RCAR_CNTC_BASE + CNTFID_OFF)
- str x10, [x9]
- ldp x9, x10, [x0, #OFFSET_CNTPCT_EL0]
- add x9, x9, x10
- str x9, [x0, #OFFSET_TIMER_COUNT]
-
- ldp x9, x10, [x0, #OFFSET_SP_X9_X10]
-
- ret
-endfunc rcar_pwrc_restore_generic_timer