Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
4f4f170
Add generic ftdi GPIO backend
superna9999 Jan 16, 2023
6c7aa53
README: add new config example for Alpaca setup
krzk Feb 14, 2023
432e9b2
ci: add basic Github Actions Continuous Integration builds
krzk May 1, 2023
04ce8ca
ftdi-gpio: correct the interface name and fix -Wlogical-op warning
krzk May 7, 2023
7bb7cc2
ftdi-gpio: fix -Wimplicit-function-declaration
krzk May 7, 2023
33092e2
ftdi-gpio: fix -Wformat warning
krzk May 7, 2023
88c3196
fastboot: fix -Wpointer-arith
krzk May 7, 2023
2af3911
list: drop unneeded const to fix -Wcast-qual
krzk May 7, 2023
647a6c5
cdba: fix -Wpointer-arith
krzk May 7, 2023
c6d97d3
circ_buf: fix -Wsign-compare
krzk May 7, 2023
352dc1a
circ_buf: fix -Wpointer-arith
krzk May 7, 2023
f47098b
cdb_assist: fix -Wformat=
krzk May 7, 2023
edb4159
conmux: fix -Wsign-compare
krzk May 7, 2023
c7e7a81
device_parser: fix -Wformat=
krzk May 7, 2023
044be47
device: fix -Wsign-compare
krzk May 7, 2023
ca2d4b0
cdba-server: correct cast to fix -Wcast-qual
krzk May 7, 2023
7e57753
cdba-server: fix -Wpointer-arith
krzk May 7, 2023
7653f1a
circ_buf: fix clang -Wunused-but-set-variable
krzk May 7, 2023
a785bd1
list: fix clang -Wcast-align on container_of
krzk May 7, 2023
acb6508
Makefile: enable several warnings and -Werror
krzk May 7, 2023
721f440
Drop EOL fedora branches
konradybcio Sep 20, 2023
f3ec38a
Merge pull request #24 from linux-msm/konradybcio-patch-1
konradybcio Sep 20, 2023
6ea5f8f
ci: Drop EOL ubuntu kinetic
konradybcio Sep 20, 2023
5850ee7
cdba-server: Remove dead code
konradybcio Sep 21, 2023
d6d2554
ci/debian: don't install libc6-dev-ARCH-cross packages
lumag Sep 21, 2023
3583646
c/debian: use dpkg-architecture to detect gcc-cross package name
lumag Sep 21, 2023
9e0edd4
Merge pull request #20 from lumag/debian-cross-ci
konradybcio Sep 21, 2023
ace20c9
Merge pull request #26 from linux-msm/konradybcio-patch-1
konradybcio Sep 21, 2023
327da0b
device: support specifying active slot
lumag Sep 20, 2023
bfcbff6
cdba: fix console handling
lumag Sep 20, 2023
f2d2828
Merge pull request #22 from lumag/set_active
konradybcio Sep 21, 2023
38d05e8
Merge pull request #23 from lumag/tilde-handling
konradybcio Sep 21, 2023
2bbe855
Makefile: adapt for libftdi vs libftdi1 differences
lumag Sep 21, 2023
b6ef071
ci: install pkg-config or pkgconf
lumag Sep 21, 2023
fb11183
Merge pull request #28 from lumag/fix-ci
konradybcio Sep 21, 2023
4c12161
ci: use Debian ARM hard-float port instead of armel
krzk Sep 21, 2023
a4df159
Merge pull request #29 from lumag/fix-ci
lumag Sep 21, 2023
a1f2da9
ftdi-gpio: Use a non-local include for libftdi hdr
konradybcio Sep 21, 2023
62d67fc
Merge pull request #30 from linux-msm/konradybcio-patch-1
lumag Sep 21, 2023
04f83b6
ci: run builds periodically
krzk Jul 13, 2023
2c2e9d4
ci: fix Arch Linux GLIBC_2.38 not found
krzk Aug 27, 2023
85f8023
Merge pull request #19 from krzk/ci-scheduled-builds
konradybcio Sep 22, 2023
1353a02
ci: keep env variables ordered by name
krzk Sep 22, 2023
b55f011
ci: remove stale links
krzk Sep 22, 2023
b5664c2
Merge pull request #31 from krzk/ci-clean
lumag Sep 22, 2023
3ea8df6
device: implement access control to the boards
lumag Jul 8, 2023
5164ca9
README: update config file syntax
lumag Jul 8, 2023
926ca24
cdba-shell: set the CDBA_USER variable
lumag Jul 8, 2023
757f8e5
Merge pull request #18 from lumag/acl
lumag Sep 23, 2023
91daddc
support ppps usb control
kcxt Sep 24, 2023
d360973
device: add fcntl.h for musl
kcxt Sep 27, 2023
363bac3
Merge pull request #33 from calebccff/ppps
lumag Sep 28, 2023
74e5139
cdba: extract message-sending helper
lumag Sep 23, 2023
771910e
cdba-server: extract message-sending helper
lumag Sep 23, 2023
c403782
Merge pull request #32 from lumag/buf
konradybcio Sep 28, 2023
3e8e3bb
conmux: switch to getaddrinfo
lumag Sep 29, 2023
606a242
Introduce meson.build
superna9999 Feb 15, 2023
f7d7054
Add meson build to CI
superna9999 Sep 21, 2023
6cbe23c
Generate meson cross compile file
superna9999 Sep 21, 2023
93a2e19
Use autobuild for CodeQL
superna9999 Oct 2, 2023
4225dc8
Remove Makefile
superna9999 Oct 2, 2023
f09b3e1
Merge pull request #14 from superna9999/meson-build
lumag Oct 2, 2023
1c0422a
Rename to ABCD
superna9999 Oct 19, 2023
90ed788
Switch to pyamlboot
superna9999 Oct 19, 2023
8623abc
Add local gpio control
superna9999 Oct 19, 2023
69977db
Add fork explaining
superna9999 Oct 19, 2023
768fcbd
fixup! Switch to pyamlboot
superna9999 Oct 19, 2023
4ba0d2a
Fix CI for gpiod
superna9999 Oct 26, 2023
70d9b1d
Add boot stages
superna9999 Oct 26, 2023
6b5d965
Add DFU
superna9999 Oct 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
243 changes: 243 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (c) 2021 Canonical Ltd.
# Copyright (c) 2023 Linaro Ltd
# Author: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
# <krzk@kernel.org>
#
# Loosely based on: https://github.com/linux-test-project/ltp
# https://github.com/linux-nfc/neard
#
name: "Builds"
on:
pull_request:
push:
schedule:
# Run at 1:01 PM, every Tuesday
- cron: '1 13 * * 2'
workflow_dispatch:

