Commit Graph

28 Commits

Author SHA1 Message Date
Bjorn Andersson
e44274243a conmux: Fix conmux client name
There are other users than myself of this, so don't hard code the conmux
id as "bjorn" but rather base it on $USER.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-11-30 11:21:00 -08:00
Bjorn Andersson
193c195c2a fastboot: Use stderr to communicate status messages
Use stderr to communicate status messages from fastboot boot, rather
than stdout.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-11-30 11:04:56 -08:00
Bjorn Andersson
fcfb7ad05f fastboot: Don't tear down link when fastboot download fails
There are cases where fastboot simply disconnects, where it makes sense
to maintain the cdba connection, so return gracefully from
fastboot_download() when this happens.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-11-30 11:02:14 -08:00
Bjorn Andersson
8306649692 conmux: Bump max response length
When a conmux is already attached the motd becomes quite long,
surpassing the 128 bytes, bump the max response length.

This solves the problem sometimes seen as:

  bad: parsing reqistry lookup response: truncated percent-encoding

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-11-30 11:00:33 -08:00
Bjorn Andersson
c264b11e94 bad: Introduce lockfile for boards
Grab a flock() in order to prohibit multiple clients from controlling
the same board at any point in time.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-04-22 10:06:00 -07:00
Bjorn Andersson
35a15a991f bad: Enable vbus to boot device and hold fastbot key
Use vbus to trigger boot of the devices and release the fastboot key
once we see traces of fastboot.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-04-20 14:54:56 -07: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
6b334bd512 cdba: Add support for timeout
Support specifying a timeout -t in order to limit the execution time of
stalling test runs.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-04-11 16:35:33 -07:00
Bjorn Andersson
c3a7b4ee9f cdba: Add readme file
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-12 19:09:15 -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
Bjorn Andersson
196282fb06 conmux: Introduce conmux as additional device controller
Device attached to conmux can be controlled as well. The interface
depends on the conmux exposing the two control commands "hardreset" and
"off".

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-12 19:09:15 -07:00
Bjorn Andersson
2fc13cec3f device: Introduce ops for control operations
In order to support multiple control boards make all operations follow
indirections in the device context.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-12 17:44:29 -07:00
Bjorn Andersson
955f5712d6 device: Make cdb_assist reference typeless
We're not dereferencing the cdb pointer, so make it void * in order to
support alternative controllers.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-12 17:44:17 -07:00
Bjorn Andersson
65d297b99d fastboot: Support set_active
Boards implementing a/b partitioning even for fastboot boot might
sometimes expire the counter and fail the boot. By always setting the
active image to 'a' we're catching this case and flipping it back, and
in other cases the operation becomes a nop.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-12 17:44:17 -07:00
Bjorn Andersson
1ea73dfbed fastboot: Cleanup and fix crash
Clean up some old and broken code in the fastboot implementation.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-12 17:44:17 -07:00
Bjorn Andersson
7a5b4334a1 make: Update linker parameter order
On Ubuntu the library link directive must come last for the libudev
references to be satisfied.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-12 17:44:17 -07:00
Bjorn Andersson
1706d305ab device: Clean out currently unused functions
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-12 17:44:17 -07:00
Bjorn Andersson
682554fdd8 cdba: Support automatic power off and power cycle
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-12 17:44:17 -07:00
Bjorn Andersson
e1aa140a97 bad: Acknowledge power on/off events
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-12 17:44:17 -07:00
Bjorn Andersson
48d186f3d0 fastboot: Check validity of dev_path
In some occations dev_path is not valid and we therefor can't
dereference it. Check for this and ignore any events without a dev_path.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-12 17:44:17 -07:00
Bjorn Andersson
d36b49e6fb cdba: Fail on write failures
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-12 17:44:17 -07:00
Bjorn Andersson
b435f3d743 cdba: Use write-fdset to trigger commands
Register the stdin pipe with the write fdset in order to know when it's
appropriate to send commands over the pipe.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-12 17:44:17 -07:00
Bjorn Andersson
98fb6169f5 cdba: Allow host specified on command line
Rather than hard coding the host, grab it off the command line.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-12 17:44:17 -07:00
Bjorn Andersson
c32cc60328 client: Pick board and boot image from command line
Don't hard code the parameters of the client.

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