Commit Graph
282 Commits
Author SHA1 Message Date
Bjorn Andersson f08d673b01 meson: fix forkpty dependency detection
The forkpty check was compiled without including <pty.h>, which is
the header that declares the function. On stricter toolchains, and in
some cross builds, that can make Meson conclude that forkpty is not
available from libc even when the target provides it there.

The fallback then looked for a separate libutil as a required library.
That breaks modern glibc targets where forkpty moved into libc and no
separate libutil is available for Meson to find.

Include <pty.h> in the function probe so libc implementations are
detected correctly. Keep libutil as an optional compatibility fallback
for older targets that still need it, without failing configuration
when the separate library is absent.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
2026-07-05 18:29:05 +00:00
Bjorn Andersson 1bead0f004 drivers: initialize libgpiod v1 request config
Ubuntu noble still ships libgpiod 1.x, which selects the local-gpio v1
implementation. That path declared struct gpiod_line_request_config
without initializing the whole structure before passing it to libgpiod,
leaving padding or future fields undefined under stricter toolchains.

Zero-initialize the request configuration before filling the fields
cdba uses, matching the defensive style needed for older supported
distributions and newer compilers.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
2026-07-05 18:29:05 +00:00
Bjorn Andersson 2175378afe ci: install full Alpine build toolchain
The Alpine clang jobs fail during Meson compiler setup rather than
during source compilation. Installing clang alone does not guarantee
the complete native build environment needed for compiler sanity
checks, linking, and startup objects on Alpine.

Install build-base in the Alpine CI setup so both gcc and clang jobs
have the standard compiler, libc, binutils, and make toolchain expected
by Meson.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
2026-07-05 18:29:05 +00:00
Bjorn Andersson 3d788536e9 ci: use current libftdi package on Debian
Debian testing no longer provides the legacy libftdi-dev package used
by the CI install scripts. As a result, native, i386, and
cross-compile Debian testing jobs fail at apt install before the build
starts.

Install libftdi1-dev instead. The Meson build already prefers the
libftdi1 pkg-config dependency, so this matches the dependency that
the source is actually using.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
2026-07-05 18:29:05 +00:00
Bjorn Andersson 163aad04dd ci: drop EOL distro images
Several scheduled jobs are failing because the matrix still includes
release-specific container images for distributions that have reached
end of life. These images may still be pullable, but their package
repositories are no longer maintained in the normal location and can
fail during dependency installation.

Remove the EOL Debian buster, Ubuntu oracular, and fixed Fedora
release jobs. Keep rolling and moving targets such as debian:testing,
alpine:edge, and latest tags so CI continues to catch issues users
may see on active distributions.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
2026-07-05 18:29:04 +00:00
Bjorn Andersson c423029c61 ci: update checkout action for Node 24
GitHub Actions now warns that actions targeting Node.js 20 are
being forced to run on Node.js 24. The warning is emitted by
actions/checkout@v4 in every matrix job, which obscures the real
CI failures and will eventually become a hard compatibility problem
as Node 20 support is removed from runners.

Move to actions/checkout@v5 so the workflow uses an action version
that is compatible with the current runner JavaScript runtime.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
2026-07-05 18:29:04 +00:00
Konrad Dybcio 24d4a7ba81 Merge pull request #91 from quic-bjorande/for-linux-msm/flashing-support
For linux msm/flashing support
2026-06-15 15:36:09 +02:00
Bjorn Andersson 48efa3096e cdba-server: Provide QDL access control list
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>
2026-06-14 22:14:26 +00:00
Bjorn Andersson 4be6c26fbe device_parser: Extract parsing of "users"
The open-coded parsing of the "users" object in parse_board() makes the
parse loop unnecessarily long, and with the upcoming introduction of
a QDL access list this would be an even bigger problem.

Extract the "users" parsing into a helper function of it own, to clean
up the code and prepare for the introduction of parsing of "qdl_access".

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
2026-05-20 22:26:18 +00:00
Bjorn Andersson 7af96ab6c6 cdba: Consider stdin and stderr for inactivity timer as well
The inactivity timeout is only bumped on incoming messages on stdout.

But during upload of images (MSG_FASTBOOT_DOWNLOAD or MSG_EDL_DOWNLOAD)
there is no traffic on stdout. Likewise MSG_EDL_WRITE would trigger the
write of an image to the storage media, which will emit updated on
stderr.

Both of these additional pipes represents activity, so let's bump the
timeout there as well.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
2026-05-20 22:26:18 +00:00
Bjorn Andersson 40ced5a8c9 cdba: Wire up flashing support in the client
With the server supporting alternative power-on mechanisms, EDL
notifications and flashing support, the client interface can now be
implemented.

