[u-boot-test-hooks PATCH 1/7] travis-ci: Add qemu_arm_spl board

From: Tuomas Tynkkynen tuomas.tynkkynen@iki.fi
This is similar to the existing qemu_arm target, except that the 'bios' is image.bin (containing both SPL and U-Boot) rather than in u-boot.bin
Signed-off-by: Simon Glass sjg@chromium.org ---
bin/travis-ci/conf.qemu_arm_spl_na | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 bin/travis-ci/conf.qemu_arm_spl_na
diff --git a/bin/travis-ci/conf.qemu_arm_spl_na b/bin/travis-ci/conf.qemu_arm_spl_na new file mode 100644 index 0000000..18c7fe5 --- /dev/null +++ b/bin/travis-ci/conf.qemu_arm_spl_na @@ -0,0 +1,31 @@ +# Copyright 2021 Google LLC +# Based on conf.vexpress_ca15_tc2_qemu which is: +# Copyright (c) 2016 Konsulko Group. All rights reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +console_impl=qemu +qemu_machine="virt" +qemu_binary="qemu-system-arm" +qemu_extra_args="-nographic -netdev user,id=net0,tftp=${UBOOT_TRAVIS_BUILD_DIR} -device e1000,netdev=net0 -device virtio-rng-pci" + +# Uses image.bin which contains SPL and U-Boot +qemu_kernel_args="-bios ${U_BOOT_BUILD_DIR}/image.bin" +reset_impl=none +flash_impl=none

Add a comment about the tools and drop the debugging, since this seems reliable now.
Signed-off-by: Simon Glass sjg@chromium.org ---
bin/flash.sdwire_relay_mount | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/bin/flash.sdwire_relay_mount b/bin/flash.sdwire_relay_mount index 4713c2f..f75d33f 100644 --- a/bin/flash.sdwire_relay_mount +++ b/bin/flash.sdwire_relay_mount @@ -21,12 +21,14 @@ # Designed for using SDwire uSD mux and selected power control: # https://wiki.tizen.org/SDWire
+# It requires these tools: +# sd-mux-ctrl at https://git.tizen.org/cgit/tools/testlab/sd-mux/ +# usbrelay + . poweroff.${power_impl}
sleep 0.1 -echo common
. flash.sdwire_common_mount
. poweron.${power_impl} -echo flash done

On Sat, Oct 30, 2021 at 12:25:34PM -0600, Simon Glass wrote:
Add a comment about the tools and drop the debugging, since this seems reliable now.
Signed-off-by: Simon Glass sjg@chromium.org
Applied to u-boot-test-hooks/master, thanks!

Just to be safe, check for the pattern only at the start of a line, since it is possible to add a comment with this in it.
Signed-off-by: Simon Glass sjg@chromium.org ---
bin/writer.rpi3_mount | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/writer.rpi3_mount b/bin/writer.rpi3_mount index 7b078a1..97f24a5 100755 --- a/bin/writer.rpi3_mount +++ b/bin/writer.rpi3_mount @@ -41,7 +41,7 @@ fi
# Enable the UART and fix the GPU frequency so it works correctly sed -i '/enable_uart/c\enable_uart = 1' /media/rpi3_b_boot/config.txt -if ! grep -q gpu_freq=250 /media/rpi3_b_boot/config.txt; then +if ! grep -q "^gpu_freq=250" /media/rpi3_b_boot/config.txt; then echo 'gpu_freq=250' >>/media/rpi3_b_boot/config.txt fi

On Sat, Oct 30, 2021 at 12:25:35PM -0600, Simon Glass wrote:
Just to be safe, check for the pattern only at the start of a line, since it is possible to add a comment with this in it.
Signed-off-by: Simon Glass sjg@chromium.org
Applied to u-boot-test-hooks/master, thanks!

