diff options
author | RajithaY <rajithax.yerrumsetty@intel.com> | 2017-04-25 03:31:15 -0700 |
---|---|---|
committer | Rajitha Yerrumchetty <rajithax.yerrumsetty@intel.com> | 2017-05-22 06:48:08 +0000 |
commit | bb756eebdac6fd24e8919e2c43f7d2c8c4091f59 (patch) | |
tree | ca11e03542edf2d8f631efeca5e1626d211107e3 /qemu/roms/u-boot/drivers/rtc/mxsrtc.c | |
parent | a14b48d18a9ed03ec191cf16b162206998a895ce (diff) |
Adding qemu as a submodule of KVMFORNFV
This Patch includes the changes to add qemu as a submodule to
kvmfornfv repo and make use of the updated latest qemu for the
execution of all testcase
Change-Id: I1280af507a857675c7f81d30c95255635667bdd7
Signed-off-by:RajithaY<rajithax.yerrumsetty@intel.com>
Diffstat (limited to 'qemu/roms/u-boot/drivers/rtc/mxsrtc.c')
-rw-r--r-- | qemu/roms/u-boot/drivers/rtc/mxsrtc.c | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/qemu/roms/u-boot/drivers/rtc/mxsrtc.c b/qemu/roms/u-boot/drivers/rtc/mxsrtc.c deleted file mode 100644 index 32ba8a306..000000000 --- a/qemu/roms/u-boot/drivers/rtc/mxsrtc.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Freescale i.MX28 RTC Driver - * - * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com> - * on behalf of DENX Software Engineering GmbH - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include <common.h> -#include <rtc.h> -#include <asm/io.h> -#include <asm/arch/imx-regs.h> -#include <asm/arch/sys_proto.h> - -#define MXS_RTC_MAX_TIMEOUT 1000000 - -/* Set time in seconds since 1970-01-01 */ -int mxs_rtc_set_time(uint32_t secs) -{ - struct mxs_rtc_regs *rtc_regs = (struct mxs_rtc_regs *)MXS_RTC_BASE; - int ret; - - writel(secs, &rtc_regs->hw_rtc_seconds); - - /* - * The 0x80 here means seconds were copied to analog. This information - * is taken from the linux kernel driver for the STMP37xx RTC since - * documentation doesn't mention it. - */ - ret = mxs_wait_mask_clr(&rtc_regs->hw_rtc_stat_reg, - 0x80 << RTC_STAT_STALE_REGS_OFFSET, MXS_RTC_MAX_TIMEOUT); - - if (ret) - printf("MXS RTC: Timeout waiting for update\n"); - - return ret; -} - -int rtc_get(struct rtc_time *time) -{ - struct mxs_rtc_regs *rtc_regs = (struct mxs_rtc_regs *)MXS_RTC_BASE; - uint32_t secs; - - secs = readl(&rtc_regs->hw_rtc_seconds); - to_tm(secs, time); - - return 0; -} - -int rtc_set(struct rtc_time *time) -{ - uint32_t secs; - - secs = mktime(time->tm_year, time->tm_mon, time->tm_mday, - time->tm_hour, time->tm_min, time->tm_sec); - - return mxs_rtc_set_time(secs); -} - -void rtc_reset(void) -{ - struct mxs_rtc_regs *rtc_regs = (struct mxs_rtc_regs *)MXS_RTC_BASE; - int ret; - - /* Set time to 1970-01-01 */ - mxs_rtc_set_time(0); - - /* Reset the RTC block */ - ret = mxs_reset_block(&rtc_regs->hw_rtc_ctrl_reg); - if (ret) - printf("MXS RTC: Block reset timeout\n"); -} |