jobs:
job:
name: Build
runs-on: ubuntu-latest
permissions:
actions: read
contents: read

strategy:
fail-fast: false
matrix:
arch: [x86-64]
family: [x86-64]
compiler: [gcc, clang]
container:
- archlinux:latest
- debian:testing
- debian:stable
- debian:bookworm
- debian:bullseye
- debian:buster
# Fails on configure on GCC and clang (process restrictions?)
# - fedora:rawhide
- fedora:latest
# Uses ligpiod 2.x
# - fedora:39
- fedora:38
- fedora:37
- ubuntu:lunar # EOL 01.2024
- ubuntu:jammy
- ubuntu:focal
- ubuntu:bionic
# Meson version on Ubuntu Xenial is really too old
#- ubuntu:xenial
cross_compile: [""]
variant: [""]
include:
# Debian 32-bit builds
- container: "debian:testing"
arch: i386
family: x86
compiler: gcc
cross_compile: i686-linux-gnu
pkg_config_path: /usr/lib/i386-linux-gnu/pkgconfig
variant: i386

- container: "debian:stable"
arch: i386
family: x86
compiler: gcc
cross_compile: i686-linux-gnu
pkg_config_path: /usr/lib/i386-linux-gnu/pkgconfig
variant: i386

- container: "debian:bookworm"
arch: i386
family: x86
compiler: gcc
cross_compile: i686-linux-gnu
pkg_config_path: /usr/lib/i386-linux-gnu/pkgconfig
variant: i386

- container: "debian:buster"
arch: i386
family: x86
compiler: gcc -m32
cross_compile: i686-linux-gnu
pkg_config_path: /usr/lib/i386-linux-gnu/pkgconfig
variant: i386

# Debian cross compilation builds
- container: "debian:testing"
arch: armhf
family: arm
compiler: arm-linux-gnueabihf-gcc
cross_compile: arm-linux-gnueabihf
pkg_config_path: /usr/lib/arm-linux-gnueabihf/pkgconfig
variant: cross-compile

