mxsrtc.c (9c471142bc6c5aa01532ba85ead8509bbf2eb153) | mxsrtc.c (fa7a51cb8272bd6076ea4701fd6bdc65a68703ba) |
---|---|
1/* 2 * Freescale i.MX28 RTC Driver 3 * 4 * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com> 5 * on behalf of DENX Software Engineering GmbH 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by --- 27 unchanged lines hidden (view full) --- 36 37 writel(secs, &rtc_regs->hw_rtc_seconds); 38 39 /* 40 * The 0x80 here means seconds were copied to analog. This information 41 * is taken from the linux kernel driver for the STMP37xx RTC since 42 * documentation doesn't mention it. 43 */ | 1/* 2 * Freescale i.MX28 RTC Driver 3 * 4 * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com> 5 * on behalf of DENX Software Engineering GmbH 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by --- 27 unchanged lines hidden (view full) --- 36 37 writel(secs, &rtc_regs->hw_rtc_seconds); 38 39 /* 40 * The 0x80 here means seconds were copied to analog. This information 41 * is taken from the linux kernel driver for the STMP37xx RTC since 42 * documentation doesn't mention it. 43 */ |
44 ret = mx28_wait_mask_clr(&rtc_regs->hw_rtc_stat_reg, | 44 ret = mxs_wait_mask_clr(&rtc_regs->hw_rtc_stat_reg, |
45 0x80 << RTC_STAT_STALE_REGS_OFFSET, MXS_RTC_MAX_TIMEOUT); 46 47 if (ret) 48 printf("MXS RTC: Timeout waiting for update\n"); 49 50 return ret; 51} 52 --- 22 unchanged lines hidden (view full) --- 75{ 76 struct mxs_rtc_regs *rtc_regs = (struct mxs_rtc_regs *)MXS_RTC_BASE; 77 int ret; 78 79 /* Set time to 1970-01-01 */ 80 mxs_rtc_set_time(0); 81 82 /* Reset the RTC block */ | 45 0x80 << RTC_STAT_STALE_REGS_OFFSET, MXS_RTC_MAX_TIMEOUT); 46 47 if (ret) 48 printf("MXS RTC: Timeout waiting for update\n"); 49 50 return ret; 51} 52 --- 22 unchanged lines hidden (view full) --- 75{ 76 struct mxs_rtc_regs *rtc_regs = (struct mxs_rtc_regs *)MXS_RTC_BASE; 77 int ret; 78 79 /* Set time to 1970-01-01 */ 80 mxs_rtc_set_time(0); 81 82 /* Reset the RTC block */ |
83 ret = mx28_reset_block(&rtc_regs->hw_rtc_ctrl_reg); | 83 ret = mxs_reset_block(&rtc_regs->hw_rtc_ctrl_reg); |
84 if (ret) 85 printf("MXS RTC: Block reset timeout\n"); 86} | 84 if (ret) 85 printf("MXS RTC: Block reset timeout\n"); 86} |