2 * Copyright 2017 General Electric Company
4 * SPDX-License-Identifier: GPL-2.0+
17 unsigned int current_i2c_bus = i2c_get_bus_num();
19 ret = i2c_set_bus_num(CONFIG_SYS_RTC_BUS_NUM);
25 for (i = 0; i < retry; i++) {
27 if (!ret || ret == -EINVAL)
32 env_set("rtc_status", "RTC_ERROR");
34 if (tm.tm_year > 2037) {
43 for (i = 0; i < retry; i++) {
50 env_set("rtc_status", "RTC_ERROR");
53 i2c_set_bus_num(current_i2c_bus);