Extend laurent driver, allowing using a relay to control USB circuits.
For example, the relay might be connected to the DIP switch on RB1 / RB2
boards.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Don't make PPPS path exclusive to the driver USB control. Allow both to
be used at the same time in case the setup uses both PPPS-hubs and
driver-specific control.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
If cdba is run with "-t 0", then disable the timeout completely and keep
running until manually interrupted. This is useful for non-shared boards,
e.g. when cdba is just used to power up the board remotely and you then SSH
into a standard Linux distro installed on the board.
cdba is mainly intended for remote usage, but it also works well for
controlling devices that you just need occasionally and then directly
connect to your local laptop instead of a remote server.
Another use case is if you just use cdba to power up a standard distro on a
remote board and then SSH into it remotely. To avoid interruptions, it's
better to start cdba locally on the server in a tmux session. That way,
temporary disconnections do not power down the board.
From a protocol perspective, everything is transferred through STDIN and
STDOUT. It makes no difference if we have ssh piping the data to a remote
server, or if the data is directly passed to the cdba-server binary started
locally. The functionality works exactly the same.
Add an option for this in the cdba client. If the -h <host> option is
omitted, cdba-server is started locally.
The <boot.img> option is optional in cdba. If omitted, cdba falls back to
falls back to running "fastboot continue" to boot the installed operating
system.
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.
"patternProperties" must be on the same indentation level as "properties",
otherwise it just defines a property called "patternProperties" in
cdba.yaml.
Also add additionalProperties: false, so properties not matching the regex
are actually disallowed and reported.
Add special keys to allow triggering power and fastboot key presses from
the cdba client. There is an option to send a short key "pulse" (press
followed by release after 100ms) or to press/release keys separately:
- ctrl+a -> o: Send power key pulse
- ctrl+a -> O: Toggle power key (first use: press, next use: release)
- ctrl+a -> f: Send fastboot key pulse
- ctrl+a -> F: Toggle fastboot key (first use: press, next use: release)
In most cases you want to send the "pulse" (short key press), so it's
helpful to have this mapped to a single key. This avoids forgetting to
release the key again after pressing it.
The protocol between CDBA client and server is:
(MSG_KEY_PRESS <key:u8, state:u8>)
where key is either DEVICE_KEY_FASTBOOT (0) or DEVICE_KEY_POWER (1)
and state is either KEY_PRESS_RELEASE (0), KEY_PRESS_PRESS (1) or
KEY_PRESS_PULSE (2).
The reason for implementing the "pulse" on the server side is that it's
hard to guarantee the timing on the client side. We don't know exactly when
the packets will arrive on the server. Also, "state" is a full byte anyway,
so might as well use some of the extra bits. :-)
Some build configurations are switching to 64-bit time_t, breaking
builds on 32-bit architectures. Always use %lld and perform an explicit
conversion to (long long int) in order to make the code compile on all
architectures.
../status.c: In function 'status_send_values':
../status.c:46:53: error: format '%ld' expects argument of type 'long int', but argument 4 has type '__time64_t' {aka 'long long int'} [-Werror=format=]
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Ubuntu Mantic has been removed from the mirros, drop it from the CI
workflow. At the same time add new Ubuntu Oracular release.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
The purpose for providing different exit codes (2 vs 110) for timeout
before or after fastboot was to allow tools invoking cdba to detect if
the device arrived at and performed fastboot or not.
In most cases relying on the fastboot (USB) disconnect notification
works fine, but in cases where the provided image fails to decompress
the standard fastboot implementation will OKAY the transfer, fail to
process the image and then return to process further fastboot requests.
This has been observed in cases where the image is too big, or when it
contains a big endian kernel.
Change the logic to rely on the "FASTBOOT_DOWNLOAD" response to
determine that we did reach fastboot and where able to upload the image
and then something happened - i.e. "there's a problem with the image" vs
"there's a setup problem".
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>