Skip to content

Commit c8e9be3

Browse files
authored
Merge pull request #125 from lool/more-boards
Add support for more boards
2 parents 6962fdd + 0563494 commit c8e9be3

File tree

3 files changed

+148
-128
lines changed

3 files changed

+148
-128
lines changed

.github/workflows/debos.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ jobs:
136136
tar -cvf "${dir}"/flash-ufs.tar.gz \
137137
disk-ufs.img1 \
138138
disk-ufs.img2 \
139-
flash_qcs6490-*
139+
flash_qcs6490-* \
140+
flash_qcs8300-* \
141+
flash_qcs9100-*
140142
tar -cvf "${dir}"/flash-emmc.tar.gz \
141143
disk-sdcard.img1 \
142144
disk-sdcard.img2 \

debos-recipes/qualcomm-linux-debian-flash.yaml

Lines changed: 143 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{{- $build_qcm6490 := or .build_qcm6490 "true" }}
2+
{{- $build_qcs8300 := or .build_qcs8300 "true" }}
3+
{{- $build_qcs9100 := or .build_qcs9100 "true" }}
24
{{- $build_rb1 := "false" -}}
35
{{- if .u_boot_rb1 -}}
46
{{- $build_rb1 = "true" }}
@@ -14,41 +16,121 @@ actions:
1416
filename: qcom-ptool.tar.gz
1517
unpack: true
1618

