8 int hour1
, minute1
, second1
;
9 int hour2
, minute2
, second2
;
12 printf("\tRTC test ");
14 diag_get_rtc_time(&hour1
, &minute1
, &second1
);
16 /* FIXME: Observation says RTC requires additional udelay(1) to
21 /* Set a time that changes all the digits after a second */
22 diag_set_rtc_time(9, 59, 59);
24 /* Wait for 1 second */
25 /* Observation says RTC takes additional one second when new time is set */
28 diag_get_rtc_time(&hour2
, &minute2
, &second2
);
34 /* Second should be 0 or max 1 (if error in udealy), not > 1 */
37 printf("\t\tGot: hour %02d minute %02d second %02d\n", hour2
, minute2
, second2
);
38 printf("\t\tExpected: hour 10 minute 00 second 00\n");
43 printf("\t\t\t\t\t PASSED\n");
46 /* As incrementing a second here will require complex calculation,
47 * we will ignore that passed second */
48 diag_set_rtc_time(hour1
, minute1
, second1
);