soc/dmp/vortex86: Fix CMOS read and random RTC reset

The array of CMOS values that was passed into the read routine was
never getting updated.  GCC 7.1 gives a warning on this:

error:  may be used uninitialized in this function

Change-Id: I2f7c9b6455761a38598467b001efb0603fd14c32
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/20700
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Martin Roth 2017-07-22 18:04:08 -06:00
parent ba973bd2de
commit 6c581bc43f
1 changed files with 3 additions and 3 deletions

View File

@ -457,14 +457,14 @@ static void read_cmos_rtc(u8 rtc[7])
{ {
/* Read RTC twice and check update-in-progress flag, to make /* Read RTC twice and check update-in-progress flag, to make
* sure RTC is correct */ * sure RTC is correct */
u8 rtc_old[7], rtc_new[7]; u8 rtc_new[7];
while (get_rtc_update_in_progress()) ; while (get_rtc_update_in_progress()) ;
unsafe_read_cmos_rtc(rtc_new); unsafe_read_cmos_rtc(rtc_new);
do { do {
memcpy(rtc_old, rtc_new, 7); memcpy(rtc, rtc_new, 7);
while (get_rtc_update_in_progress()) ; while (get_rtc_update_in_progress()) ;
unsafe_read_cmos_rtc(rtc_new); unsafe_read_cmos_rtc(rtc_new);
} while (memcmp(rtc_new, rtc_old, 7) != 0); } while (memcmp(rtc_new, rtc, 7) != 0);
} }
/* /*