/u-boot/drivers/rtc/ |
A D | x1205.c | 88 int rtc_get(struct rtc_time *tm) in rtc_get() argument 100 tm->tm_sec = bcd2bin(buf[CCR_SEC]); in rtc_get() 101 tm->tm_min = bcd2bin(buf[CCR_MIN]); in rtc_get() 107 tm->tm_wday = buf[CCR_WDAY]; in rtc_get() 112 tm->tm_sec, tm->tm_min, tm->tm_hour, in rtc_get() 113 tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); in rtc_get() 118 int rtc_set(struct rtc_time *tm) in rtc_set() argument 124 tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday, in rtc_set() 125 tm->tm_hour, tm->tm_min, tm->tm_sec); in rtc_set() 127 buf[CCR_SEC] = bin2bcd(tm->tm_sec); in rtc_set() [all …]
|
A D | rv8803.c | 45 tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday, in rv8803_rtc_set() 46 tm->tm_hour, tm->tm_min, tm->tm_sec); in rv8803_rtc_set() 48 if (tm->tm_year < 2000 || tm->tm_year > 2099) in rv8803_rtc_set() 52 buf[RTC_MON_REG_ADDR] = bin2bcd(tm->tm_mon); in rv8803_rtc_set() 55 buf[RTC_HR_REG_ADDR] = bin2bcd(tm->tm_hour); in rv8803_rtc_set() 56 buf[RTC_MIN_REG_ADDR] = bin2bcd(tm->tm_min); in rv8803_rtc_set() 57 buf[RTC_SEC_REG_ADDR] = bin2bcd(tm->tm_sec); in rv8803_rtc_set() 96 tm->tm_yday = 0; in rv8803_rtc_get() 97 tm->tm_isdst = 0; in rv8803_rtc_get() 100 tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday, in rv8803_rtc_get() [all …]
|
A D | s35392a.c | 134 if ((tm->tm_year < 2000) || (tm->tm_year > 2099)) in validate_time() 137 if ((tm->tm_mon < 1) || (tm->tm_mon > 12)) in validate_time() 140 if ((tm->tm_mday < 1) || (tm->tm_mday > 31)) in validate_time() 143 if ((tm->tm_wday < 0) || (tm->tm_wday > 6)) in validate_time() 146 if ((tm->tm_hour < 0) || (tm->tm_hour > 23)) in validate_time() 149 if ((tm->tm_min < 0) || (tm->tm_min > 59)) in validate_time() 152 if ((tm->tm_sec < 0) || (tm->tm_sec > 59)) in validate_time() 223 tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday, in s35392a_rtc_get() 224 tm->tm_hour, tm->tm_min, tm->tm_sec); in s35392a_rtc_get() 237 tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday, in s35392a_rtc_set() [all …]
|
A D | pcf2127.c | 58 buf[i++] = bin2bcd(tm->tm_sec); in pcf2127_rtc_set() 59 buf[i++] = bin2bcd(tm->tm_min); in pcf2127_rtc_set() 60 buf[i++] = bin2bcd(tm->tm_hour); in pcf2127_rtc_set() 61 buf[i++] = bin2bcd(tm->tm_mday); in pcf2127_rtc_set() 62 buf[i++] = tm->tm_wday & 0x07; in pcf2127_rtc_set() 65 buf[i++] = bin2bcd(tm->tm_mon); in pcf2127_rtc_set() 94 if (tm->tm_year < 1970) in pcf2127_rtc_get() 97 tm->tm_yday = 0; in pcf2127_rtc_get() 98 tm->tm_isdst = 0; in pcf2127_rtc_get() 101 tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday, in pcf2127_rtc_get() [all …]
|
A D | pl031.c | 64 static int pl031_get(struct udevice *dev, struct rtc_time *tm) in pl031_get() argument 68 if (!tm) in pl031_get() 73 rtc_to_tm(tim, tm); in pl031_get() 76 tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday, in pl031_get() 77 tm->tm_hour, tm->tm_min, tm->tm_sec); in pl031_get() 85 static int pl031_set(struct udevice *dev, const struct rtc_time *tm) in pl031_set() argument 89 if (!tm) in pl031_set() 93 tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday, in pl031_set() 94 tm->tm_hour, tm->tm_min, tm->tm_sec); in pl031_set() 97 tim = rtc_mktime(tm); in pl031_set()
|
A D | m41t62.c | 77 tm->tm_wday = buf[M41T62_REG_WDAY] & 0x07; in m41t62_update_rtc_time() 87 tm->tm_sec, tm->tm_min, tm->tm_hour, in m41t62_update_rtc_time() 88 tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); in m41t62_update_rtc_time() 94 tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday, in m41t62_set_rtc_buf() 95 tm->tm_hour, tm->tm_min, tm->tm_sec); in m41t62_set_rtc_buf() 125 m41t62_update_rtc_time(tm, buf); in m41t62_rtc_get() 139 m41t62_set_rtc_buf(tm, buf); in m41t62_rtc_set() 318 int rtc_get(struct rtc_time *tm) in rtc_get() argument 323 m41t62_update_rtc_time(tm, buf); in rtc_get() 328 int rtc_set(struct rtc_time *tm) in rtc_set() argument [all …]
|
A D | rtc-lib.c | 38 void rtc_to_tm(u64 time, struct rtc_time *tm) in rtc_to_tm() argument 46 tm->tm_wday = (days + 4) % 7; in rtc_to_tm() 56 tm->tm_year = year; /* Not year - 1900 */ in rtc_to_tm() 57 tm->tm_yday = days + 1; in rtc_to_tm() 67 tm->tm_mon = month + 1; /* January = 1 */ in rtc_to_tm() 68 tm->tm_mday = days + 1; in rtc_to_tm() 70 tm->tm_hour = secs / 3600; in rtc_to_tm() 71 secs -= tm->tm_hour * 3600; in rtc_to_tm() 72 tm->tm_min = secs / 60; in rtc_to_tm() 73 tm->tm_sec = secs - tm->tm_min * 60; in rtc_to_tm() [all …]
|
A D | m41t94.c | 36 int rtc_set(struct rtc_time *tm) in rtc_set() argument 51 buf[M41T94_REG_SECONDS] = bin2bcd(tm->tm_sec); in rtc_set() 52 buf[M41T94_REG_MINUTES] = bin2bcd(tm->tm_min); in rtc_set() 53 buf[M41T94_REG_HOURS] = bin2bcd(tm->tm_hour); in rtc_set() 55 buf[M41T94_REG_DAY] = bin2bcd(tm->tm_mday); in rtc_set() 56 buf[M41T94_REG_MONTH] = bin2bcd(tm->tm_mon + 1); in rtc_set() 59 if (tm->tm_year >= 100) in rtc_set() 61 buf[M41T94_REG_YEAR] = bin2bcd(tm->tm_year % 100); in rtc_set() 68 int rtc_get(struct rtc_time *tm) in rtc_get() argument 105 tm->tm_hour = bcd2bin(hour & 0x3f); in rtc_get() [all …]
|
A D | ds1307.c | 218 tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday, in ds1307_rtc_set() 219 tm->tm_hour, tm->tm_min, tm->tm_sec); in ds1307_rtc_set() 221 if (tm->tm_year < 1970 || tm->tm_year > 2069) in ds1307_rtc_set() 225 buf[RTC_MON_REG_ADDR] = bin2bcd(tm->tm_mon); in ds1307_rtc_set() 228 buf[RTC_HR_REG_ADDR] = bin2bcd(tm->tm_hour); in ds1307_rtc_set() 229 buf[RTC_MIN_REG_ADDR] = bin2bcd(tm->tm_min); in ds1307_rtc_set() 230 buf[RTC_SEC_REG_ADDR] = bin2bcd(tm->tm_sec); in ds1307_rtc_set() 304 tm->tm_yday = 0; in ds1307_rtc_get() 305 tm->tm_isdst = 0; in ds1307_rtc_get() 308 tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday, in ds1307_rtc_get() [all …]
|
A D | stm32_rtc.c | 67 static int stm32_rtc_get(struct udevice *dev, struct rtc_time *tm) in stm32_rtc_get() argument 75 tm->tm_sec = bcd2bin((tr & STM32_RTC_SEC) >> STM32_RTC_SEC_SHIFT); in stm32_rtc_get() 81 tm->tm_year = 2000 + in stm32_rtc_get() 84 tm->tm_yday = 0; in stm32_rtc_get() 85 tm->tm_isdst = 0; in stm32_rtc_get() 88 tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday, in stm32_rtc_get() 89 tm->tm_hour, tm->tm_min, tm->tm_sec); in stm32_rtc_get() 181 tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday, in stm32_rtc_set() 182 tm->tm_hour, tm->tm_min, tm->tm_sec); in stm32_rtc_set() 184 if (tm->tm_year < 2000 || tm->tm_year > 2099) in stm32_rtc_set() [all …]
|
A D | ds3232.c | 146 if (tm->tm_year < 1900 || tm->tm_year > 2099) in ds3232_rtc_set() 149 is_century = (tm->tm_year >= 2000) ? 0x80 : 0; in ds3232_rtc_set() 151 buf[RTC_SEC_REG_ADDR] = bin2bcd(tm->tm_sec); in ds3232_rtc_set() 152 buf[RTC_MIN_REG_ADDR] = bin2bcd(tm->tm_min); in ds3232_rtc_set() 153 buf[RTC_HR_REG_ADDR] = bin2bcd(tm->tm_hour); in ds3232_rtc_set() 154 buf[RTC_DAY_REG_ADDR] = bin2bcd(tm->tm_wday + 1); in ds3232_rtc_set() 155 buf[RTC_DATE_REG_ADDR] = bin2bcd(tm->tm_mday); in ds3232_rtc_set() 190 tm->tm_hour = bcd2bin(buf[RTC_HR_REG_ADDR]); in ds3232_rtc_get() 195 tm->tm_year = bcd2bin(buf[RTC_YR_REG_ADDR]) in ds3232_rtc_get() 197 tm->tm_yday = 0; in ds3232_rtc_get() [all …]
|
A D | rx8010sj.c | 124 if ((tm->tm_year < 2000) || (tm->tm_year > 2099)) in validate_time() 127 if ((tm->tm_mon < 1) || (tm->tm_mon > 12)) in validate_time() 130 if ((tm->tm_mday < 1) || (tm->tm_mday > 31)) in validate_time() 133 if ((tm->tm_wday < 0) || (tm->tm_wday > 6)) in validate_time() 136 if ((tm->tm_hour < 0) || (tm->tm_hour > 23)) in validate_time() 139 if ((tm->tm_min < 0) || (tm->tm_min > 59)) in validate_time() 142 if ((tm->tm_sec < 0) || (tm->tm_sec > 59)) in validate_time() 256 ret = validate_time(tm); in rx8010sj_rtc_set() 313 int rtc_get(struct rtc_time *tm) in rtc_get() argument 319 return rx8010sj_rtc_get(&dev, tm); in rtc_get() [all …]
|
A D | rv3029.c | 99 tm->tm_hour = bcd2bin(_hr & 0x1f); in rv3029_rtc_get() 101 tm->tm_hour += 12; in rv3029_rtc_get() 104 tm->tm_hour = bcd2bin(_hr & 0x3f); in rv3029_rtc_get() 114 tm->tm_yday = 0; in rv3029_rtc_get() 115 tm->tm_isdst = 0; in rv3029_rtc_get() 118 __func__, tm->tm_year, tm->tm_mon, tm->tm_mday, in rv3029_rtc_get() 119 tm->tm_wday, tm->tm_hour, tm->tm_min, tm->tm_sec); in rv3029_rtc_get() 129 __func__, tm->tm_year, tm->tm_mon, tm->tm_mday, in rv3029_rtc_set() 130 tm->tm_wday, tm->tm_hour, tm->tm_min, tm->tm_sec); in rv3029_rtc_set() 133 if (tm->tm_year < 2000) { in rv3029_rtc_set() [all …]
|
A D | ds1374.c | 82 int rtc_get (struct rtc_time *tm){ in rtc_get() argument 118 rtc_to_tm(time1, tm); /* To Gregorian Date */ in rtc_get() 126 tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday, in rtc_get() 127 tm->tm_hour, tm->tm_min, tm->tm_sec); in rtc_get()
|
/u-boot/post/drivers/ |
A D | rtc.c | 123 tm.tm_hour = 23; in rtc_post_test() 124 tm.tm_min = 59; in rtc_post_test() 125 tm.tm_sec = 59; in rtc_post_test() 128 rtc_set (&tm); in rtc_post_test() 138 rtc_get (&tm); in rtc_post_test() 151 tm.tm_year = yl; in rtc_post_test() 154 tm.tm_hour = 23; in rtc_post_test() 155 tm.tm_min = 59; in rtc_post_test() 156 tm.tm_sec = 59; in rtc_post_test() 160 rtc_set (&tm); in rtc_post_test() [all …]
|
/u-boot/drivers/ddr/marvell/a38x/ |
A D | mv_ddr_topology.c | 60 if (tm->cfg_src == MV_DDR_CFG_SPD) { in mv_ddr_topology_map_update() 62 val = mv_ddr_spd_dev_type_get(&tm->spd_data); in mv_ddr_topology_map_update() 69 if (mv_ddr_spd_timing_calc(&tm->spd_data, tm->timing_data) > 0) { in mv_ddr_topology_map_update() 81 tm->bus_act_mask = mv_ddr_bus_bit_mask_get(); in mv_ddr_topology_map_update() 130 if (tm->twin_die_combined == COMBINED) { in mv_ddr_topology_map_update() 151 if (tm->cfg_src == MV_DDR_CFG_SPD) { in mv_ddr_bus_bit_mask_get() 184 switch (tm->bus_act_mask) { in mv_ddr_if_bus_width_get() 244 if (tm->ck_delay) in mv_ddr_ck_delay_get() 245 return tm->ck_delay; in mv_ddr_ck_delay_get() 271 VALIDATE_BUS_ACTIVE(tm->bus_act_mask, i); in mv_ddr_mem_sz_per_cs_get() [all …]
|
A D | ddr3_training.c | 193 if (tm->interface_params[0]. in ddr3_tip_pad_inv() 376 tm->interface_params[if_id]. in hws_ddr3_tip_init_controller() 388 tm->interface_params[if_id]. in hws_ddr3_tip_init_controller() 476 (tm->interface_params[if_id]. in hws_ddr3_tip_init_controller() 485 tm->interface_params[if_id]. in hws_ddr3_tip_init_controller() 514 tm->interface_params[if_id]. in hws_ddr3_tip_init_controller() 517 tm->interface_params[if_id]. in hws_ddr3_tip_init_controller() 1296 tm->interface_params[if_id]. in ddr3_tip_freq_set() 1781 tm->interface_params[if_id]. in ddr3_tip_write_cs_result() 2292 freq_tbl[tm-> in ddr3_tip_ddr3_training_main_flow() [all …]
|
A D | ddr3_training_pbs.c | 59 VALIDATE_IF_ACTIVE(tm->if_act_mask, if_id); in ddr3_tip_pbs() 82 tm->if_act_mask, init_val, iterations, in ddr3_tip_pbs() 87 VALIDATE_BUS_ACTIVE(tm->bus_act_mask, pup); in ddr3_tip_pbs() 89 VALIDATE_IF_ACTIVE(tm->if_act_mask, if_id); in ddr3_tip_pbs() 100 VALIDATE_BUS_ACTIVE(tm->bus_act_mask, pup); in ddr3_tip_pbs() 176 VALIDATE_BUS_ACTIVE(tm->bus_act_mask, pup); in ddr3_tip_pbs() 178 VALIDATE_IF_ACTIVE(tm->if_act_mask, if_id); in ddr3_tip_pbs() 212 tm->if_act_mask, init_val, in ddr3_tip_pbs() 335 VALIDATE_BUS_ACTIVE(tm->bus_act_mask, pup); in ddr3_tip_pbs() 522 tm->if_act_mask, in ddr3_tip_pbs() [all …]
|
A D | ddr3_debug.c | 37 ddr3_hws_set_log_level(block, tm->debug_level); in mv_ddr_user_log_level_set() 122 VALIDATE_IF_ACTIVE(tm->if_act_mask, if_id); in ddr3_tip_reg_dump() 136 VALIDATE_IF_ACTIVE(tm->if_act_mask, if_id); in ddr3_tip_reg_dump() 307 print_topology(tm); in print_device_info() 377 VALIDATE_IF_ACTIVE(tm->if_act_mask, if_id); in ddr3_tip_print_log() 521 VALIDATE_IF_ACTIVE(tm->if_act_mask, if_id); in ddr3_tip_print_stability_log() 540 VALIDATE_IF_ACTIVE(tm->if_act_mask, if_id); in ddr3_tip_print_stability_log() 876 VALIDATE_BUS_ACTIVE(tm->bus_act_mask, j); in print_adll() 892 VALIDATE_BUS_ACTIVE(tm->bus_act_mask, j); in print_ph() 978 (tm->if_act_mask, in ddr3_tip_run_sweep_test() [all …]
|
/u-boot/lib/ |
A D | date.c | 36 if (tm->tm_year < 1753) in rtc_calc_weekday() 38 last_year = tm->tm_year - 1; in rtc_calc_weekday() 49 if (tm->tm_year % 4 == 0 && in rtc_calc_weekday() 50 ((tm->tm_year % 100 != 0) || (tm->tm_year % 400 == 0)) && in rtc_calc_weekday() 51 tm->tm_mon > 2) { in rtc_calc_weekday() 59 tm->tm_mday; in rtc_calc_weekday() 60 tm->tm_wday = day % 7; in rtc_calc_weekday() 83 int mon = tm->tm_mon; in rtc_mktime() 84 int year = tm->tm_year; in rtc_mktime() 96 hours = days * 24 + tm->tm_hour; in rtc_mktime() [all …]
|
/u-boot/board/ge/common/ |
A D | ge_rtc.c | 15 struct rtc_time tm; in check_time() local 25 ret = dm_rtc_get(dev, &tm); in check_time() 30 if (!ret && tm.tm_year > 2037) { in check_time() 31 tm.tm_sec = 0; in check_time() 32 tm.tm_min = 0; in check_time() 33 tm.tm_hour = 0; in check_time() 34 tm.tm_mday = 1; in check_time() 35 tm.tm_wday = 2; in check_time() 36 tm.tm_mon = 1; in check_time() 37 tm.tm_year = 2036; in check_time() [all …]
|
/u-boot/cmd/ |
A D | date.c | 36 struct rtc_time tm; in do_date() local 74 rcode = dm_rtc_get(dev, &tm); in do_date() 76 rcode = rtc_get(&tm); in do_date() 80 if (mk_date(argv[1], &tm) != 0) { in do_date() 86 rcode = dm_rtc_set(dev, &tm); in do_date() 88 rcode = rtc_set(&tm); in do_date() 101 rcode = dm_rtc_get(dev, &tm); in do_date() 103 rcode = rtc_get(&tm); in do_date() 111 tm.tm_year, tm.tm_mon, tm.tm_mday, in do_date() 112 (tm.tm_wday<0 || tm.tm_wday>6) ? in do_date() [all …]
|
/u-boot/net/ |
A D | sntp.c | 61 struct rtc_time tm; in sntp_handler() local 75 rtc_to_tm(ntohl(seconds) - 2208988800UL + net_ntp_time_offset, &tm); in sntp_handler() 84 dm_rtc_set(dev, &tm); in sntp_handler() 86 rtc_set(&tm); in sntp_handler() 89 tm.tm_year, tm.tm_mon, tm.tm_mday, in sntp_handler() 90 tm.tm_hour, tm.tm_min, tm.tm_sec); in sntp_handler()
|
/u-boot/lib/efi_selftest/ |
A D | efi_selftest_rtc.c | 45 struct efi_time tm, tm_new = { in execute() local 71 ret = runtime->get_time(&tm, NULL); in execute() 76 if (tm.year != tm_new.year || in execute() 77 tm.month != tm_new.month || in execute() 78 tm.day != tm_new.day || in execute() 79 tm.hour != tm_new.hour || in execute() 80 tm.minute != tm_new.minute || in execute() 81 tm.second < tm_new.second || in execute() 82 tm.second > tm_new.second + 2) { in execute()
|
/u-boot/lib/efi_loader/ |
A D | efi_runtime.c | 244 struct rtc_time tm; in efi_get_time_boottime() local 266 time->day = tm.tm_mday; in efi_get_time_boottime() 270 if (tm.tm_isdst > 0) in efi_get_time_boottime() 273 else if (!tm.tm_isdst) in efi_get_time_boottime() 333 struct rtc_time tm; in efi_set_time_boottime() local 348 memset(&tm, 0, sizeof(tm)); in efi_set_time_boottime() 351 tm.tm_mday = time->day; in efi_set_time_boottime() 357 tm.tm_isdst = 0; in efi_set_time_boottime() 360 tm.tm_isdst = 1; in efi_set_time_boottime() 363 tm.tm_isdst = -1; in efi_set_time_boottime() [all …]
|