Home
last modified time | relevance | path

Searched full:rtc (Results 1 – 25 of 693) sorted by relevance

12345678910>>...28

/openbmc/u-boot/drivers/rtc/
H A Ds3c24x0_rtc.c8 * Date & Time support for the built-in Samsung S3C24X0 RTC
16 #include <rtc.h>
28 struct s3c24x0_rtc *rtc = s3c24x0_get_base_rtc(); in SetRTC_Access() local
32 writeb(readb(&rtc->rtccon) | 0x01, &rtc->rtccon); in SetRTC_Access()
36 writeb(readb(&rtc->rtccon) & ~0x01, &rtc->rtccon); in SetRTC_Access()
45 struct s3c24x0_rtc *rtc = s3c24x0_get_base_rtc(); in rtc_get() local
50 /* enable access to RTC registers */ in rtc_get()
53 /* read RTC registers */ in rtc_get()
55 sec = readb(&rtc->bcdsec); in rtc_get()
56 min = readb(&rtc->bcdmin); in rtc_get()
[all …]
H A DKconfig2 # RTC drivers configuration
8 bool "Enable Driver Model for RTC drivers"
11 Enable drver model for real-time-clock drivers. The RTC uclass
13 drivers to perform the actual functions. See rtc.h for a
17 bool "Enable Driver Model for RTC drivers in SPL"
20 Enable drver model for real-time-clock drivers. The RTC uclass
22 drivers to perform the actual functions. See rtc.h for a
26 bool "Enable Driver Model for RTC drivers in TPL"
29 Enable drver model for real-time-clock drivers. The RTC uclass
31 drivers to perform the actual functions. See rtc.h for a
[all …]
H A Ddavinci.c8 #include <rtc.h>
14 struct davinci_rtc *rtc = (struct davinci_rtc *)DAVINCI_RTC_BASE; in rtc_get() local
18 status = readl(&rtc->status); in rtc_get()
20 printf("RTC doesn't run\n"); in rtc_get()
26 sec = readl(&rtc->second); in rtc_get()
27 min = readl(&rtc->minutes); in rtc_get()
28 hour = readl(&rtc->hours); in rtc_get()
29 mday = readl(&rtc->day); in rtc_get()
30 wday = readl(&rtc->dotw); in rtc_get()
31 mon_cent = readl(&rtc->month); in rtc_get()
[all …]
H A Dmcfrtc.c10 #include <rtc.h>
12 #include <asm/rtc.h>
25 volatile rtc_t *rtc = (rtc_t *) (CONFIG_SYS_MCFRTC_BASE); in rtc_get() local
30 rtc_days = rtc->days; in rtc_get()
31 rtc_hrs = rtc->hourmin >> 8; in rtc_get()
32 rtc_mins = RTC_HOURMIN_MINUTES(rtc->hourmin); in rtc_get()
36 tim = (tim * 60) + rtc->seconds; in rtc_get()
54 volatile rtc_t *rtc = (rtc_t *) (CONFIG_SYS_MCFRTC_BASE); in rtc_set() local
87 rtc->days = days; in rtc_set()
88 rtc->hourmin = (tmp->tm_hour << 8) | tmp->tm_min; in rtc_set()
[all …]
H A Dftrtc010.c11 #include <rtc.h>
34 * RTC Control Register
42 static struct ftrtc010 *rtc = (struct ftrtc010 *)CONFIG_FTRTC010_BASE; variable
46 writel(FTRTC010_CR_ENABLE, &rtc->cr); in ftrtc010_enable()
61 second = readl(&rtc->sec); in ftrtc010_time()
62 day = readl(&rtc->day); in ftrtc010_time()
63 hour = readl(&rtc->hour); in ftrtc010_time()
64 minute = readl(&rtc->min); in ftrtc010_time()
65 second2 = readl(&rtc->sec); in ftrtc010_time()
72 * Get the current time from the RTC
[all …]
H A Dmc13xxx-rtc.c7 #include <rtc.h>
12 int rtc_get(struct rtc_time *rtc) in rtc_get() argument
38 rtc_to_tm(tim, rtc); in rtc_get()
40 rtc->tm_yday = 0; in rtc_get()
41 rtc->tm_isdst = 0; in rtc_get()
46 int rtc_set(struct rtc_time *rtc) in rtc_set() argument
53 time = rtc_mktime(rtc); in rtc_set()
H A Drx8025.c8 * Epson RX8025 RTC driver.
13 #include <rtc.h>
31 * RTC register addresses
58 * Note: the RX8025 I2C RTC requires register
76 * Get the current time from the RTC
85 printf("Error reading from RTC\n"); in rtc_get()
95 DEBUGR ("Get RTC year: %02x mon: %02x mday: %02x wday: %02x " in rtc_get()
102 printf("RTC: power-on detected\n"); in rtc_get()
107 printf("RTC: voltage drop detected\n"); in rtc_get()
112 printf("RTC: oscillator stop detected\n"); in rtc_get()
[all …]
H A Dmxsrtc.c3 * Freescale i.MX28 RTC Driver
10 #include <rtc.h>
27 * is taken from the linux kernel driver for the STMP37xx RTC since in mxs_rtc_set_time()
34 printf("MXS RTC: Timeout waiting for update\n"); in mxs_rtc_set_time()
67 /* Reset the RTC block */ in rtc_reset()
70 printf("MXS RTC: Block reset timeout\n"); in rtc_reset()
H A Dpt7c4338.c11 * This file is based on drivers/rtc/ds1337.c
22 #include <rtc.h>
25 /* RTC register addresses */
35 /* RTC second register address bit */
38 /* RTC control and status register bits */
45 /* RTC reset value */
61 /* Get the current time from the RTC */
75 debug("Get RTC year: %02x mon: %02x mday: %02x wday: %02x " in rtc_get()
80 printf("### Warning: RTC oscillator has stopped\n"); in rtc_get()
104 /* Set the RTC */
[all …]
H A Dpl031.c6 * reference linux-2.6.20.6/drivers/rtc/rtc-pl031.c
13 #include <rtc.h>
50 * Probe RTC device
54 /* Enable RTC Start in Control register*/ in pl031_probe()
61 * Get the current time from the RTC
82 * Set the RTC
104 * Reset the RTC. We set the date back to 1970-01-01.
134 .name = "rtc-pl031",
H A Disl1208.c11 * ISL1208 Real Time Clock (RTC).
17 #include <rtc.h>
29 * RTC register addresses
41 * RTC control register bits
45 * RTC status register bits
49 #define RTC_STAT_BIT_WRTC 0x10 /* WRITE RTC ENABLE BIT */
55 * Read an RTC register
64 * Write an RTC register
73 * Get the current time from the RTC
86 printf ("### Warning: RTC oscillator has stopped\n"); in isl1208_rtc_get()
[all …]
H A Dds3231.c9 * Extremly Accurate DS3231 Real Time Clock (RTC).
16 #include <rtc.h>
20 * RTC register addresses
34 * RTC control register bits
44 * RTC status register bits
58 * Get the current time from the RTC
75 debug("Get RTC year: %02x mon/cent: %02x mday: %02x wday: %02x " in rtc_get()
80 printf ("### Warning: RTC oscillator has stopped\n"); in rtc_get()
106 * Set the RTC
132 * Reset the RTC. We also enable the oscillator output on the
H A Dmvrtc.c8 * Date & Time support for Marvell Integrated RTC
14 #include <rtc.h>
18 /* This RTC does not support century, so we assume 20 */
34 printf("Error: RTC in 12 hour mode, can't determine AM/PM.\n"); in __mv_rtc_get()
51 /* not supported in this RTC */ in __mv_rtc_get()
112 /* no init routine for this RTC needed, just check that it's working */ in __mv_rtc_reset()
119 printf("Error: RTC did not increment.\n"); in __mv_rtc_reset()
165 { .compatible = "marvell,kirkwood-rtc" },
166 { .compatible = "marvell,orion-rtc" },
179 .name = "rtc-mv",
H A Dds1374.c11 * DS1374 Real Time Clock (RTC).
18 #include <rtc.h>
41 * RTC register addresses
52 #define RTC_CTL_ADDR 0x07 /* RTC-CoNTrol-register */
53 #define RTC_SR_ADDR 0x08 /* RTC-StatusRegister */
54 #define RTC_TCS_DS_ADDR 0x09 /* RTC-TrickleChargeSelect DiodeSelect-register */
80 * Get the current time from the RTC
112 printf("can't get consistent time from rtc chip\n"); in rtc_get()
116 DEBUGR ("Get RTC s since 1.1.1970: %ld\n", time1); in rtc_get()
121 printf ("### Warning: RTC oscillator has stopped\n"); in rtc_get()
[all …]
H A Dds1337.c10 * DS1337 Real Time Clock (RTC).
15 #include <rtc.h>
19 * RTC register addresses
46 * RTC control register bits
56 * RTC status register bits
67 * Get the current time from the RTC
89 debug("Get RTC year: %02x mon/cent: %02x mday: %02x wday: %02x " in rtc_get()
94 printf ("### Warning: RTC oscillator has stopped\n"); in rtc_get()
120 * Set the RTC
146 * Reset the RTC. We also enable the oscillator output on the
/openbmc/qemu/hw/rtc/
H A Daspeed_rtc.c10 #include "hw/rtc/aspeed_rtc.h"
14 #include "system/rtc.h"
27 static void aspeed_rtc_calc_offset(AspeedRtcState *rtc) in aspeed_rtc_calc_offset() argument
31 uint32_t reg1 = rtc->reg[COUNTER1]; in aspeed_rtc_calc_offset()
32 uint32_t reg2 = rtc->reg[COUNTER2]; in aspeed_rtc_calc_offset()
44 rtc->offset = qemu_timedate_diff(&tm); in aspeed_rtc_calc_offset()
47 static uint32_t aspeed_rtc_get_counter(AspeedRtcState *rtc, int r) in aspeed_rtc_get_counter() argument
52 qemu_get_timedate(&now, rtc->offset); in aspeed_rtc_get_counter()
71 AspeedRtcState *rtc = opaque; in aspeed_rtc_read() local
78 if (rtc->reg[CONTROL] & RTC_ENABLED) { in aspeed_rtc_read()
[all …]
/openbmc/u-boot/drivers/bootcount/
H A Drtc.c9 #include <rtc.h>
14 struct udevice *rtc; member
23 if (rtc_write16(priv->rtc, priv->offset, val) < 0) { in bootcount_rtc_set()
36 if (rtc_read16(priv->rtc, priv->offset, &val) < 0) { in bootcount_rtc_get()
54 struct udevice *rtc; in bootcount_rtc_probe() local
56 if (dev_read_phandle_with_args(dev, "rtc", NULL, 0, 0, &phandle_args)) { in bootcount_rtc_probe()
57 debug("%s: rtc backing device not specified\n", dev->name); in bootcount_rtc_probe()
61 if (uclass_get_device_by_ofnode(UCLASS_RTC, phandle_args.node, &rtc)) { in bootcount_rtc_probe()
66 priv->rtc = rtc; in bootcount_rtc_probe()
78 { .compatible = "u-boot,bootcount-rtc" },
[all …]
H A DKconfig35 bool "Boot counter in AM33XX RTC IP block"
39 A bootcount driver for the RTC IP block found on many TI platforms.
40 This requires the RTC clocks, etc, to be enabled prior to use and
41 not all boards with this IP block on it will have the RTC in use.
64 Enable support for the bootcounter on an i2c (like RTC) device.
87 bool "Support RTC devices as a backing store for bootcount"
90 Enabled reading/writing the bootcount in a DM RTC device.
92 'u-boot,bootcount-rtc' and the 'rtc'-property (a phandle pointing
93 to the underlying RTC device) and an optional 'offset' property
97 and read16 ops of DM RTC devices.
H A Dbootcount_davinci.c6 * A bootcount driver for the RTC IP block found on many TI platforms.
7 * This requires the RTC clocks, etc, to be enabled prior to use and
8 * not all boards with this IP block on it will have the RTC in use.
20 * write RTC kick registers to enable write in bootcount_store()
21 * for RTC Scratch registers. Scratch register 2 is in bootcount_store()
/openbmc/qemu/include/system/
H A Drtc.h2 * RTC configuration and clock read
29 * qemu_get_timedate: Get the current RTC time
30 * @tm: struct tm to fill in with RTC time
31 * @offset: offset in seconds to adjust the RTC time by before
34 * This function fills in @tm with the current RTC time, as adjusted
36 * will be one hour further ahead than the current RTC time).
38 * The usual use is by RTC device models, which should call this function
40 * when it reads the RTC registers.
43 * depend on the -rtc command line option passed by the user.
48 * qemu_timedate_diff: Return difference between a struct tm and the RTC
[all …]
/openbmc/qemu/hw/ppc/
H A Dspapr_rtc.c31 #include "system/rtc.h"
39 void spapr_rtc_read(SpaprRtcState *rtc, struct tm *tm, uint32_t *ns) in spapr_rtc_read() argument
45 assert(rtc); in spapr_rtc_read()
47 guest_ns = host_ns + rtc->ns_offset; in spapr_rtc_read()
58 int spapr_rtc_import_offset(SpaprRtcState *rtc, int64_t legacy_offset) in spapr_rtc_import_offset() argument
60 if (!rtc) { in spapr_rtc_import_offset()
64 rtc->ns_offset = legacy_offset * NANOSECONDS_PER_SECOND; in spapr_rtc_import_offset()
82 spapr_rtc_read(&spapr->rtc, &tm, &ns); in rtas_get_time_of_day()
99 SpaprRtcState *rtc = &spapr->rtc; in rtas_set_time_of_day() local
124 qom_path = object_get_canonical_path(OBJECT(rtc)); in rtas_set_time_of_day()
[all …]
/openbmc/qemu/hw/m68k/
H A Dnext-cube.c48 #define TYPE_NEXT_RTC "next-rtc"
111 NeXTRTC rtc; member
188 /* DPRINTF("RTC %x phase %i\n", scr2_2, rtc->phase); */ in next_scr2_rtc_update()
938 NeXTRTC *rtc = NEXT_RTC(opaque); in next_rtc_data_in_irq() local
940 if (rtc->phase < 8) { in next_rtc_data_in_irq()
941 rtc->command = (rtc->command << 1) | level; in next_rtc_data_in_irq()
943 if (rtc->phase == 7 && !next_rtc_cmd_is_write(rtc->command)) { in next_rtc_data_in_irq()
944 if (rtc->command <= 0x1f) { in next_rtc_data_in_irq()
946 rtc->retval = rtc->ram[rtc->command]; in next_rtc_data_in_irq()
948 if ((rtc->command >= 0x20) && (rtc->command <= 0x2f)) { in next_rtc_data_in_irq()
[all …]
/openbmc/u-boot/include/
H A Drtc.h8 * Generic RTC interface.
13 /* bcd<->bin functions are needed by almost all the RTC drivers, let's include
25 * Returns the current time read from the RTC device. The driver
36 * Sets the time in the RTC device. The driver can expect every
45 * reset() - reset the RTC to a known-good state
47 * This function resets the RTC to a known-good state. The time may
76 /* Access the operations for an RTC device */
80 * dm_rtc_get() - Read the time from an RTC
89 * dm_rtc_set() - Write a time to an RTC
92 * @time: Time to write into the RTC
[all …]
/openbmc/qemu/include/hw/rtc/
H A Dallwinner-rtc.h31 /** Highest register address used by RTC device */
44 /** Generic Allwinner RTC device (abstract) */
45 #define TYPE_AW_RTC "allwinner-rtc"
47 /** Allwinner RTC sun4i family (A10, A12) */
50 /** Allwinner RTC sun6i family and newer (A31, H2+, H3, etc) */
53 /** Allwinner RTC sun7i family (A20) */
68 * Allwinner RTC per-object instance state.
93 * Allwinner RTC class-level struct.
/openbmc/u-boot/arch/arm/mach-omap2/am33xx/
H A Dboard.c165 * RTC only with DDR in self-refresh mode magic value, checked against during
171 /* Board type field bit shift for RTC only with DDR in self-refresh mode */
324 static void rtc32k_unlock(struct davinci_rtc *rtc) in rtc32k_unlock() argument
327 * Unlock the RTC's registers. For more details please see the in rtc32k_unlock()
331 writel(RTC_KICK0R_WE, &rtc->kick0r); in rtc32k_unlock()
332 writel(RTC_KICK1R_WE, &rtc->kick1r); in rtc32k_unlock()
351 struct davinci_rtc *rtc = (struct davinci_rtc *)RTC_BASE; in update_rtc_magic() local
356 rtc32k_unlock(rtc); in update_rtc_magic()
359 writel(magic, &rtc->scratch1); in update_rtc_magic()
389 struct davinci_rtc *rtc = (struct davinci_rtc *)RTC_BASE; in rtc32k_enable() local
[all …]

12345678910>>...28