- container: "debian:testing"
arch: arm64
family: aarch64
compiler: aarch64-linux-gnu-gcc
cross_compile: aarch64-linux-gnu
pkg_config_path: /usr/lib/aarch64-linux-gnu/pkgconfig
variant: cross-compile

- container: "debian:testing"
arch: ppc64el
family: ppc64
compiler: powerpc64le-linux-gnu-gcc
cross_compile: powerpc64le-linux-gnu
pkg_config_path: /usr/lib/powerpc64le-linux-gnu/pkgconfig
variant: cross-compile

- container: "debian:testing"
arch: s390x
family: s390x
compiler: s390x-linux-gnu-gcc
cross_compile: s390x-linux-gnu
pkg_config_path: /usr/lib/s390x-linux-gnu/pkgconfig
variant: cross-compile

- container: "debian:stable"
arch: armhf
family: arm
compiler: arm-linux-gnueabihf-gcc
cross_compile: arm-linux-gnueabihf
pkg_config_path: /usr/lib/arm-linux-gnueabihf/pkgconfig
variant: cross-compile

- container: "debian:stable"
arch: arm64
family: aarch64
compiler: aarch64-linux-gnu-gcc
cross_compile: aarch64-linux-gnu
pkg_config_path: /usr/lib/aarch64-linux-gnu/pkgconfig
variant: cross-compile

- container: "debian:stable"
arch: ppc64el
family: ppc64
compiler: powerpc64le-linux-gnu-gcc
cross_compile: powerpc64le-linux-gnu
pkg_config_path: /usr/lib/powerpc64le-linux-gnu/pkgconfig
variant: cross-compile

- container: "debian:stable"
arch: s390x
family: s390x
compiler: s390x-linux-gnu-gcc
cross_compile: s390x-linux-gnu
pkg_config_path: /usr/lib/s390x-linux-gnu/pkgconfig
variant: cross-compile

container:
image: ${{ matrix.container }}
env:
ARCH: ${{ matrix.arch }}
FAMILY: ${{ matrix.family }}
CC: ${{ matrix.compiler }}
CROSS_COMPILE: ${{ matrix.cross_compile }}
PKG_CONFIG_PATH: ${{ matrix.pkg_config_path }}
VARIANT: ${{ matrix.variant }}

steps:
- name: Show OS
run: cat /etc/os-release

- name: Show env (matrix settings)
run: |
echo "ARCH: $ARCH"
echo "FAMILY: $FAMILY"
echo "CC: $CC"
echo "CROSS_COMPILE: $CROSS_COMPILE"
echo "VARIANT: $VARIANT"
echo "PKG_CONFIG_PATH: $PKG_CONFIG_PATH"

- name: Git checkout
uses: actions/checkout@v3

- name: Install additional packages
run: |
INSTALL=${{ matrix.container }}
INSTALL="${INSTALL%%:*}"
INSTALL="${INSTALL%%/*}"
./ci/$INSTALL.sh
if [ "$VARIANT" ]; then ./ci/$INSTALL.$VARIANT.sh; fi

- name: Compiler version
run: $CC --version

- name: Display environment and Linux version
run: |
test -f /etc/issue && cat /etc/issue
echo "############################################"
lsb_release -a || true
echo "############################################"
cat /usr/include/linux/version.h
echo "############################################"
uname -a
echo "############################################"
cat /proc/cmdline
echo "############################################"
printenv

# i386 build on x86_64 only requires passing -m32 to CFLAGS & LDFLAGS
- name: Meson init for i386
if: ${{ matrix.variant == 'i386' }}
run: |
mkdir build
CFLAGS="-m32" LDFLAGS="-m32" meson setup . build

