189 Commits

Author SHA1 Message Date
Dmitry Baryshkov
bc5e25fda0 Merge pull request #37 from calebccff/werror-and-alpine
Add Alpine Linux CI and stop enabling werror for everyone
v1.0
2023-11-06 14:34:27 +02:00
Caleb Connolly
67f2d38308 ci: add alpine tests
I plan to package CDBA in alpine, as it uses musl libc it is a lot
easier for things to break there. Add alpine latest edge and stable
build tests to catch these.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2023-11-06 12:24:54 +00:00
Caleb Connolly
ba8fa6e300 only enable -Werror in CI
Enabling -Werror by default sucks for everyone who isn't maintaining
CDBA. By all means we should enable it in CI, but not for users and
not for folks packaging it in distros.

Remove it from the flags in meson.build, and use mesons built in option
to enable it only in CI.

See:
https://embeddedartistry.com/blog/2017/05/22/werror-is-not-your-friend/

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2023-11-06 12:24:53 +00:00
Dmitry Baryshkov
18bae8dec9 cdba: remove unnecessary initialisation
Silence Clang warning by removing unused '0' from struct initialisation.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2023-11-06 12:21:18 +00:00
Neil Armstrong
bd5c609ad7 Merge pull request #46 from superna9999/yaml-validate
Add yaml schema and validator
2023-11-04 13:07:32 +01:00
Dmitry Baryshkov
01ebafce2a Merge pull request #44 from superna9999/ftdi-gpio-yaml-parsing
Ftdi gpio yaml parsing
2023-11-04 12:16:13 +02:00
Dmitry Baryshkov
abcf427ab0 Merge pull request #50 from superna9999/local-gpio-yaml-fix
local_gpio: simplify yaml description
2023-11-04 12:14:12 +02:00
Neil Armstrong
a2ae5974ed ftdi_gpio: accept new yaml config
Now local_gpio has landed, also accept a more verbose
and cleaner yaml config syntax for ftdi_gpio.

For now keep support for the current configuration string.

Closes: #42

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2023-11-02 18:18:18 +01:00
Neil Armstrong
6d953411ee ftdi_gpio: align structs with local_gpio
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2023-11-02 17:22:27 +01:00
Neil Armstrong
e08d14a0df local_gpio: simplify yaml description
Instead of:
    local_gpio:
      - power:
          chip: gpiochip0
          line: 7
          active_low: true
      - fastboot_key:
          chip: gpiochip0
          line: 8
          active_low: true
      - power_key:
          chip: gpiochip0
          line: 14
          active_low: true
      - usb_disconnect:
          chip: gpiochip1
          line: 4

Accept the following:
    local_gpio:
      power:
        chip: gpiochip0
        line: 7
        active_low: true
      fastboot_key:
        chip: gpiochip0
        line: 8
        active_low: true
      power_key:
        chip: gpiochip0
        line: 14
        active_low: true
      usb_disconnect:
        chip: gpiochip1
        line: 4

It's simpler and clearer.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2023-11-02 17:17:26 +01:00
Neil Armstrong
049cf31307 Add samples and CI test
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2023-11-02 11:09:32 +01:00
Neil Armstrong
5e6a988a94 Add yaml schema and validator
Closes: #41

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2023-11-02 11:09:32 +01:00
Dmitry Baryshkov
494b04878a Merge pull request #49 from lumag/server-dep
meson: support client-only builds
2023-11-02 11:51:27 +02:00
Dmitry Baryshkov
01372464b2 CI: disable Ubuntu Bionic
Client-only builds benefit from using feature options, which are not
supported by the meson 0.45.1 (the version in Ubuntu bionic).

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2023-11-02 11:32:42 +02:00
Dmitry Baryshkov
7b73465375 meson: support client-only builds
It is expected that the majority of CDBA users do not need the server
binary. Allow users to disable the cdba-server binary and build just the
client.

Fixes: #48
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2023-11-02 11:32:38 +02:00
Dmitry Baryshkov
b9f7f93161 Merge pull request #45 from superna9999/ftdi-gpio-output-enable
ftdi_gpio: add output_enable gpio type
2023-11-02 11:29:01 +02:00
Neil Armstrong
981a8baf88 ftdi_gpio: add output_enable gpio type
Since the FTDI is hot-pluggable, the output lines can be protected
for unwanted changes by a supplementary GPIO that allows the FTDI
gpio outputs to be enabled for the required functions.

Closes: #43

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2023-10-30 18:21:23 +01:00
Neil Armstrong
5e3bdca275 Merge pull request #36 from lumag/ppps3
ppps: add support for separate USB-3 PPPS path
2023-10-30 16:26:06 +01:00
Dmitry Baryshkov
bb653da577 ppps: add support for separate USB-3 PPPS path
Some devices / hubs require switching both USB-2 and USB-3 ports to
function correctly. Add ppps3_path device option to control USB-3 port
in addition to the USB-2 port.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2023-10-30 17:21:02 +02:00
Dmitry Baryshkov
df832c0023 Merge pull request #38 from superna9999/local-gpio
Add local gpio control
2023-10-30 17:20:25 +02:00
Neil Armstrong
87fbc38286 Add local gpio control
This driver permits controlling local (on the system) gpios
by using the libgpiod library.

Support for gpiod v1 and v2 is added, and parses the options
via the yaml parser.

This can be tested with the gpio-sim module:
https://docs.kernel.org/admin-guide/gpio/gpio-sim.html

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2023-10-30 16:16:36 +01:00
Neil Armstrong
55902b7ba9 Export device_parser struct and functions
Export the functions and struct to enable devices to parse
yaml aswell via the parse_options op to be stored in the
device control_options device property.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2023-10-30 16:00:40 +01:00
Konrad Dybcio
fbdc677ee6 Merge pull request #9 from lumag/external
Rework cdba to support controlling device via external program
2023-10-23 16:06:07 +02:00
Dmitry Baryshkov
a0de781e1b cdba-server: sanitise file descriptors before device_close()
If we got to device_close(), the parent SSH might have been exited,
making standard file descriptors unusable. Rebind them to /dev/null, so
that any output during device_close (both from the cdba server and the
helpers) doesn't cause SIGPIPE.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2023-10-02 17:33:13 +03:00
Dmitry Baryshkov
310004badb external: control the board using external program
Control the board using external program. It will be called with 3
arguments: <board> <command> <on/off>, where command is one of "power",
"usb", "key-fastboot", "key-power".

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2023-10-02 17:33:13 +03:00