fastboot: Add capability support for different modes

Add support for allowing limited/full fastboot capability in firmware
depending upon the mode:
Normal mode - limited capability
Developer mode - limited capability if not explicitly requested by OS
(similar to dev_boot_usb)
Developer mode - full capability if explicitly requested by OS

Full capability means all supported fastboot commands can be issued to
the firmware. Limited capability means erase, flash and other commands
are not available in firmware. Firmware would allow use of getvar,
reboot, boot and poweroff commands only.

This patch adds support for the above mentioned capabilities. Fastboot
protocol handler will check if an issued command is allowed in the
current mode and only then execute it. Otherwise it would respond back
with "unsupported command" error message to the host.

CQ-DEPEND=CL:271410
BUG=chrome-os-partner:40196
BRANCH=None
TEST=Compiles successfully and allows full fastboot capability in
firmware only in developer mode when DEV_BOOT_FASTBOOT_FULL_CAP flag
is set or GBB flag for FORCE_DEV_BOOT_FASTBOOT_FULL_CAP is set.

Change-Id: Ic4da4e68c75fe90f9eee11b07e0803f43d9c6c03
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/271421
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
Trybot-Ready: Furquan Shaikh <furquan@chromium.org>
4 files changed