Skip to content

Commit d805999

Browse files
committed
flash: Add support for RB1
README: document new u_boot_rb1 option Signed-off-by: Loïc Minier <[email protected]>
1 parent 65555ef commit d805999

File tree

2 files changed

+63
-7
lines changed

2 files changed

+63
-7
lines changed

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,17 @@ debos --fakemachine-backend qemu --memory 1GiB --scratchsize 4GiB debos-recipes/
4545
### Build options
4646

4747
A few options are provided in the debos recipes; for the root filesystem recipe:
48-
- experimentalkernel: update the linux kernel to the version from experimental; default: don't update the kernel
49-
- localdebs: install this space separte list of local deb packages (NB: debos expects relative pathnames)
50-
- xfcedesktop: install a Xfce desktop environment; default: console only environment
48+
- `experimentalkernel`: update the linux kernel to the version from experimental; default: don't update the kernel
49+
- `localdebs`: install this space separte list of local deb packages (NB: debos expects relative pathnames)
50+
- `xfcedesktop`: install a Xfce desktop environment; default: console only environment
5151

5252
For the image recipe:
53-
- dtb: override the firmware provided device tree with one from the linux kernel, e.g. `qcom/qcs6490-rb3gen2.dtb`; default: don't override
54-
- imagetype: either `ufs` (the default) or (`sdcard`); UFS images are named disk-ufs.img and use 4096 bytes sectors and SD card images are named disk-sdcard.img and use 512 bytes sectors
55-
- imagesize: set the output disk image size; default: `4GiB`
53+
- `dtb`: override the firmware provided device tree with one from the linux kernel, e.g. `qcom/qcs6490-rb3gen2.dtb`; default: don't override
54+
- `imagetype`: either `ufs` (the default) or (`sdcard`); UFS images are named disk-ufs.img and use 4096 bytes sectors and SD card images are named disk-sdcard.img and use 512 bytes sectors
55+
- `imagesize`: set the output disk image size; default: `4GiB`
56+
57+
For the flash recipe:
58+
- `u_boot_rb1`: prebuilt U-Boot binary for RB1 in Android boot image format -- see below (NB: debos expects relative pathnames)
5659

5760
Here are some example invocations:
5861
```bash

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

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
{{- $build_rb1 := "false" -}}
2+
{{- if .u_boot_rb1 -}}
3+
{{- $build_rb1 := "true" }}
4+
{{- end -}}
5+
16
architecture: arm64
27

38
actions:
@@ -8,6 +13,15 @@ actions:
813
filename: qcom-ptool.tar.gz
914
unpack: true
1015

16+
{{- if eq $build_rb1 "true" }}
17+
# TODO: consider switching to https://releases.linaro.org/96boards/rb1/qualcomm/firmware/RB1_firmware_20231124-v4.zip instead
18+
- action: download
19+
description: Download RB1 rescue image
20+
url: https://releases.linaro.org/96boards/rb1/linaro/rescue/23.12/rb1-bootloader-emmc-linux-47528.zip
21+
name: qrb2210-rb1_rescue-image.zip
22+
filename: qrb2210-rb1_rescue-image.zip
23+
{{- end -}}
24+
1125
- action: download
1226
description: Download QCM6490 boot binaries
1327
url: https://softwarecenter.qualcomm.com/download/software/chip/qualcomm_linux-spf-1-0/qualcomm-linux-spf-1-0_test_device_public/r1.0_00058.0/qcm6490-le-1-0/common/build/ufs/bin/QCM6490_bootbinaries.zip
@@ -21,7 +35,7 @@ actions:
2135
filename: rb3gen2-vision-kit_cdt.zip
2236

2337
- action: run
24-
description: Generate flash directories for UFS boards
38+
description: Generate flash directories for eMMC and UFS boards
2539
chroot: false
2640
command: |
2741
set -eux
@@ -31,6 +45,43 @@ actions:
3145
# path to unpacked qcom-ptool tarball
3246
QCOM_PTOOL="${ROOTDIR}/../qcom-ptool.tar.gz.d/qcom-ptool-main"
3347
48+
{{- if eq $build_rb1 "true" }}
49+
### board: qrb2210-rb1
50+
# unpack rescue image
51+
unzip -j "${ROOTDIR}/../qrb2210-rb1_rescue-image.zip" \
52+
-d build/qrb2210-rb1_rescue-image
53+
# TODO: on RB1, we don't generate partition files with ptool since its
54+
# partitions.conf does not have entries for data files from the rescue
55+
# image, while the rescue image defines useful partitions such as the ESP
56+
flash_dir="${ARTIFACTDIR}/flash_rb1"
57+
rm -rf "${flash_dir}"
58+
mkdir -v "${flash_dir}"
59+
# copy rescue image files
60+
cp --preserve=mode,timestamps -v build/qrb2210-rb1_rescue-image/* \
61+
"${flash_dir}"
62+
# copy RB1 U-Boot binary to u-boot-abootimg.img
63+
cp --preserve=mode,timestamps -v "${ARTIFACTDIR}/{{- .u_boot_rb1 -}}" \
64+
"${flash_dir}/u-boot-abootimg.img"
65+
66+
# update flashing file for RB1 U-Boot; in the rescue image, this
67+
# partition is blanked with boot-erase.img
68+
sed -i '/label="boot_a"/s/filename="[^"]*"/filename="u-boot-abootimg.img"/' "${flash_dir}"/rawprogram*.xml
69+
70+
# update flashing files for ESP image; in the rescue image, this
71+
# partition is blanked with boot-erase.img
72+
sed -i '/label="esp"/s#filename="[^"]*"#filename="../disk-sdcard.img1"#' "${flash_dir}"/rawprogram*.xml
73+
74+
# update flashing files for rootfs image;; in the rescue image, this
75+
# partition is not provisioned
76+
sed -i '/label="rootfs"/s#filename="[^"]*"#filename="../disk-sdcard.img2"#' "${flash_dir}"/rawprogram*.xml
77+
78+
# TODO: there is currently no dtb.bin alike system with the RB1 firmware
79+
80+
# TODO: currently not providing CDT; it's present in
81+
# RB1_firmware_20231124-v4.zip but not in
82+
# rb1-bootloader-emmc-linux-47528.zip
83+
{{- end -}}
84+
3485
## platform: QCM6490
3586
# unpack boot binaries
3687
unzip -j "${ROOTDIR}/../qcm6490_boot-binaries.zip" \
@@ -45,6 +96,8 @@ actions:
4596
# partitions.conf sets --type=emmc, nand or ufs
4697
if grep -F '^--disk --type=ufs ' "${conf}"; then
4798
touch flash-ufs
99+
elif grep -F '^--disk --type=emmc ' "${conf}"; then
100+
touch flash-emmc
48101
fi
49102
"${QCOM_PTOOL}/ptool.py" -x ptool-partitions.xml
50103
)

0 commit comments

Comments
 (0)