Files
OpenCellular/common
Randall Spangler a59ea3c4db ccd: Consolidate config commands
Previously, all CCD config commands were their own distinct commands.
This led to accidental side-effects when someone would type 'ccdlock'
thinking it would print the lock state when it would actually lock the
device.

Make them all sub-commands of 'ccd'.  So, 'ccd lock', not 'ccdlock'.
Just 'ccd' by itself will print the current config.

No changes to how the sub-commands themselves work.

BUG=b:65407395
BRANCH=cr50
TEST=manual with CR50_DEV=1 build
	gpioget # make sure GPIO_BATT_PRES_L=0

	ccd help # prints help

	ccd lock # lock, because CR50_DEV=1 builds start unlocked

	ccd # locked, flags=0, all capabilities default
	ccd pass # access denied (we're locked)
	ccd reset # access denied
	ccd set flashap always # access denied

	ccd unlock
	ccd # unlocked
	ccd pass foo
	ccd # flags=2 (password set when unlocked)
	ccd set flashap always # access denied
	ccd set uartectx unlesslocked
	ccd # yes, uartectx permission changed
	ccd lock

	ccd unlock # fails without password
	ccd unlock bar # wrong password
	ccd unlock foo # busy
	(wait 3 sec)
	ccd unlock foo
	ccd reset
	ccd # no password, flags 0, capabilities all default

	ccd open # requires physical presence; tap power or use 'pp'
	ccd set uartgsctxecrx unlesslocked
	ccd set batterybypasspp ifopened
	ccd pass baz
	ccd # password set, flag 0, ccdset changes worked

	ccd unlock
	ccd reset
	ccd # uartgsctxecrx back to ifopened, password still set

	ccd open baz # still requires physical presence
	ccd set opennolongpp always
	ccd lock
	ccd open baz # no pp required
	ccd set unlocknoshortpp unlesslocked
	ccd lock
	ccd open baz # short pp sequence required (3 taps)
	ccd lock
	ccd unlock baz # short pp sequence required
	ccd open baz # pp not required
	ccd set unlocknoshortpp always
	ccd lock

	ccd testlab open # access denied
	ccd testlab enable # access denied
	ccd unlock baz
	ccd testlab open # access denied
	ccd testlab enable # access denied
	ccd open baz
	ccd testlab enable # requires short pp
	ccd # flags 1

	ccd reset
	ccd # no password, flags=1, caps all default
	ccd lock
	ccd testlab open
	ccd # opened
	ccd testlab disable # requires short pp; let it time out
	ccd # still opened, flags=1

	ccd lock
	ccd oops # backdoor in CR50_DEV images to force-reset CCD
	ccd # opened, flags=0, all defaults (yes, oops wipes out testlab)

	ccd reset rma
	ccd # flags = 0x400000, everything but GscFullConsole always
	ccd reset # back to flags=0, all default

Change-Id: Ib2905cb7cbeb79a7f4d0fb44151bfd53af361e2e
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/653719
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-09-06 19:12:57 -07:00
..
2017-08-29 19:37:05 -07:00
2017-06-28 23:23:41 -07:00
2017-09-06 19:12:57 -07:00
2015-05-19 02:46:27 +00:00
2017-07-28 17:45:13 -07:00
2016-11-15 17:41:53 -08:00
2017-08-12 22:58:43 -07:00
2015-09-25 09:13:34 -07:00
2016-03-02 13:39:47 -08:00
2017-08-29 19:37:05 -07:00
2017-06-02 10:38:57 -07:00
2014-05-17 20:14:17 +00:00
2016-03-21 16:35:33 -07:00
2017-05-09 23:20:07 -07:00
2017-08-10 22:47:24 -07:00
2017-08-23 12:19:07 -07:00