Commit Graph

99 Commits

Author SHA1 Message Date
Neil Armstrong
4f4f1704bb Add generic ftdi GPIO backend
This permits driving a board controlled by GPIOs on an FTDI
interface.

Also add a sample 99-libftdi.rules to permit using the FTDI device.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2023-01-30 16:00:46 -06:00
Bjorn Andersson
ffc91a6bf2 cdba-shell: Add some simple scripts for user maintenance
Introduce some scripts to allow storing users public keys in a git and
some hooks such that when this is pushed to the server the
authorized_keys file is re-generated.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2022-08-18 23:07:40 -05:00
Dmitry Baryshkov
42f8108e7c cdba-server: notify users when fastboot connection is opened
Notify users of cdba-server when fastboot connection is opened to ease
remote debugging of issues.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
2022-02-08 09:09:13 -08:00
Dmitry Baryshkov
961792677a device: notify before booting the board
Transfering the image to cdba server takes time (especially when working
with over the network). Notify users before actually booting the board
to ease detecting early boot issues.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
2022-02-08 09:09:13 -08:00
Bjorn Andersson
6fbc50ca58 device: Hack around EPERM issue
Opening the lock files fails on one of my boards if the files exists and
are owned by someone else, if O_CREAT is set. This doesn't make sense,
but hack around it for now by first creating the file if it's not there,
ignoring any errors and then just opening it O_RDONLY.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-05 10:41:48 -07:00
Bjorn Andersson
af03ecd94f qcomlt_dbg: Silence debug prints
Comment out some leftover debug prits in the QcomLT Debugboard support
code.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-03-02 12:15:45 -06:00
Bjorn Andersson
983ec44099 cdba: Support specifying cdba-server path
For debug purposes it's useful to install a user-local version of the
cdba-server and invoke this instead, rather then having to change the
code add a flag to support specifying this on the command line.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-02-22 11:04:09 -06:00
Bjorn Andersson
3004fdf68d device: Reintroduce the alpaca "keep-usb-on" feature
For some reason the SC8180x Primus often fails to detect the attached
USB stick if USB is toggled as part of a power cycle, so let's continue
to support the property of not toggling it.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-02-22 11:02:57 -06:00
Bjorn Andersson
7c231568aa cdba-server: Don't close what wasn't opened
In the case that we quit without actually having opened a device this
would dereference a NULL pointer, so check the device before doing so.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-01-25 18:49:21 -06:00
Bjorn Andersson
c43466a98f device: Invoke device->close on exit
Allow the control device to implement things such as flushing the
command buffer as part of the close operation. This used to be done to
ensure that any lingering power/usb off requests really where sent to
the device as we closed the control tty.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-01-25 18:48:04 -06:00
Bjorn Andersson
2ab5051cde alpaca: Drop forgotten fastboot_key function
The fastboot_key function is no longer used, drop the remains in the
alpaca implementation.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-01-25 18:47:11 -06:00
Bjorn Andersson
840b737c14 cdba-server: Disconnect USB as well on exit
As cdba-server exits it turns off power, which used to cut VBUS as well,
but since the refactoring only cuts power. Reintroduce the VBUS toggle
to ensure the device doesn't stay powered through USB after use.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-01-25 17:32:07 -06:00
Bjorn Andersson
7b89bf40ec qcomlt_debug: Introduce support for the QcomLT debug board
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-01-22 19:57:37 -06:00
Bjorn Andersson
d947ca9d46 device: Move alpaca power key state machine to device
The power key dance is useful outside of alpaca, move it to device and
modify the device interface to better suite this.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-01-22 19:57:14 -06:00
Bjorn Andersson
1abac8b200 device: Combine power_on/power_off througout
Squash the power_on and power_off into a single "power" function, to
harmonize the code wrt the USB handling.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-01-22 18:52:03 -06:00
Bjorn Andersson
4913b8b1c7 cdb_assist: Remove remnants of PSHOLD based shutdown
Some ancient device needed us to pull PSHOLD to trigger the shutdown,
but most of the code is lost, so clean out the last pieces until the
need comes up again.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-01-22 18:27:01 -06:00
Bjorn Andersson
3921fcb8a3 cdb_assist: Drop all the USB magic
All modern systems will properly populate /dev/serial/by-id with links
to the CDB Assist control and target tty, that includes the serial
number in the name.

So there's no reason to keep the complex code that scans for the two
devices by serial number around.

Switch the parameter of "cdb_assist" to be the path of the control tty
and rely on "console" for the "terminal" tty.

Naturally this breaks existing config files.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-01-22 18:13:38 -06:00
Bjorn Andersson
032a43b7ee conmux: Use "control_dev" instead of "cdb_serial"
It seems more suitable to use the "control_dev" to denote the target
conmux than "cdb_serial". Further more this makes it possible drop the
"cdb_serial" member in an upcoming commit.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-01-22 18:07:26 -06:00
Bjorn Andersson
87ad99ecf2 alpaca: Rename device member holding control device path
By renaming the "alpaca_dev" to "control_dev" is can be reused in the
other implementations as well.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-01-22 18:06:26 -06:00
Bjorn Andersson
776f8c30fb console: Add send_break support
Add support for send_break to the generic console implementation.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-01-22 18:04:58 -06:00
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