19+
{{- $boards := list }}
20+
{{- if eq $build_qcm6490 "true" }}
21+
{{- $boards = append $boards (dict
22+
"name" "qcs6490-rb3gen2-vision-kit"
23+
"silicon_family" "qcm6490"
24+
"platform" "qcs6490-rb3gen2"
25+
"boot_binaries_download" (dict
26+
"description" "QCM6490 boot binaries"
27+
"url" "https://softwarecenter.qualcomm.com/download/software/chip/qualcomm_linux-spf-1-0/qualcomm-linux-spf-1-0_test_device_public/r1.0_00095.0/qcm6490-le-1-0/common/build/ufs/bin/QCM6490_bootbinaries.zip"
28+
"name" "qcm6490_boot-binaries"
29+
"filename" "qcm6490_boot-binaries.zip"
30+
"sha256sum" "9c100d7b184ecf0ab9c4be71a8bb7c243fdc79a64380ca3025024dd2b14c5078"
31+
)
32+
"cdt_download" (dict
33+
"description" "RB3 Gen2 Vision Kit CDT"
34+
"url" "https://artifacts.codelinaro.org/artifactory/codelinaro-le/Qualcomm_Linux/QCS6490/cdt/rb3gen2-vision-kit.zip"
35+
"name" "qcs6490-rb3gen2-vision-kit_cdt"
36+
"filename" "qcs6490-rb3gen2-vision-kit_cdt.zip"
37+
"sha256sum" "a339e297b454c4dc3805fe8cd11d6d8dcb801aa8f0c2dc691561c2785019fa3c"
38+
)
39+
"cdt_filename" "cdt_vision_kit.bin"
40+
"dtb" "qcom/qcs6490-rb3gen2.dtb"
41+
"disk_image_type" "ufs"
42+
)}}
43+
{{- end }}
44+
{{- if eq $build_qcs8300 "true" }}
45+
{{- $boards = append $boards (dict
46+
"name" "qcs8300-ride"
47+
"silicon_family" "qcs8300"
48+
"platform" "qcs8300-ride-sx"
49+
"boot_binaries_download" (dict
50+
"description" "QCS8300 boot binaries"
51+
"url" "https://softwarecenter.qualcomm.com/download/software/chip/qualcomm_linux-spf-1-0/qualcomm-linux-spf-1-0_test_device_public/r1.0_00095.0/qcs8300-le-1-0/common/build/ufs/bin/QCS8300_bootbinaries.zip"
52+
"name" "qcs8300_boot-binaries"
53+
"filename" "qcs8300_boot-binaries.zip"
54+
"sha256sum" "463ffd7f20d243a5673ac49d744c8a35a3ab2067c3588be2741c2e6551f5a8f5"
55+
)
56+
"cdt_download" (dict
57+
"description" "QCS8300 Ride SX EVK CDT"
58+
"url" "https://artifacts.codelinaro.org/artifactory/codelinaro-le/Qualcomm_Linux/QCS8300/cdt/ride-sx.zip"
59+
"name" "qcs8300-ride-sx_cdt"
60+
"filename" "qcs8300-ride-sx_cdt.zip"
61+
"sha256sum" "d7fc667372b28383a36d586333097d84b9d9c104f4dd1845d33904e2d6b39f80"
62+
)
63+
"cdt_filename" "cdt_ride_sx.bin"
64+
"dtb" "qcom/qcs8300-ride.dtb"
65+
"disk_image_type" "ufs"
66+
)}}
67+
{{- end }}
68+
{{- if eq $build_qcs9100 "true" }}
69+
{{- $boards = append $boards (dict
70+
"name" "qcs9100-ride-r3"
71+
"silicon_family" "qcs9100"
72+
"platform" "qcs9100-ride-sx"
73+
"boot_binaries_download" (dict
74+
"description" "QCS9100 boot binaries"
75+
"url" "https://softwarecenter.qualcomm.com/download/software/chip/qualcomm_linux-spf-1-0/qualcomm-linux-spf-1-0_test_device_public/r1.0_00095.0/qcs9100-le-1-0/common/build/ufs/bin/QCS9100_bootbinaries.zip"
76+
"name" "qcs9100_boot-binaries"
77+
"filename" "qcs9100_boot-binaries.zip"
78+
"sha256sum" "c201c9e966a706c9e76685ff4298f0940958c4d4877299eee1248ef26b809aa0"
79+
)
80+
"cdt_download" (dict
81+
"description" "QCS9100 Ride Rev3 EVK CDT"
82+
"url" "https://artifacts.codelinaro.org/artifactory/codelinaro-le/Qualcomm_Linux/QCS9100/cdt/ride-sx_v3.zip"
83+
"name" "qcs9100-ride-sx-v3_cdt"
84+
"filename" "qcs9100-ride-sx-v3_cdt.zip"
85+
"sha256sum" "377a8405899ac82199deaf70bca3648c15b924a3fcef8f109555e661ed70f4b9"
86+
)
87+
"cdt_filename" "cdt_ride_sx.bin"
88+
"dtb" "qcom/qcs9100-ride-r3.dtb"
89+
"disk_image_type" "ufs"
90+
)}}
91+
{{- end }}
1792
{{- if eq $build_rb1 "true" }}
18-
# TODO: consider switching to https://releases.linaro.org/96boards/rb1/qualcomm/firmware/RB1_firmware_20231124-v4.zip instead
19-
- action: download
20-
description: Download RB1 rescue image
21-
url: https://releases.linaro.org/96boards/rb1/linaro/rescue/23.12/rb1-bootloader-emmc-linux-47528.zip
22-
name: qrb2210-rb1_rescue-image.zip
23-
filename: qrb2210-rb1_rescue-image.zip
24-
- action: run
25-
description: Verify download
26-
chroot: false
27-
command: echo c75b6c63eb24c8ca36dad08ba4d4e93f3f4cd7dce60cf1b6dfb5790dc181cc3d ${ROOTDIR}/../qrb2210-rb1_rescue-image.zip|sha256sum --strict -c -
93+
{{- $boards = append $boards (dict
94+
"name" "qrb2210-rb1"
95+
"silicon_family" "qcm2290"
96+
"platform" "qrb2210-rb1"
97+
"boot_binaries_download" (dict
98+
"description" "RB1 rescue image"
99+
"url" "https://releases.linaro.org/96boards/rb1/linaro/rescue/23.12/rb1-bootloader-emmc-linux-47528.zip"
100+
"name" "qrb2210-rb1_rescue-image"
101+
"filename" "qrb2210-rb1_rescue-image.zip"
102+
"sha256sum" "c75b6c63eb24c8ca36dad08ba4d4e93f3f4cd7dce60cf1b6dfb5790dc181cc3d"
103+
)
104+
"disk_image_type" "sdcard"
105+
"u_boot_file" .u_boot_rb1
106+
)}}
28107
{{- end }}
29108

