Add new NV and GBB flag to control UDC

This change adds a new NV and GBB flag for controlling USB device
mode behavior, adding an additional step to enable UDC on systems
that support it.

Users of this feature will need to first enable developer mode and
then enable UDC separately by running "crossystem dev_enable_udc=1".

Alternatively those without write protect enabled can set a GBB
flag to have UDC enabled by default while in developer mode.

This is based on the security reviewed proposal at

TEST=manual testing on Eve device

Change-Id: I6f440320f28b033639b53246d3034bc8acc37a33
Signed-off-by: Duncan Laurie <>
Reviewed-by: Randall Spangler <>
Reviewed-by: Furquan Shaikh <>
(cherry picked from commit 534194ead77895dd131ed59b968b21a2ae36f133)
7 files changed