it8xxx2: don't set system reset flags directly
it8xxx2: don't set system reset flags directly

The get_reset_cause method of the cros_system driver is meant to only
return the cause. Setting the system reset flags directly there (rather
than allowing the caller to adjust them) is incorrect and causes
confusing behavior like reporting multiple mutually-incompatible reset
causes in `sysinfo` command output.

The tests for causes are reordered to return the "most fundamental"
reset event that could have occurred, preferring power-on then reset pin
then watchdog. It's not generally possible to determine which reset
actually occurred because the registers appear to only be cleared when
written by software, so this assumes that a set bit indicates a reset of
that form occurred and hasn't yet been noted by the firmware.

The twiddling of the watchdog bit is removed from the function
completely, since it didn't do anything: system_set_reset_flags will
only set bits in the flags, so attempting to clear
EC_RESET_FLAG_WATCHDOG had no effect.

BUG=b:227972919
TEST=Reset causes on Nereid now correctly reflect the actual last reset
     in sysinfo command output and do not indicate multiple causes.
BRANCH=none

Change-Id: I28fd125dfb476ba451c07622478345dd3b61f3cd
Signed-off-by: Peter Marheine <ef0b2c492edde94778d7465bfbaeed52c5be6858@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3606030
Reviewed-by: Dino Li <00c808bcd0610e8dd73a10880490949c0c589d41@ite.corp-partner.google.com>
Reviewed-by: Andrew McRae <44ad1424cfc8411c96d9181798ca41ae55709dfb@google.com>

coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec