The newly introduced support for QDL-based remote flashing of devices is
powerful, but provides an easy way to alter shared boards in unwanted
ways.
Introduce an optional "qdl_access" entry to the device configuration,
which allows to specify a list of entries each one defining a set of
users and their accepted flash targets.
A special target "all" can be used to give e.g. administrators
unrestricted access to the flash.
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
The client can now request the device to enter EDL mode and the server's
device and driver model can power up the board to this state.
Introduce four new messages to the cdba protocol:
- EDL_PRESENT: used by the server to signal the presence of the EDL
device
- EDL_DOWNLOAD: used by the client to transfer a binary blob to the
server, mimicing the fastboot protocol
- EDL_WRITE: used by the client to indicate the target for the
downloaded binary blob. The server may start flashing the image if
supported.
- EDL_RESET: used by the client to request that the flash operations are
finalized and the board restarts.
Introduce a new "EDL" module that will look for EDL USB devices and if
found signal the client about its presence.
Implement EDL_DOWNLOAD by streaming the incoming blob into a temporary
file, let EDL_WRITE tag the image with information about where it should
be written. Then as we're relying on QDL, invoke the external tool as
part of the EDL_RESET, "flushing out" the pending operations.
Support for matching EDL device by serial number is left as a todo item.
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Some boards have more than one USB port. In that case, there is a second
GPIO on the debug board to simulate a USB disconnection for those.
Add the option to describe both USB disconnect GPIOs using
"usb0_disconnect" and "usb1_disconnect" and change both of them
when disabling USB power.
In the future it might be useful to control them separately, but for now
this ensures that power to the board is cut properly when the board is
powered off.