Files
OpenCellular/include
Mary Ruthven 4692be2957 cr50: keep wp and console state through deep sleep
After every reboot, we were resetting the write protect and console
lock states back to default. With this change the wp and lock states
will be preserved through deep sleep. They will still be reset on any
other type of reboot (like Power On reset or panic).

The states are also cleared if the system detects a rollback even when
booting from the deep sleep.

With this patch it is going to be impossible to remove hardware write
protection guarding writes into AP and EC firmware flash, unless the
cr50 console is unlocked.

Locking the console would reinstate hardware write protection
automatically even if it was disabled when the console was unlocked.

Two long life scratch register 1 bits are used to keep the console and
write protect states over resets. To make code cleaner bitmap
assignments of the long life scratch register is put in its own
include file.

BUG=chrome-os-partner:58961
BRANCH=none
TEST=manual
	On prod/dev images verify that the default wp and console lock
	states are still correct.

	change the lock and write protect states from the default and
	verify they are preserved through deep sleep.

	reboot cr50 and make sure that they are reset.

	unlock the console and enable flash writes, then set fallback
	counter on cr50 to the value of 6 (rw 0x40000128 1; rw
	0x4000012c 6) and put the AP into deep sleep by hitting
	Alt-H-VolUp.

	In five minutes press the power button on the device to bring
	it back from s5. Observe cr50 fall back to an older image and
	console lock and wp disabled.

Change-Id: Ie7e62cb0b2eda49b04a592ee1d0903e83246b045
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/420812
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-21 00:43:38 -08:00
..
2016-05-26 16:17:26 -07:00
2016-11-15 17:41:53 -08:00
2015-11-08 07:59:40 -08:00
2016-12-13 23:49:39 -08:00
2015-06-18 19:07:00 +00:00
2015-06-18 19:07:00 +00:00
2015-07-27 22:19:16 +00:00
2015-06-10 18:24:05 +00:00
2015-05-27 03:58:16 +00:00
2016-04-27 14:04:07 -07:00
2015-05-27 03:58:16 +00:00
2016-09-07 14:01:18 -07:00
2016-11-08 17:11:28 -08:00
2015-10-07 17:51:36 -07:00
2016-07-29 10:51:22 -07:00
2015-06-18 19:07:00 +00:00
2016-12-05 16:43:18 -08:00
2015-06-18 19:07:00 +00:00
2015-06-18 19:07:00 +00:00
2016-11-15 17:41:53 -08:00
2015-12-21 14:58:54 -08:00
2016-11-08 17:11:28 -08:00
2016-07-11 21:27:46 -07:00
2015-09-16 14:49:46 -07:00
2015-06-18 19:07:00 +00:00
2016-11-02 17:39:56 -07:00
2015-01-20 20:56:43 +00:00