Commit Graph

25 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
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
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
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
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
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
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
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
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
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
e0dcdf1b53 device_parser: fix out of bounds write
accept() expects the passed "scalar" to be 256 bytes long, so passing
the 80 char key will cause an out-of-range write.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-06-28 23:24:23 -07:00
Bjorn Andersson
313780c7fd cdba-server: Make "console" handling generic
It's possible for devices that are automated using e.g. a CDB Assist to
have console coming over a separate FTDI USB tty. Move the alpaca
specific implementation of the "console" directive to device.c to make
it generic.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-06-27 22:54:53 -07:00
Bjorn Andersson
f068352970 cdba: Support sending break with CDB assist
Add special key 'B' to send a break, currently only implemented with the
CDB assist.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-08-26 10:10:49 -07:00
Bjorn Andersson
5da489beee device_parser: Increase max key/value length
When pointing alpaca to persistent named aliases in /dev/serial/by-id we
end up with > 80 chars of path in value, which gets nicely truncated.
Increase this max.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-12-05 17:14:35 -08:00
Bjorn Andersson
07b7d195fc bad: Introduce alpaca support
Introduce support for controlling boards using an alpaca interface.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-12-05 17:14:00 -08:00
Bjorn Andersson
2205666349 cdb_assist: Support togging the fastboot key
For some devices it's not possible to use fastboot boot and
as such they will not enter fastboot unless the fastboot key
is held. Expose this functionality in the device api.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-04-20 14:54:56 -07:00
Bjorn Andersson
6c5bd3c77e cdba: Add license header where missing
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-12 19:09:15 -07:00
Bjorn Andersson
aef9155588 device-parser: Replace hard coded list
Instead of requiring a compiled in list of devices read them from a yaml
file.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-12 19:09:15 -07:00