[PATCH 0/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. 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

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.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de --- py/travis-ci/travis_tftp.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/py/travis-ci/travis_tftp.py b/py/travis-ci/travis_tftp.py index 7289e22..4ea5c06 100644 --- a/py/travis-ci/travis_tftp.py +++ b/py/travis-ci/travis_tftp.py @@ -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

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.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de --- 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(-)
diff --git a/py/travis-ci/u_boot_boardenv_qemu_arm64_na.py b/py/travis-ci/u_boot_boardenv_qemu_arm64_na.py index 80cba23..2986115 100644 --- a/py/travis-ci/u_boot_boardenv_qemu_arm64_na.py +++ b/py/travis-ci/u_boot_boardenv_qemu_arm64_na.py @@ -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) diff --git a/py/travis-ci/u_boot_boardenv_qemu_arm_na.py b/py/travis-ci/u_boot_boardenv_qemu_arm_na.py index 834edd0..391e3c4 100644 --- a/py/travis-ci/u_boot_boardenv_qemu_arm_na.py +++ b/py/travis-ci/u_boot_boardenv_qemu_arm_na.py @@ -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

On 12/4/19 11:42 PM, Heinrich Schuchardt wrote:
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.
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.

On 12/5/19 10:50 AM, Stephen Warren wrote:
On 12/4/19 11:42 PM, Heinrich Schuchardt wrote:
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.
The series looks fine to me; I hope to apply it tomorrow just in case there are other comments.
Patches applied. Thanks.
participants (2)
-
Heinrich Schuchardt
-
Stephen Warren