From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Thierry Subject: [PATCH kvmtool 1/6] rtc: Initialize the Register D for MC146818 RTC Date: Tue, 4 Dec 2018 11:14:28 +0000 Message-ID: <1543922073-55530-2-git-send-email-julien.thierry@arm.com> References: <1543922073-55530-1-git-send-email-julien.thierry@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Sami Mujawar , will.deacon@arm.com To: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu Return-path: In-Reply-To: <1543922073-55530-1-git-send-email-julien.thierry@arm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu List-Id: kvm.vger.kernel.org From: Sami Mujawar Some software drivers check the VRT bit (BIT7) of Register D before using the MC146818 RTC. Initialized the VRT bit in rtc__init() to indicate that the RAM and time contents are valid. Signed-off-by: Sami Mujawar Signed-off-by: Julien Thierry --- hw/rtc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/rtc.c b/hw/rtc.c index 0649b5d..c1fa72f 100644 --- a/hw/rtc.c +++ b/hw/rtc.c @@ -25,6 +25,11 @@ #define RTC_REG_C 0x0C #define RTC_REG_D 0x0D +/* + * Register D Bits + */ +#define RTC_REG_D_VRT (1 << 7) + struct rtc_device { u8 cmos_idx; u8 cmos_data[128]; @@ -140,6 +145,9 @@ int rtc__init(struct kvm *kvm) return r; } + /* Set the VRT bit in Register D to indicate valid RAM and time */ + rtc.cmos_data[RTC_REG_D] = RTC_REG_D_VRT; + return r; } dev_init(rtc__init); -- 1.9.1