Xiaohu.Huang | 6095045 | 2022-03-12 22:51:01 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2021-2022 Amlogic, Inc. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | */ |
| 6 | |
| 7 | #ifndef __RTC_H__ |
| 8 | #define __RTC_H__ |
| 9 | |
Xiaohu.Huang | 6095045 | 2022-03-12 22:51:01 +0800 | [diff] [blame] | 10 | /* RTC enbale bit */ |
xiaohu.huang | 2beac51 | 2022-05-07 15:10:04 +0800 | [diff] [blame] | 11 | #define RTC_CTRL_EN (12) |
Xiaohu.Huang | 6095045 | 2022-03-12 22:51:01 +0800 | [diff] [blame] | 12 | /* RTC alarm enbale bit */ |
xiaohu.huang | 2beac51 | 2022-05-07 15:10:04 +0800 | [diff] [blame] | 13 | #define RTC_CTRL_ALM0_EN (0) |
Xiaohu.Huang | 6095045 | 2022-03-12 22:51:01 +0800 | [diff] [blame] | 14 | /* RTC INT irq status bit */ |
xiaohu.huang | 2beac51 | 2022-05-07 15:10:04 +0800 | [diff] [blame] | 15 | #define RTC_INT_IRQ (8) |
Xiaohu.Huang | 6095045 | 2022-03-12 22:51:01 +0800 | [diff] [blame] | 16 | /* RTC INT alarm0 irq status bit */ |
xiaohu.huang | 2beac51 | 2022-05-07 15:10:04 +0800 | [diff] [blame] | 17 | #define RTC_INT_ALM0_IRQ (0) |
Xiaohu.Huang | 6095045 | 2022-03-12 22:51:01 +0800 | [diff] [blame] | 18 | /* RTC INT clear alarm0 irq bit */ |
xiaohu.huang | 2beac51 | 2022-05-07 15:10:04 +0800 | [diff] [blame] | 19 | #define RTC_INT_CLR_ALM0_IRQ (0) |
Xiaohu.Huang | 6095045 | 2022-03-12 22:51:01 +0800 | [diff] [blame] | 20 | |
| 21 | /* REBOOT_MODE */ |
xiaohu.huang | 2beac51 | 2022-05-07 15:10:04 +0800 | [diff] [blame] | 22 | #define COLD_REBOOT (0) |
Xiaohu.Huang | 6095045 | 2022-03-12 22:51:01 +0800 | [diff] [blame] | 23 | |
| 24 | void *MboxGetRTC(void *msg); |
| 25 | void *MboxSetRTC(void *msg); |
| 26 | void rtc_init(void); |
| 27 | void store_rtc(void); |
yiting.deng | 6ec1d64 | 2023-03-19 10:10:35 +0800 | [diff] [blame] | 28 | void rtc_enable_irq(void); |
| 29 | void rtc_disable_irq(void); |
yiting.deng | ac5b18d | 2023-04-25 11:13:26 +0800 | [diff] [blame] | 30 | void alarm_clr(void); |
Xiaohu.Huang | 6095045 | 2022-03-12 22:51:01 +0800 | [diff] [blame] | 31 | #endif //__RTC_H__ |