30-
{{- if eq $build_qcm6490 "true" }}
109+
{{- range $board := $boards }}
31110
- action: download
32-
description: Download QCM6490 boot binaries
33-
url: https://softwarecenter.qualcomm.com/download/software/chip/qualcomm_linux-spf-1-0/qualcomm-linux-spf-1-0_test_device_public/r1.0_00095.0/qcm6490-le-1-0/common/build/ufs/bin/QCM6490_bootbinaries.zip
34-
name: qcm6490_boot-binaries
35-
filename: qcm6490_boot-binaries.zip
111+
description: Download of {{ $board.boot_binaries_download.description }}
112+
url: {{ $board.boot_binaries_download.url }}
113+
name: {{ $board.boot_binaries_download.name }}
114+
filename: {{ $board.boot_binaries_download.filename }}
36115
- action: run
37-
description: Verify download
116+
description: Verify SHA256 sum of {{ $board.boot_binaries_download.description }}
38117
chroot: false
39-
command: echo 9c100d7b184ecf0ab9c4be71a8bb7c243fdc79a64380ca3025024dd2b14c5078 ${ROOTDIR}/../qcm6490_boot-binaries.zip|sha256sum --strict -c -
40-
{{- end }}
41-
42-
{{- if eq $build_qcm6490 "true" }}
118+
command:
119+
echo "{{ $board.boot_binaries_download.sha256sum }} ${ROOTDIR}/../{{ $board.boot_binaries_download.filename }}" |
120+
sha256sum --strict -c -
121+
{{- if $board.cdt_download }}
43122
- action: download
44-
description: Download RB3 Gen2 Vision Kit CDT
45-
url: https://artifacts.codelinaro.org/artifactory/codelinaro-le/Qualcomm_Linux/QCS6490/cdt/rb3gen2-vision-kit.zip
46-
name: qcs6490-rb3gen2-vision-kit_cdt
47-
filename: qcs6490-rb3gen2-vision-kit_cdt.zip
123+
description: Download of {{ $board.cdt_download.description }}
124+
url: {{ $board.cdt_download.url }}
125+
name: {{ $board.cdt_download.name }}
126+
filename: {{ $board.cdt_download.filename }}
48127
- action: run
49-
description: Verify download
128+
description: Verify SHA256 sum of {{ $board.cdt_download.description }}
50129
chroot: false
51-
command: echo a339e297b454c4dc3805fe8cd11d6d8dcb801aa8f0c2dc691561c2785019fa3c ${ROOTDIR}/../qcs6490-rb3gen2-vision-kit_cdt.zip|sha256sum --strict -c -
130+
command:
131+
echo "{{ $board.cdt_download.sha256sum }} ${ROOTDIR}/../{{ $board.cdt_download.filename }}" |
132+
sha256sum --strict -c -
133+
{{- end }}
52134
{{- end }}
53135