This code is duplicated in two scripts. Put it into a new wait_raw_device to avoid this. Also rename the 'done' variable to 'complete' to void confusing it with the end of the for loop.
Signed-off-by: Simon Glass sjg@chromium.org ---
bin/flash.sdwire_digital-loggers_raw | 15 +----------- bin/flash.sdwire_poweroff_raw | 15 +----------- bin/wait_raw_device | 34 ++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 28 deletions(-) create mode 100644 bin/wait_raw_device
diff --git a/bin/flash.sdwire_digital-loggers_raw b/bin/flash.sdwire_digital-loggers_raw index 7d5fbc9..f9956f7 100644 --- a/bin/flash.sdwire_digital-loggers_raw +++ b/bin/flash.sdwire_digital-loggers_raw @@ -33,20 +33,7 @@ curl --data ${power_port}=OFF -o /dev/null --silent \ # Switch over to get USB card access sd-mux-ctrl --device-serial ${sdwire_serial} --ts
-# Wait for the device to become available -done=false -for i in {0..9}; do - if dd if=${raw_device} of=/dev/null count=1 >/dev/null 2>&1; then - done=true - break - fi - - sleep 1 -done -if [[ $done = false ]]; then - echo "Failed to access ${raw_device} after 10 tries" - exit 1 -fi +. wait_raw_device
writer.${flash_writer} ${raw_device} ${U_BOOT_BUILD_DIR}
diff --git a/bin/flash.sdwire_poweroff_raw b/bin/flash.sdwire_poweroff_raw index 28fa096..d82a3ef 100644 --- a/bin/flash.sdwire_poweroff_raw +++ b/bin/flash.sdwire_poweroff_raw @@ -34,20 +34,7 @@ mount_dir=/media/${mount_point} # Switch over to get USB card access sd-mux-ctrl --device-serial ${sdwire_serial} --ts
-# Wait for the device to become available -done=false -for i in {0..9}; do - if dd if=${raw_device} of=/dev/null count=1 >/dev/null 2>&1; then - done=true - break - fi - - sleep 1 -done -if [[ $done = false ]]; then - echo "Failed to access ${raw_device} after 10 tries" - exit 1 -fi +. wait_raw_device
writer.${flash_writer} ${raw_device} ${U_BOOT_BUILD_DIR}
diff --git a/bin/wait_raw_device b/bin/wait_raw_device new file mode 100644 index 0000000..c292114 --- /dev/null +++ b/bin/wait_raw_device @@ -0,0 +1,34 @@ +# Copyright 2021 Google LLC +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +# Wait for the device ${raw_device} to become available +complete=false +for i in {0..9}; do + if dd if=${raw_device} of=/dev/null count=1 >/dev/null 2>&1; then + complete=true + break + fi + + sleep 1 +done +if [[ $complete = false ]]; then + echo "Failed to access ${raw_device} after 10 tries" + exit 1 +fi

On Sat, Oct 30, 2021 at 12:25:36PM -0600, Simon Glass wrote:
This code is duplicated in two scripts. Put it into a new wait_raw_device to avoid this. Also rename the 'done' variable to 'complete' to void confusing it with the end of the for loop.
Signed-off-by: Simon Glass sjg@chromium.org
Applied to u-boot-test-hooks/master, thanks!

Sometimes the umount takes a while. Add the same wait loop as is used for mount. Also rename the 'done' variable to 'complete' to void confusing it with the end of the for loop.
Signed-off-by: Simon Glass sjg@chromium.org ---
bin/flash.sdwire_common_mount | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/bin/flash.sdwire_common_mount b/bin/flash.sdwire_common_mount index d696abb..6c763e6 100644 --- a/bin/flash.sdwire_common_mount +++ b/bin/flash.sdwire_common_mount @@ -25,10 +25,10 @@ mount_dir=/media/${mount_point} # Switch over to get USB card access sd-mux-ctrl --device-serial ${sdwire_serial} --ts
-done=false +complete=false for i in {0..9}; do if out="$(mount UUID=${mount_uuid} 2>&1)"; then - done=true + complete=true break fi echo $out @@ -41,7 +41,7 @@ for i in {0..9}; do fi sleep 1 done -if [[ $done = false ]]; then +if [[ $complete = false ]]; then echo "Failed to mount UUID ${mount_uuid} after 10 tries" exit 1 fi @@ -53,7 +53,27 @@ if ! mountpoint -q ${mount_dir}; then fi
writer.${flash_writer} ${mount_dir} ${U_BOOT_BUILD_DIR} -umount ${mount_dir} + +complete=false +for i in {0..9}; do + if out="$(umount ${mount_dir} 2>&1)"; then + complete=true + break + fi + echo $out + sleep 1 +done + +if [[ $complete = false ]]; then + echo "Failed to umount UUID ${mount_uuid} after 10 tries" + exit 1 +fi + +# Sanity check +if mountpoint -q ${mount_dir}; then + echo "Mount ${mount_dir} still available after 'umount'" + exit 1 +fi
# Back to card access for the DUT sd-mux-ctrl --device-serial ${sdwire_serial} --dut

