Commit Graph

79 Commits

Author SHA1 Message Date
Bjorn Andersson
e685d367bc alpaca: Add configuration for keeping USB always connected
USB on the Primus acts up when we toggle USB in Alpaca, so add a
configuration option to force it on at all times.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-01-22 17:26:17 -06:00
Dmitry Baryshkov
dde2030cda cdba: allow specifying symlink as a boot file
cdba will choke with 'is not a regular file' message if one specifies
symlink as a boot file argument. Support using symlinks as a boot file.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
2021-01-21 08:56:58 -08:00
Dmitry Baryshkov
aac4562cfc README: document last changes
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2020-11-16 14:19:49 -06:00
Dmitry Baryshkov
b626f41185 device: support working in non-automated setup
Make device power controller optional, allowing one to use cdba in
non-automated setup (just simplifying the fastboot + console handling).

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
[bjorn: Rebased the patch onto master, reversed the logic in power_on/off]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-11-16 14:19:07 -06:00
Bjorn Andersson
5eac176fb5 alpaca: Implement power on sequence using watch timers
Instead of sleeping during the power on sequence and hence blocking e.g.
log output, use the newly introduced timers.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-10-29 23:44:25 -05:00
Bjorn Andersson
decff00617 cdba-server: Change watch timers to ms
In order to sleep for fractions of a second in alpaca, change the
timeout from seconds to milliseconds.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-10-29 23:44:18 -05:00
Bjorn Andersson
0fabe029ba alpaca: Use the new fastboot_key handling
There are cases where holding the fastboot key for too long will cause
the attached device to reset. So rather than holding the fastboot key
until fastboot arrives use the newly introduced common fastboot
handling.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-10-29 18:24:32 -05:00
Bjorn Andersson
b0172bae3a cdb_assist: Allow non-cdb-assist ACM devices in the system
In the event that the system contains ACM devices that are not CDB
Assist these won't be either control nor target devices. So don't err
out on this.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-10-29 18:21:58 -05:00
Bjorn Andersson
ed11fe16ff cdb_assist: Rely on the generic fastboot key handling
The generic device code will now request toggling of the fastboot key
based on the device's configuration, so remove the hard coded
invocation.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-10-29 18:20:39 -05:00
Bjorn Andersson
7dbd49c4d2 device: Add fastboot_key_timeout
Make the fastboot key handling a property of the device configuration
and use the newly introduced timeout mechanism for handling it.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-10-29 18:18:56 -05:00
Bjorn Andersson
b823fa0172 cdba-server: Add support for oneshot timers
It's useful to be able to invoke some operation in the future, such as
releasing a key. Add support for registering and executing callbacks in
the future.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-10-29 18:17:43 -05:00
Bjorn Andersson
0d7ff9e782 alpaca: Hold volume down during boot
For some devices to reliably boot into fastboot mode volume down needs
to be held, so do this as we power on the device and release it as
fastboot appears.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-10-19 11:59:19 -05:00
Dmitry Baryshkov
793969b11d device: split console_fd handling away
Split console_fd handling to a separate source file to simplify
device.c.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2020-09-28 10:27:18 -05:00
Dmitry Baryshkov
a2d9cb9969 fastboot: enumerate devices on start
If fastboot device is already present when starting cdba, cdba may miss
it. So enumerate usb devices via libudev to look for fastboot device
node.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2020-09-28 10:26:18 -05:00
Amit Kucheria
0ae34b601d Add cdba-server to make clean target
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
2020-08-06 07:03:16 -07:00
Bjorn Andersson
af3d516228 device_parser: Suppress error message on .cdba open failure
The error message indicating that cdba-server failed to open the config
file was supposed to be moved to cdba-server.c, but I forgot to remove
the error from the device_parser. Fix this.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-06-29 10:56:47 -07:00
Bjorn Andersson
b01431a83d cdba: Print "Waiting for ssh" only for boot
For list and info the "Waiting for ssh" message is anoying, remove it.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-06-29 01:14:02 -07:00
Bjorn Andersson
4cabc1c827 Support device "description"
Add a new keyword "description" to the config file, add the necessary
wire protocol to acquire this string for a given device and introduce
the "-i" option to cdba to trigger its retrieval.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-06-29 01:02:57 -07:00
Bjorn Andersson
4fee7ed011 cdba: Remove unused struct
I forgot to remove the board_list_request struct as I rewrote the code,
drop it now.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-06-29 00:59:39 -07:00
Bjorn Andersson
507f5b8bf3 device: Support device listing of devices without name
Some devices doesn't have a configured "name", don't print "(null)" in
this case.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-06-29 00:10:27 -07:00
Bjorn Andersson
afc61c7f6a cdba: Invoke cdba-server from $PATH
Rather than hard coding the server side path to
sandbox/cdba/cdba-server, just invoke cdba-server and rely on the server
side to have the tool in $PATH.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-06-29 00:07:16 -07:00
Bjorn Andersson
7589adbc45 Makefile: Add install target
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-06-29 00:07:16 -07:00
Bjorn Andersson
a2a11706df device_parser: Fall back to read /etc/cdba
After attempting to read .cdba, fall back to read /etc/cdba - to make it
possible to provide system wide configuration for a multiple users.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-06-29 00:07:16 -07:00
Bjorn Andersson
d094208e7c cdba: Add support for listing boards
Add a new argument '-l' which in combination with '-h' will connect to
said server and list the attached devices, then exit.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-06-28 23:47:56 -07:00
Bjorn Andersson
72c373451c cdba: Exit nicely on communication error
Receiving an invalid command should lead to termination of the client,
but doing so abruptly will cause the termios not to be reset.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-06-28 23:43:59 -07:00