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>
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>
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>
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>
Separate backend operations into control and console operations. Main
idea is that each device has single set of console ops (conmux or
console) and at most one way to control it. Each backend driver exports
a structure with the set of callbacks.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Allow PPPS function even if there is no device->usb callback. PPPS is
useable even with no control interface.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Meson requires a cross_compile file for foreign architectures,
and also needs the CPU family.
Add FAMILY to all matrix entries
Remove unused MODE
Print PKG_CONFIG_PATH
Add i386 special Meson setup case
Add cross-compile Meson setup case
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Introduce meson.build to be used with the Meson build system,
which handles the dependency and advanced compiler options
for when used on various linux distributions.
The libftdi .so for example has different names on different
distribution, using meson makes sure we can handle those easily,
and easily integrate with other package build systems like
Yocto or Buildroot.
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
On ARM the conmux.c around gethostbyname() results in a compiler
warning/error:
conmux.c:269:27: error: cast increases required alignment of target type [-Werror=cast-align]
269 | saddr.sin_addr = *(struct in_addr *)hent->h_addr_list[0];
Instead of trying to fix the (deprecated) gethostbyname() call, switch
conmux to use getaddrinfo(), which is the proper way to resolve
addresses.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Instad of hand-coding message sending, create a single wrapper that
sends messages to the client.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Instad of hand-coding message sending, create a single wrapper that
sends messages to the server.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Since Linux kernel 6.0, PPPS capable USB hubs expose a simple sysfs
attribute for power control. Allow overwriting the usb control callback
to use PPPS hub control instead.
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>