- name: Meson init with cross compile
if: ${{ matrix.variant == 'cross-compile' }}
run: |
# Generate cross compile file (see https://mesonbuild.com/Cross-compilation.html#cross-compilation)
echo "[binaries]" > cross.txt
echo "c = '${CROSS_COMPILE}-gcc'" >> cross.txt
echo "strip = '${CROSS_COMPILE}-strip'" >> cross.txt
# Forcing pkgconfig binary to 'pkg-config' is required for cross build to work
echo "pkgconfig = 'pkg-config'" >> cross.txt
echo "[host_machine]" >> cross.txt
echo "system = 'linux'" >> cross.txt
echo "cpu_family = '${FAMILY}'" >> cross.txt
echo "cpu = '${ARCH}'" >> cross.txt
echo "endian = 'little'" >> cross.txt
echo "[properties]" >> cross.txt
echo "pkg_config_libdir = '${PKG_CONFIG_PATH}'" >> cross.txt
cat cross.txt
mkdir build
meson setup --cross-file cross.txt . build

- name: Meson init
if: ${{ matrix.variant == '' }}
run: |
mkdir build
meson setup . build

- name: Compile
run: ninja -C build

- name: Install
run: ninja -C build install
41 changes: 41 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (c) 2021 Canonical Ltd.
# Copyright (c) 2023 Linaro Ltd
# Author: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
# <krzk@kernel.org>
#
name: "CodeQL"
on: [push, pull_request, workflow_dispatch]

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Install additional packages
run: sudo ./ci/ubuntu.sh

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ Mkfile.old
dkms.conf

# Binaries generated by the program
cdba-server
cdba
abcd-server
abcd
1 change: 1 addition & 0 deletions 99-gpiod.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SUBSYSTEM=="gpio", KERNEL=="gpiochip0", GROUP="plugdev", MODE="0660"
1 change: 1 addition & 0 deletions 99-libftdi.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", GROUP="dialout", MODE="0660"
1 change: 1 addition & 0 deletions 99-pyamlboot.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b8e", ATTRS{idProduct}=="c003", GROUP="dialout", MODE="0660"
28 changes: 0 additions & 28 deletions Makefile

This file was deleted.

37 changes: 27 additions & 10 deletions README
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
= CDBA control tool
The CDBA control tool is used for remotely booting images on development boards
attached using a CDB Assist [https://github.com/sonyxperiadev/CDB-Assist] or Conmux.
= ABCD control tool
The ABCD control tool is used for remotely booting Amlogic TF-A images on development boards

This is a friendly fork on CDBA (https://github.com/linux-msm/cdba) for the only
purpose to boot amlogic bootloader to run the U-Boot test suite.

= Dependencies
sudo apt-get install libudev-dev libyaml-dev for debian systems
dnf install systemd-devel libyaml-devel for fedora systems
sudo apt-get install libudev-dev libyaml-dev libftdi1-dev pkg-config meson for debian systems
dnf install systemd-devel libyaml-devel libftdi1-devel pkg-config meson for fedora systems

= Device side
On the host with the CDB Assist or Conmux attached the "cdba-server" executable is run
from sandbox/cdba/cdba-server. Available devices are read from $HOME/.cdba
On the host with the CDB Assist or Conmux attached the "abcd-server" executable is run
from sandbox/abcd/abcd-server. Available devices are read from $HOME/.abcd

= Build instructions

# meson . build
# ninja -C build

= Client side
The client is invoked as:

cdba -b <board> -h <host> [-c <power-cylce-count>] boot.img
abcd -b <board> -h <host> [-c <power-cylce-count>] u-boot.bin

<host> will be connected to using ssh and <board> will be selected for
operation. As the board's fastboot interface shows up the given boot.img will
Expand All @@ -27,12 +34,12 @@ restart the board the given number of times. Each time booting the given
boot.img.

== Device configuration
The list of attached devices is read from $HOME/.cdba and is YAML formatted.
The list of attached devices is read from $HOME/.abcd and is YAML formatted.

=== Example
devices:
- board: db2k
cdba: 00000001
abcd: 00000001
name: "DragonBoard2k"
fastboot: abcdef1
voltage: 8000
Expand All @@ -43,6 +50,16 @@ devices:
fastboot_set_active: true

- board: evb2k
users:
- username
console: /dev/ttyUSB0
fastboot: abcdef3
fastboot_set_active: true

- board: qrd8550
alpaca: /dev/serial/by-id/usb-QUALCOMM_Inc._Embedded_Power_Measurement__EPM__device_6E02020620151F14-if01
console: /dev/serial/by-id/usb-QUALCOMM_MTP_Debug_Board_MT77TGG2-if00-port0
name: QRD8550
fastboot: 91671140
fastboot_set_active: true
fastboot_key_timeout: 2
Loading