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>
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>
Notify users of cdba-server when fastboot connection is opened to ease
remote debugging of issues.
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
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>
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>
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>
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>
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>
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>
The fastboot_key function is no longer used, drop the remains in the
alpaca implementation.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>