broadwell: Preserve VbNv around cmos_init

To ensure that boot flags (legacy, usb, signed-only) are
properly restored from CMOS and used in the first boot after
a battery removal or RTC reset then the VbNv region needs to
be preserved around the cmos_init call.

When using vboot firmware selection and VbNv is stored in CMOS
then that region of CMOS will have been re-initialized by the
time we call cmos_init and reset CMOS if the chipset flag was
set indicating a problem.

BUG=chrome-os-partner:35240, chrome-os-partner:49573
BRANCH=broadwell
TEST=manual testing on samus:
1) boot in dev mode, enable dev_boot_legacy and ensure it works
2) on EC console pulse PCH_RTCRST_L low for a second
3) ensure first boot after RTC reset will still boot legacy mode
4) remove battery for a time
5) ensure first boot after battery is re-inserted will still
boot legacy mode

Change-Id: I4c33f183ba4b301d68ae31c41fc6663f3be857b0
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/241529
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
(cherry picked from commit 881c7841c95dec392a66eef38a7112c1f385fdfa)
Reviewed-on: https://chromium-review.googlesource.com/331848
Commit-Queue: Ted Kuo <tedkuo@ami.com.tw>
Tested-by: Ted Kuo <tedkuo@ami.com.tw>
1 file changed