1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright 2017 General Electric Company
17 unsigned int current_i2c_bus = i2c_get_bus_num();
19 ret = i2c_set_bus_num(CONFIG_SYS_RTC_BUS_NUM);
21 env_set("rtc_status", "FAIL");
27 for (i = 0; i < retry; i++) {
29 if (!ret || ret == -EINVAL)
33 if (!ret && tm.tm_year > 2037) {
42 for (i = 0; i < retry; i++) {
53 env_set("rtc_status", "FAIL");
55 env_set("rtc_status", "2038");
57 env_set("rtc_status", "OK");
59 i2c_set_bus_num(current_i2c_bus);