54136
- action: run
@@ -62,18 +144,24 @@ actions:
62144
# path to unpacked qcom-ptool tarball
63145
QCOM_PTOOL="${ROOTDIR}/../qcom-ptool.tar.gz.d/qcom-ptool-main"
64146
65-
{{- if eq $build_rb1 "true" }}
66-
## silicon family: qcm2290
67-
# use RB1 rescue image as there are no qcm2290 boot binaries published
68-
unzip -j "${ROOTDIR}/../qrb2210-rb1_rescue-image.zip" \
69-
-d build/qrb2210-rb1_rescue-image
147+
{{- range $board := $boards }}
148+
### board: {{ $board.name }}
149+
### platform: {{ $board.platform }}
150+
### silicon family: {{ $board.silicon_family }}
151+
152+
# unpack boot binaries
153+
mkdir -v build/{{ $board.name }}_boot-binaries
154+
unzip "${ROOTDIR}/../{{ $board.boot_binaries_download.filename }}" \
155+
-d build/{{ $board.name }}_boot-binaries/unpack
156+
# strip top directories
157+
mv build/{{ $board.name }}_boot-binaries/unpack/*/* build/{{ $board.name }}_boot-binaries
158+
rmdir -v build/{{ $board.name }}_boot-binaries/unpack/* build/{{ $board.name }}_boot-binaries/unpack
70159

71-
### platform: qrb2210-rb1
72160
# generate partition files
73-
mkdir -v build/qrb2210-rb1_partitions
161+
mkdir -v build/{{ $board.platform }}_partitions
74162
(
75-
cd build/qrb2210-rb1_partitions
76-
conf="${QCOM_PTOOL}/platforms/qrb2210-rb1/partitions.conf"
163+
cd build/{{ $board.platform }}_partitions
164+
conf="${QCOM_PTOOL}/platforms/{{ $board.platform }}/partitions.conf"
77165
"${QCOM_PTOOL}/gen_partition.py" -i "$conf" \
78166
-o ptool-partitions.xml
79167
# partitions.conf sets --type=emmc, nand or ufs
@@ -85,12 +173,12 @@ actions:
85173
"${QCOM_PTOOL}/ptool.py" -x ptool-partitions.xml
86174
)
87175

88-
#### board: qrb2210-rb1
89-
flash_dir="${ARTIFACTDIR}/flash_qrb2210-rb1"
176+
# create board-specific flash directory
177+
flash_dir="${ARTIFACTDIR}/flash_{{ $board.name }}"
90178
rm -rf "${flash_dir}"
91179
mkdir -v "${flash_dir}"
92180
# copy platform partition files
93-
cp --preserve=mode,timestamps -v build/qrb2210-rb1_partitions/* \
181+
cp --preserve=mode,timestamps -v build/{{ $board.platform }}_partitions/* \
94182
"${flash_dir}"
95183
# remove BLANK_GPT and WIPE_PARTITIONS files as it's common for people
96184
# to run "qdl rawprogram*.xml", mistakingly including these; perhaps
@@ -100,7 +188,7 @@ actions:
100188
rm -v "${flash_dir}"/rawprogram*_WIPE_PARTITIONS.xml
101189
# copy silicon family boot binaries; these shouldn't ship partition
102190
# files, but make sure not to accidentally clobber any such file
103-
find build/qrb2210-rb1_rescue-image \
191+
find build/{{ $board.name }}_boot-binaries \
104192
-not -name 'gpt_*' \
105193
-not -name 'patch*.xml' \
106194
-not -name 'rawprogram*.xml' \
@@ -116,96 +204,28 @@ actions:
116204
-or -name '*.mbn' \
117205
\) \
118206
-exec cp --preserve=mode,timestamps -v '{}' "${flash_dir}" \;
119-
# copy RB1 U-Boot binary to boot.img;
207+
{{- if $board.u_boot_file }}
208+
# copy U-Boot binary to boot.img;
120209
# qcom-ptool/platforms/*/partitions.conf uses filename=boot.img
121210
# boot_a and boot_b partitions
122-
cp --preserve=mode,timestamps -v "${ARTIFACTDIR}/{{- .u_boot_rb1 -}}" \
211+
cp --preserve=mode,timestamps -v "${ARTIFACTDIR}/{{ $board.u_boot_file }}" \
123212
"${flash_dir}/boot.img"
213+
{{- end }}
124214