On Sat, Oct 30, 2021 at 12:25:37PM -0600, Simon Glass wrote:
Sometimes the umount takes a while. Add the same wait loop as is used for mount. Also rename the 'done' variable to 'complete' to void confusing it with the end of the for loop.
Signed-off-by: Simon Glass sjg@chromium.org
Applied to u-boot-test-hooks/master, thanks!

Add a config for samus, the Chromebook Pixel 2.
Signed-off-by: Simon Glass sjg@chromium.org ---
bin/kea/conf.chromebook_samus_sjg-samus | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 bin/kea/conf.chromebook_samus_sjg-samus
diff --git a/bin/kea/conf.chromebook_samus_sjg-samus b/bin/kea/conf.chromebook_samus_sjg-samus new file mode 100644 index 0000000..0e7db49 --- /dev/null +++ b/bin/kea/conf.chromebook_samus_sjg-samus @@ -0,0 +1,30 @@ +# Copyright 2021 Google LLC +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +reset_impl=servo +flash_impl=em100 +power_impl=servo + +em100_chip=W25Q64FV +em100_serial=DP033694 + +servo_name=samus + +. ubtest_common

On Sat, Oct 30, 2021 at 12:25:38PM -0600, Simon Glass wrote:
Add a config for samus, the Chromebook Pixel 2.
Signed-off-by: Simon Glass sjg@chromium.org
Applied to u-boot/master, thanks!

Add some symlinks so that qemu can be used on ellesmere.
Signed-off-by: Simon Glass sjg@chromium.org ---
bin/ellesmere/conf.qemu_arm_na | 1 + bin/ellesmere/conf.qemu_arm_spl_na | 1 + 2 files changed, 2 insertions(+) create mode 120000 bin/ellesmere/conf.qemu_arm_na create mode 120000 bin/ellesmere/conf.qemu_arm_spl_na
diff --git a/bin/ellesmere/conf.qemu_arm_na b/bin/ellesmere/conf.qemu_arm_na new file mode 120000 index 0000000..aa91a9f --- /dev/null +++ b/bin/ellesmere/conf.qemu_arm_na @@ -0,0 +1 @@ +../travis-ci/conf.qemu_arm_na \ No newline at end of file diff --git a/bin/ellesmere/conf.qemu_arm_spl_na b/bin/ellesmere/conf.qemu_arm_spl_na new file mode 120000 index 0000000..e171c5a --- /dev/null +++ b/bin/ellesmere/conf.qemu_arm_spl_na @@ -0,0 +1 @@ +../travis-ci/conf.qemu_arm_spl_na \ No newline at end of file

On Sat, Oct 30, 2021 at 12:25:39PM -0600, Simon Glass wrote:
Add some symlinks so that qemu can be used on ellesmere.
Signed-off-by: Simon Glass sjg@chromium.org
bin/ellesmere/conf.qemu_arm_na | 1 + bin/ellesmere/conf.qemu_arm_spl_na | 1 + 2 files changed, 2 insertions(+) create mode 120000 bin/ellesmere/conf.qemu_arm_na create mode 120000 bin/ellesmere/conf.qemu_arm_spl_na
Alright, so I think the best use of the public u-boot-test-hooks is to have first public CI used scripts (aka everything in {bin,py}/travis-ci) and then we should move to having a reference directory. It's not useful to everyone for example to have symlinks like these here, for your lab. But it is very useful to have things like bin/kea/conf.orangepi_pc_sjg-opi_pc which I used locally the other day to make bin/bill-the-cat/conf.pine64_plus_na and I think everyone would benefit from something like bin/references/conf.sunxi_with_sdwire_and_digital-loggers so that anyone else can figure out how to plumb in their own sunxi platform with sdwire and then whatever reference they also need for power control, if not a digital-loggers type "curl" solution.

