Skip to content

Commit 049cf31

Browse files
committed
Add samples and CI test
Signed-off-by: Neil Armstrong <[email protected]>
1 parent 5e6a988 commit 049cf31

12 files changed

+337
-0
lines changed

.github/workflows/yaml.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
#
3+
# Copyright (c) 2021 Canonical Ltd.
4+
# Copyright (c) 2023 Linaro Ltd
5+
# Author: Krzysztof Kozlowski <[email protected]>
6+
7+
#
8+
# Loosely based on: https://github.com/linux-test-project/ltp
9+
# https://github.com/linux-nfc/neard
10+
#
11+
name: "Yaml"
12+
on:
13+
pull_request:
14+
push:
15+
workflow_dispatch:
16+
17+
jobs:
18+
job:
19+
name: Yaml
20+
runs-on: ubuntu-latest
21+
permissions:
22+
actions: read
23+
contents: read
24+
25+
container:
26+
image: ubuntu:jammy
27+
28+
steps:
29+
- name: Git checkout
30+
uses: actions/checkout@v3
31+
32+
- name: Install additional packages
33+
run: |
34+
export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
35+
apt update
36+
apt install -y --no-install-recommends yamllint python3-jsonschema python3-ruamel.yaml
37+
38+
- name: Lint samples
39+
run: for file in config-samples/*; do yamllint $file; done
40+
41+
- name: Check samples
42+
run: for file in config-samples/*; do python3 ./validate.py -s schema.yaml $file; done

.yamllint

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
extends: relaxed
2+
3+
rules:
4+
line-length:
5+
# 80 chars should be enough, but don't fail if a line is longer
6+
max: 110
7+
allow-non-breakable-words: true
8+
level: warning
9+
braces:
10+
min-spaces-inside: 0
11+
max-spaces-inside: 1
12+
min-spaces-inside-empty: 0
13+
max-spaces-inside-empty: 0
14+
brackets:
15+
min-spaces-inside: 0
16+
max-spaces-inside: 1
17+
min-spaces-inside-empty: 0
18+
max-spaces-inside-empty: 0
19+
colons: {max-spaces-before: 0, max-spaces-after: 1}
20+
commas: {min-spaces-after: 1, max-spaces-after: 1}
21+
comments:
22+
require-starting-space: true
23+
min-spaces-from-content: 1
24+
comments-indentation: disable
25+
document-start:
26+
present: true
27+
empty-lines:
28+
max: 3
29+
max-end: 1
30+
empty-values:
31+
forbid-in-block-mappings: true
32+
forbid-in-flow-mappings: true
33+
hyphens:
34+
max-spaces-after: 1
35+
indentation:
36+
spaces: 2
37+
indent-sequences: true
38+
check-multi-line-strings: false
39+
trailing-spaces: false

config-samples/sample1.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
devices:
3+
- board: myboard
4+
name: "My Board"
5+
description: |
6+
My Awesome board
7+
console: /dev/ttyABC0
8+
fastboot: cacafada
9+
fastboot_set_active: a
10+
fastboot_key_timeout: 2
11+
usb_always_on: false
12+
cdba: /dev/serial/by-id/usb-CDBA-if00
13+
voltage: 1800

config-samples/sample10.yaml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
devices:
3+
- board: myboard
4+
name: "My Board"
5+
description: |
6+
My Awesome board
7+
console: /dev/ttyABC0
8+
fastboot: cacafada
9+
ftdi_gpio: "s:0x0403:0x6011:FT7YWRL8;D;POWER,1,ACTIVE_LOW;FASTBOOT_KEY,0,ACTIVE_HIGH;POWER_KEY,3,ACTIVE_HIGH;USB_DISCONNECT,7,ACTIVE_LOW"
10+
- board: myboard-2
11+
name: "My Board 2"
12+
description: |
13+
My Awesome board Number 2
14+
console: /dev/ttyABC1
15+
fastboot: cacafada
16+
ftdi_gpio: "s:0x0403:0x6011:FT7YWRL8;D;POWER_KEY,3,ACTIVE_HIGH;POWER,1,ACTIVE_LOW;FASTBOOT_KEY,0,ACTIVE_HIGH"
17+
- board: myboard-3
18+
name: "My Board 2"
19+
description: |
20+
My Awesome board Number 3
21+
console: /dev/ttyABC2
22+
fastboot: cacafada
23+
ftdi_gpio: "s:0x0403:0x6011:FT7YWRL8;D;FASTBOOT_KEY,0,ACTIVE_HIGH;POWER,1,ACTIVE_LOW"
24+
- board: myboard-4
25+
name: "My Board 2"
26+
description: |
27+
My Awesome board Number 4
28+
console: /dev/ttyABC3
29+
fastboot: cacafada
30+
ftdi_gpio: "s:0x0403:0x6011:FT7YWRL8;D;POWER,1,ACTIVE_LOW"
31+
- board: myboard-5
32+
name: "My Board 2"
33+
description: |
34+
My Awesome board Number 5
35+
console: /dev/ttyABC4
36+
fastboot: cacafada
37+
ftdi_gpio: "s:0x0403:0x6011:FT7YWRL8;D"
38+
- board: myboard-6
39+
name: "My Board 2"
40+
description: |
41+
My Awesome board Number 6
42+
console: /dev/ttyABC5
43+
fastboot: cacafada
44+
ftdi_gpio: "s:0x0403:0x6011:FT7YWRL8"
45+
- board: myboard-7
46+
name: "My Board 2"
47+
description: |
48+
My Awesome board Number 7
49+
console: /dev/ttyABC6
50+
fastboot: cacafada
51+
ftdi_gpio: "i:0x0403:0x6011;D;POWER,1,ACTIVE_LOW;FASTBOOT_KEY,0,ACTIVE_HIGH;POWER_KEY,3,ACTIVE_HIGH;USB_DISCONNECT,7,ACTIVE_LOW"
52+
- board: myboard-8
53+
name: "My Board 2"
54+
description: |
55+
My Awesome board Number 7
56+
console: /dev/ttyABC6
57+
fastboot: cacafada
58+
ftdi_gpio: "i:0x0403:0x6011:0;D;POWER,1,ACTIVE_LOW;FASTBOOT_KEY,0,ACTIVE_HIGH;POWER_KEY,3,ACTIVE_HIGH;USB_DISCONNECT,7,ACTIVE_LOW"
59+
- board: myboard-9
60+
name: "My Board 2"
61+
description: |
62+
My Awesome board Number 7
63+
console: /dev/ttyABC6
64+
fastboot: cacafada
65+
ftdi_gpio: "d:/dev/bus/usb/006/001;D;POWER,1,ACTIVE_LOW;FASTBOOT_KEY,0,ACTIVE_HIGH;POWER_KEY,3,ACTIVE_HIGH;USB_DISCONNECT,7,ACTIVE_LOW"

config-samples/sample2.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
devices:
3+
- board: myboard
4+
name: "My Board"
5+
description: |
6+
My Awesome board
7+
console: /dev/ttyABC0
8+
fastboot: cacafada
9+
fastboot_set_active: b
10+
fastboot_key_timeout: 2
11+
usb_always_on: false
12+
conmux: /dev/serial/by-id/usb-CDBA-if00

config-samples/sample3.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
devices:
3+
- board: myboard
4+
name: "My Board"
5+
description: |
6+
My Awesome board
7+
console: /dev/ttyABC0
8+
fastboot: cacafada
9+
fastboot_set_active: true
10+
fastboot_key_timeout: 2
11+
usb_always_on: false
12+
external: /path/to/my/awesome/script.sh

config-samples/sample4.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
devices:
3+
- board: myboard
4+
name: "My Board"
5+
description: |
6+
My Awesome board
7+
console: /dev/ttyABC0
8+
fastboot: cacafada
9+
fastboot_set_active: true
10+
fastboot_key_timeout: 2
11+
usb_always_on: false
12+
ppps_path: 2-2:1.0/2-2-port2
13+
ppps3_path: 2-2:2.0/2-2-port2

config-samples/sample5.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
devices:
3+
- board: myboard
4+
name: "My Board"
5+
description: |
6+
My Awesome board
7+
console: /dev/ttyABC0
8+
fastboot: cacafada
9+
fastboot_set_active: true
10+
fastboot_key_timeout: 2
11+
usb_always_on: false
12+
qcomlt_debug_board: /dev/serial/by-id/usb-DebugBoard-if00

config-samples/sample6.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
devices:
3+
- board: myboard
4+
name: "My Board"
5+
description: |
6+
My Awesome board
7+
console: /dev/ttyABC0
8+
fastboot: cacafada
9+
fastboot_set_active: true
10+
fastboot_key_timeout: 2
11+
usb_always_on: false
12+
alpaca: /dev/serial/by-id/usb-ALPACA-if00

config-samples/sample7.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
devices:
3+
- board: myboard
4+
name: "My Board"
5+
description: |
6+
My Awesome board
7+
console: /dev/ttyABC0
8+
fastboot: cacafada
9+
fastboot_set_active: true
10+
fastboot_key_timeout: 2
11+
usb_always_on: false
12+
cdba: /dev/serial/by-id/usb-CDBA-if00
13+
voltage: 1800
14+
users:
15+
- toto
16+
- tata

config-samples/sample8.yaml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
devices:
3+
- board: myboard
4+
name: "My Board"
5+
description: |
6+
My Awesome board
7+
console: /dev/ttyABC0
8+
fastboot: cacafada
9+
ftdi_gpio:
10+
vendor: "0x0403"
11+
product: "0x6011"
12+
serial: FT7YWRL8
13+
power_key:
14+
interface: A
15+
line: 2
16+
fastboot_key:
17+
interface: A
18+
line: 0
19+
active_low: true
20+
power:
21+
interface: A
22+
line: 1
23+
active_low: true
24+
- board: myboard-2
25+
name: "My Board 2"
26+
description: |
27+
My Awesome board Number 2
28+
console: /dev/ttyABC1
29+
fastboot: cacafada
30+
ftdi_gpio:
31+
vendor: "0x0403"
32+
product: "0x6011"
33+
index: 0
34+
power:
35+
interface: B
36+
line: 1
37+
active_low: true
38+
fastboot_key:
39+
interface: B
40+
line: 0
41+
active_low: true
42+
power_key:
43+
interface: B
44+
line: 2
45+
usb_disconnect:
46+
interface: C
47+
line: 7
48+
active_low: true
49+
- board: myboard-3
50+
name: "My Board 3"
51+
description: |
52+
My Awesome board Number 3
53+
console: /dev/ttyABC1
54+
fastboot: cacafada
55+
ftdi_gpio:
56+
vendor: "0x0403"
57+
product: "0x6011"
58+
power_key:
59+
interface: B
60+
line: 2
61+
power:
62+
interface: D
63+
line: 1
64+
active_low: true
65+
- board: myboard-4
66+
name: "My Board 4"
67+
description: |
68+
My Awesome board Number 4
69+
console: /dev/ttyABC1
70+
fastboot: cacafada
71+
ftdi_gpio:
72+
devicenode: /dev/bus/usb/006/001
73+
power:
74+
interface: D
75+
line: 6

config-samples/sample9.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
devices:
3+
- board: myboard
4+
name: "My Board"
5+
description: |
6+
My Awesome board
7+
console: /dev/ttyABC0
8+
fastboot: cacafada
9+
fastboot_set_active: true
10+
fastboot_key_timeout: 2
11+
local_gpio:
12+
power:
13+
chip: gpiochip0
14+
line: 7
15+
active_low: true
16+
fastboot_key:
17+
chip: gpiochip0
18+
line: 8
19+
active_low: true
20+
power_key:
21+
chip: gpiochip0
22+
line: 14
23+
active_low: true
24+
usb_disconnect:
25+
chip: gpiochip0
26+
line: 4

0 commit comments

Comments
 (0)