125-
# update flashing files for ESP image;
126-
# qcom-ptool/platforms/*/partitions.conf uses filename=efi.bin for the
127-
# ESP partition on EFI capable platforms
128-
sed -i '/label="efi"/s#filename="[^"]*"#filename="../disk-sdcard.img1"#' \
129-
"${flash_dir}"/rawprogram*.xml
130-
131-
# update flashing files for rootfs image;
132-
# qcom-ptool/platforms/*/partitions.conf uses filename=rootfs.img for the
133-
# rootfs partition
134-
sed -i \
135-
'/label="rootfs"/s#filename="[^"]*"#filename="../disk-sdcard.img2"#' \
136-
"${flash_dir}"/rawprogram*.xml
137-
138-
# TODO: there is currently no dtb.bin alike system with the RB1 firmware
139-
140-
# TODO: currently not providing CDT; it's present in
141-
# RB1_firmware_20231124-v4.zip but not in
142-
# rb1-bootloader-emmc-linux-47528.zip
143-
{{- end }}
144-
145-
{{- if eq $build_qcm6490 "true" }}
146-
## silicon family: qcm6490
147-
# unpack boot binaries
148-
unzip -j "${ROOTDIR}/../qcm6490_boot-binaries.zip" \
149-
-d build/qcm6490_boot-binaries
150-
151-
### platform: qcs6490-rb3gen2
152-
# generate partition files
153-
mkdir -v build/qcs6490-rb3gen2_partitions
154-
(
155-
cd build/qcs6490-rb3gen2_partitions
156-
conf="${QCOM_PTOOL}/platforms/qcs6490-rb3gen2/partitions.conf"
157-
"${QCOM_PTOOL}/gen_partition.py" -i "$conf" \
158-
-o ptool-partitions.xml
159-
# partitions.conf sets --type=emmc, nand or ufs
160-
if grep -F '^--disk --type=ufs ' "${conf}"; then
161-
touch flash-ufs
162-
elif grep -F '^--disk --type=emmc ' "${conf}"; then
163-
touch flash-emmc
164-
fi
165-
"${QCOM_PTOOL}/ptool.py" -x ptool-partitions.xml
166-
)
167-
#### board qcs6490-rb3gen2-vision-kit
168-
flash_dir="${ARTIFACTDIR}/flash_qcs6490-rb3gen2-vision-kit"
169-
rm -rf "${flash_dir}"
170-
mkdir -v "${flash_dir}"
171-
# copy platform partition files
172-
cp --preserve=mode,timestamps -v build/qcs6490-rb3gen2_partitions/* \
173-
"${flash_dir}"
174-
# remove BLANK_GPT and WIPE_PARTITIONS files as it's common for people
175-
# to run "qdl rawprogram*.xml", mistakingly including these; perhaps
176-
# ptool should have a flag not to generate these; note that there are
177-
# wipe_rawprogram*.xml files still
178-
rm -v "${flash_dir}"/rawprogram*_BLANK_GPT.xml
179-
rm -v "${flash_dir}"/rawprogram*_WIPE_PARTITIONS.xml
180-
# copy silicon family boot binaries; these shouldn't ship partition
181-
# files, but make sure not to accidentally clobber any such file
182-
find build/qcm6490_boot-binaries \
183-
-not -name 'gpt_*' \
184-
-not -name 'patch*.xml' \
185-
-not -name 'rawprogram*.xml' \
186-
-not -name 'wipe*.xml' \
187-
-not -name 'zeros_*' \
188-
\( \
189-
-name LICENSE \
190-
-or -name Qualcomm-Technologies-Inc.-Proprietary \
191-
-or -name 'prog_*' \
192-
-or -name '*.bin' \
193-
-or -name '*.elf' \
194-
-or -name '*.fv' \
195-
-or -name '*.mbn' \
196-
\) \
197-
-exec cp --preserve=mode,timestamps -v '{}' "${flash_dir}" \;
215+
{{- if $board.cdt_download }}
198216
# unpack board CDT
199-
unzip -j "${ROOTDIR}/../qcs6490-rb3gen2-vision-kit_cdt.zip" \
200-
-d build/qcs6490-rb3gen2-vision-kit_cdt
217+
unzip "${ROOTDIR}/../{{ $board.cdt_download.filename }}" \
218+
-d build/{{ $board.name }}_cdt
201219
# copy just the CDT data; no partition or flashing files
202-
cp --preserve=mode,timestamps -v build/qcs6490-rb3gen2-vision-kit_cdt/cdt_vision_kit.bin \
220+
cp --preserve=mode,timestamps -v build/{{ $board.name }}_cdt/{{ $board.cdt_filename }} \
203221
"${flash_dir}"
204222

205223
# update flashing files for CDT
206-
sed -i '/label="cdt"/s/filename=""/filename="cdt_vision_kit.bin"/' \
224+
sed -i '/label="cdt"/s/filename=""/filename="{{ $board.cdt_filename }}"/' \
207225
"${flash_dir}"/rawprogram*.xml
226+
{{- end }}
208227

228+
{{- if $board.dtb }}
209229
# generate a dtb.bin FAT partition with just a single dtb for the current
210230
# board; long-term this should really be a set of dtbs and overlays as to
211231
# share dtb.bin across boards
@@ -218,28 +238,24 @@ actions:
218238
# in these and hold the target device tree, which is 4096 KiB sized
219239
# blocks for mkfs.vfat's last argument
220240
mkfs.vfat -S 4096 -C "${dtb_bin}" 4096
221-
# RB3 Gen2 Vision Kit will probably have a more specific DTB (see
222-
# <[email protected]> on lore.kernel.org)
223-
# but for now use the core kit one
224-
dtb="qcom/qcs6490-rb3gen2.dtb"
225241
# extract board device tree from the root filesystem provided tarball
226-
tar -C build -xvf "${ARTIFACTDIR}/dtbs.tar.gz" "${dtb}"
242+
tar -C build -xvf "${ARTIFACTDIR}/dtbs.tar.gz" "{{ $board.dtb }}"
227243
# copy into the FAT as combined-dtb.dtb
228-
mcopy -vmp -i "${dtb_bin}" "build/${dtb}" ::/combined-dtb.dtb
229-
244+
mcopy -vmp -i "${dtb_bin}" "build/{{ $board.dtb }}" ::/combined-dtb.dtb
230245
# (NB: flashing files already expect "dtb.bin" as a filename)
246+
{{- end }}
231247

232248
# update flashing files for ESP image;
233249
# qcom-ptool/platforms/*/partitions.conf uses filename=efi.bin for the
234250
# ESP partition on EFI capable platforms
235-
sed -i '/label="efi"/s#filename="[^"]*"#filename="../disk-ufs.img1"#' \
251+
sed -i '/label="efi"/s#filename="[^"]*"#filename="../disk-{{ $board.disk_image_type }}.img1"#' \
236252
"${flash_dir}"/rawprogram*.xml
237253

238254
# update flashing files for rootfs image;
239255
# qcom-ptool/platforms/*/partitions.conf uses filename=rootfs.img for the
240256
# rootfs partition
241257
sed -i \
242-
'/label="rootfs"/s#filename="[^"]*"#filename="../disk-ufs.img2"#' \
258+
'/label="rootfs"/s#filename="[^"]*"#filename="../disk-{{ $board.disk_image_type }}.img2"#' \
243259
"${flash_dir}"/rawprogram*.xml
244260
{{- end }}
245261

debos-recipes/qualcomm-linux-debian-rootfs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,8 @@ actions:
349349
ls -d "$ROOTDIR"/usr/lib/linux-image-* | sort -V | tail -1)"
350350
tar -C "${latest_kernel}" -cvzf "$ARTIFACTDIR/dtbs.tar.gz" \
351351
qcom/qcs6490-rb3gen2.dtb \
352+
qcom/qcs8300-ride.dtb \
353+
qcom/qcs9100-ride-r3.dtb \
352354
qcom/qrb2210-rb1.dtb
353355
354356
- action: pack

0 commit comments

Comments
 (0)