travis-ci: provide 'addr' in file2env()
cover travis-ci: provide 'addr' in file2env()
Function fetch_tftp_file() in test/py/tests/test_efi_loader.py expects that the dictionary describing a file contains an entry 'addr' specifying the loading address. Otherwise it defaults to the start of RAM. On qemu_arm64_defconfig and qemu_arm_defconfig this collides with the hardware supplied device tree.
Add an optional parameter in function file2env() to set the 'addr' entry.
Set the load address for files to the value of $kernel_addr_r for the qemu_arm64_defconfig and qemu_arm_defconfig boards to avoid collisions with the device tree.
Heinrich Schuchardt (2):
travis-ci: provide 'addr' in file2env()
travis-ci: set load address for files
py/travis-ci/travis_tftp.py | 18 ++++++++++++++++-- py/travis-ci/u_boot_boardenv_qemu_arm64_na.py | 6 +++--- py/travis-ci/u_boot_boardenv_qemu_arm_na.py | 6 +++--- 3 files changed, 22 insertions(+), 8 deletions(-)
--
2.24.0
PATCH 1/2 travis-ci: provide 'addr' in file2env()
Function fetch_tftp_file() in test/py/tests/test_efi_loader.py expects that the dictionary describing a file contains an entry 'addr' specifying the loading address.
Add an optional parameter in function file2env() to set the 'addr' entry.
--- py/travis-ci/travis_tftp.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
py/travis-ci/travis_tftp.py +16 -2
@@ -1,14 +1,28 @@ import os import binascii -def file2env(file_name): +def file2env(file_name, addr=None): + """Create dictionary describing file + + @filename: name of the file to be described + @addr: address used for loading the file as int (e.g. 0x40400000) + Return: dictionary describing the file with entries + * fn - filename + * size - file size in bytes + * crc32 - checksum using CRC-32 algorithm + * addr - loading address, optional + """ file_full = os.environ['UBOOT_TRAVIS_BUILD_DIR'] + "/" + file_name if not os.path.isfile(file_full): return None - return { + ret = { "fn": file_name, "size": os.path.getsize(file_full), "crc32": hex(binascii.crc32(open(file_full, 'rb').read()) & 0xffffffff)[2:], } + if addr is not None: + ret['addr'] = addr + + return ret
--
2.24.0
PATCH 2/2 travis-ci: set load address for files
In reply to Heinrich SchuchardtSet the load address for files to the value of $kernel_addr_r for the qemu_arm64_defconfig and qemu_arm_defconfig boards to avoid collisions with the device tree.
--- py/travis-ci/u_boot_boardenv_qemu_arm64_na.py | 6 +++--- py/travis-ci/u_boot_boardenv_qemu_arm_na.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
py/travis-ci/u_boot_boardenv_qemu_arm64_na.py +3 -3
@@ -3,6 +3,6 @@ import travis_tftp env__net_uses_pci = True env__net_dhcp_server = True -env__net_tftp_readable_file = travis_tftp.file2env('u-boot.bin') -env__efi_loader_helloworld_file = travis_tftp.file2env('lib/efi_loader/helloworld.efi') -env__efi_loader_grub_file = travis_tftp.file2env('grub_arm64.efi') +env__net_tftp_readable_file = travis_tftp.file2env('u-boot.bin', 0x40400000) +env__efi_loader_helloworld_file = travis_tftp.file2env('lib/efi_loader/helloworld.efi', 0x40400000) +env__efi_loader_grub_file = travis_tftp.file2env('grub_arm64.efi', 0x40400000)
py/travis-ci/u_boot_boardenv_qemu_arm_na.py +3 -3
@@ -3,6 +3,6 @@ import travis_tftp env__net_uses_pci = True env__net_dhcp_server = True -env__net_tftp_readable_file = travis_tftp.file2env('u-boot.bin') -env__efi_loader_helloworld_file = travis_tftp.file2env('lib/efi_loader/helloworld.efi') -env__efi_loader_grub_file = travis_tftp.file2env('grub_arm.efi') +env__net_tftp_readable_file = travis_tftp.file2env('u-boot.bin', 0x40400000) +env__efi_loader_helloworld_file = travis_tftp.file2env('lib/efi_loader/helloworld.efi', 0x40400000) +env__efi_loader_grub_file = travis_tftp.file2env('grub_arm.efi', 0x40400000)
--
2.24.0
cover travis-ci: provide 'addr' in file2env()
In reply to Heinrich SchuchardtQuoted 11 lines · Heinrich Schuchardt
Function
fetch_tftp_file()intest/py/tests/test_efi_loader.pyexpects that the dictionary describing a file contains an entry 'addr' specifying the loading address. Otherwise it defaults to the start of RAM. Onqemu_arm64_defconfigandqemu_arm_defconfigthis collides with the hardware supplied device tree.Add an optional parameter in function
file2env()to set the 'addr' entry.Set the load address for files to the value of $kernel_addr_r for the
qemu_arm64_defconfigandqemu_arm_defconfigboards to avoid collisions with the device tree.
The series looks fine to me; I hope to apply it tomorrow just in case there are other comments.
P.S. It might have been useful to mention the target repo in the patch subject or at least at the top of the cover letter, since it took me a few extra seconds to realize this was a patch to my hooks repo not U-Boot's test/py directory, which was confusing! "[hooks PATCH] ..." might have helped there.
cover travis-ci: provide 'addr' in file2env()
Quoted 11 lines · Stephen Warren
Quoted 10 lines · Heinrich Schuchardt
Function
fetch_tftp_file()intest/py/tests/test_efi_loader.pyexpects that
the dictionary describing a file contains an entry 'addr' specifying the loading address. Otherwise it defaults to the start of RAM. Onqemu_arm64_defconfigandqemu_arm_defconfigthis collides with the hardware
supplied device tree.Add an optional parameter in function
file2env()to set the 'addr' entry.
Quoted 7 lines
Quoted 4 lines
Set the load address for files to the value of $kernel_addr_r for the
qemu_arm64_defconfigandqemu_arm_defconfigboards to avoid collisions with
the device tree.The series looks fine to me; I hope to apply it tomorrow just in case there are other comments.
Patches applied. Thanks.