Allow a series of "write <target> <image>" arguments on the command line
register images and their target. Request the server to power on the
device into the newly supported EDL state, then as the EDL notification
arrives push the images and request them to be flashed by the server.

It is assumed that the flashing operations is only desired on the first
discovery of a device in EDL mode at this time, as test-scenarios across
reboot typically doesn't involve resetting storage content.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
2026-05-20 22:26:18 +00:00
Bjorn Andersson 1b75e1a3d7 cdba: Allow queueing file descriptors
The boot payload can be massive (GBs) so queueing it upfront will
consume a lot of RAM, unnecessarily. Allow the transmit queue to carry
references to a file descriptor instead of the actual payload.

As the queue is consumed each chunk is read from the file and
transmitted. As we use zero-length messages to represent EOF, let's use
that as our signal for closing the file descriptor as well.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
2026-05-20 22:26:18 +00:00
Bjorn Andersson 627e5f1016 cdba: Clean up construction of TX messages
For some unknown reason, when I wrote this I choose to build the
outgoing messages in an event-based manner, queuing the operation that
will produce the message, rather than just queuing the message directly.

Let's simplify this by just queueing the actual messages directly and
change the main loop to simply drain the queue.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
2026-05-20 22:26:18 +00:00
Bjorn Andersson fc100a6442 cdba-server: Add support for flashing, using QDL
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>
2026-05-20 22:26:14 +00:00
Bjorn Andersson 403e5c36ac drivers: ftdi-gpio: Implement support for EDL key
When the EDL key is held during power up, the device will enter EDL
mode, making the board ready for firmware flashing.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
2026-05-20 20:38:38 +00:00
Bjorn Andersson 6ef5e38a76 cdba-server: Allow booting into EDL mode
In order to implement flash support, as well as aid in maintenance
situations, support for requesting the board to be powered on into
EDL/flashing mode is useful.

So far the payload of the MSG_POWER_ON message has been ignored by the
server, so we can tread the absence of payload as "NORMAL" power on
request and introduce the power_on_mode enumeration to define the values
in this (optional) byte.

A new key definition is also added to the protocol, representing the
holding down the EDL "key", but not exposed on the client side yet.

The device logic is wired up such that the power-on sequence will now
request the drivers to hold the EDL key while powering on, if the
power-on mode is "EDL".

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
2026-05-20 20:38:38 +00:00
Bjorn Andersson a3adbc2437 list: Clarify list_add(), add list_prepend() and list_len()
Moving between the Linux kernel's list.h and this one is confusing, as
list_add() prepends in one case and appends in the other. Rename the
function to clarify the API. Introduce an operation for those cases
where a prepend is desired.

Also introduce a list_len() operation, which can be useful to save
clients from open-coding this.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
2026-05-11 14:44:04 +00:00
Konrad Dybcio 20d08f3a2c Merge pull request #93 from abelvesa/master
cdba: add per-board power key press duration
2026-04-24 15:17:36 +02:00
Abel Vesa fd3f591330 cdba: add per-board power key press duration
On some Alpaca boards the power key needs to be pressed for longer than
the default duration, otherwise the board powers down automatically.

Add a 'power_key_press_ms' board configuration property to allow
specifying the duration in milliseconds.

Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
2026-04-24 14:35:35 +03:00
Bartosz Golaszewski 2a820ca52a drivers: add support for pic32cx
PIC32CX is a newer debug board used on automotive platforms like
sa8797p. It uses human-readable commands over serial but speaks a
different dialect than alpaca. Add a new driver to support it and extend
available config options.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
2026-04-15 15:00:22 -05:00
Dmitry Baryshkov b6c766db1f Merge pull request #88 from krzk/dupa
schema: Allow Fastboot serial numbers up to 16 characters
2025-07-05 16:31:36 +03:00
Krzysztof Kozlowski 031948ff19 schema: Allow Fastboot serial numbers up to 16 characters
WinLink e850 board reports Fastboot ID/serial of "00000b66ce9c23e0" and
fastboot sources [1] allow up to 256 bytes, so grow the pattern to at least
16 characters:

[1] https://android.googlesource.com/platform/system/core/+/refs/heads/android16-release/fastboot/usb.h#54

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
2025-07-05 15:00:58 +02:00
Neil Armstrong 30c30ce84c Merge pull request #86 from lumag/laurent-usb
laurent: add support for controlling USB power
2025-03-18 09:32:35 +01:00
Neil Armstrong 95a40706be Merge pull request #84 from stephan-gh/ftdi-usb1
drivers: ftdi-gpio: Add second USB disconnect GPIO & schema.yaml fixes
2025-03-18 09:28:37 +01:00
Dmitry Baryshkov 4320c482d3 Merge pull request #81 from mwasilew/boot_mode
device_parser: improve error reporting
2025-02-21 19:25:36 +02:00