hv: add vRTC reg_b and reg_c support

During setting RTC time, driver will halt RTC update. So support
bit 7 of reg_b. When it set to 0, time will be updated. And
when it's set to 1, rtc will keep the second it was set.

In the process of getting RTC time, driver sets alarm interrupt,
waits 1s, and get alarm interrupt flag. So support alarm interrupt
flag update. If alarm interrupt is enabled (bit 5, reg_b set to 1),
interrupt flag register will be set (bit 7 & bit 5 of reg_c) at
appropriate time.

Tracked-On: #7440
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Yuanyuan Zhao
2022-04-21 15:10:23 +08:00
committed by acrnsi-robot
parent 6ade2b6b0c
commit dfdf79ffa9
2 changed files with 76 additions and 3 deletions

View File

@@ -60,8 +60,13 @@
#define RTC_STATUSB 0x0b /* status register B */
#define RTCSB_24HR 0x02U /* 0 = 12 hours, 1 = 24 hours */
#define RTCSB_BCD 0x04U /* 0 = BCD, 1 = Binary coded time */
#define RTCSB_AINTR 0x20U /* 1 = enable alarm interrupt */
#define RTCSB_HALT 0x80U /* stop clock updates */
#define RTC_INTR 0x0c /* status register C (R) interrupt source */
#define RTCIR_ALARM 0x20U /* alarm intr */
#define RTCIR_INT 0x80U /* interrupt output signal */
#define RTC_STATUSD 0x0d /* status register D (R) Lost Power */
#endif /* _MC146818_RTC_H_ */