Hi Tom,
On Sun, 31 Oct 2021 at 10:57, Tom Rini trini@konsulko.com wrote:
On Sat, Oct 30, 2021 at 12:25:39PM -0600, Simon Glass wrote:
Add some symlinks so that qemu can be used on ellesmere.
Signed-off-by: Simon Glass sjg@chromium.org
bin/ellesmere/conf.qemu_arm_na | 1 + bin/ellesmere/conf.qemu_arm_spl_na | 1 + 2 files changed, 2 insertions(+) create mode 120000 bin/ellesmere/conf.qemu_arm_na create mode 120000 bin/ellesmere/conf.qemu_arm_spl_na
Alright, so I think the best use of the public u-boot-test-hooks is to have first public CI used scripts (aka everything in {bin,py}/travis-ci) and then we should move to having a reference directory. It's not useful to everyone for example to have symlinks like these here, for your lab. But it is very useful to have things like bin/kea/conf.orangepi_pc_sjg-opi_pc which I used locally the other day to make bin/bill-the-cat/conf.pine64_plus_na and I think everyone would benefit from something like bin/references/conf.sunxi_with_sdwire_and_digital-loggers so that anyone else can figure out how to plumb in their own sunxi platform with sdwire and then whatever reference they also need for power control, if not a digital-loggers type "curl" solution.
OK. Can you apply the other patches? Then I'll check and try some renames.
Regards, Simon

On Sun, Oct 31, 2021 at 12:22:48PM -0600, Simon Glass wrote:
Hi Tom,
On Sun, 31 Oct 2021 at 10:57, Tom Rini trini@konsulko.com wrote:
On Sat, Oct 30, 2021 at 12:25:39PM -0600, Simon Glass wrote:
Add some symlinks so that qemu can be used on ellesmere.
Signed-off-by: Simon Glass sjg@chromium.org
bin/ellesmere/conf.qemu_arm_na | 1 + bin/ellesmere/conf.qemu_arm_spl_na | 1 + 2 files changed, 2 insertions(+) create mode 120000 bin/ellesmere/conf.qemu_arm_na create mode 120000 bin/ellesmere/conf.qemu_arm_spl_na
Alright, so I think the best use of the public u-boot-test-hooks is to have first public CI used scripts (aka everything in {bin,py}/travis-ci) and then we should move to having a reference directory. It's not useful to everyone for example to have symlinks like these here, for your lab. But it is very useful to have things like bin/kea/conf.orangepi_pc_sjg-opi_pc which I used locally the other day to make bin/bill-the-cat/conf.pine64_plus_na and I think everyone would benefit from something like bin/references/conf.sunxi_with_sdwire_and_digital-loggers so that anyone else can figure out how to plumb in their own sunxi platform with sdwire and then whatever reference they also need for power control, if not a digital-loggers type "curl" solution.
OK. Can you apply the other patches? Then I'll check and try some renames.
I'll review the rest of the series soon, yes.

Hi,
On 30.10.2021 21.25, Simon Glass wrote:
From: Tuomas Tynkkynen tuomas.tynkkynen@iki.fi
^ Some mishap with the From: line here, since I did not write the patch?
This is similar to the existing qemu_arm target, except that the 'bios' is image.bin (containing both SPL and U-Boot) rather than in u-boot.bin
Signed-off-by: Simon Glass sjg@chromium.org

On Sat, Oct 30, 2021 at 12:25:33PM -0600, Simon Glass wrote:
From: Tuomas Tynkkynen tuomas.tynkkynen@iki.fi
This is similar to the existing qemu_arm target, except that the 'bios' is image.bin (containing both SPL and U-Boot) rather than in u-boot.bin
Signed-off-by: Simon Glass sjg@chromium.org
Aside from the wrong-From, for a v2 in the future, I'm holding off on this until the passage stuff which makes use of this, is closer to going in.
participants (3)
-
Simon Glass
-
Tom Rini
-
Tuomas Tynkkynen