[U-Boot] [PATCH 1/1] test/py: use default load address for tftp

On x86_64 the size of the file u-boot loaded by the tftp test has grown in size such that when loading the file to 0x200000 it overwrites a memory area reserved for PCI.
If no load address is specified for tftp do not use the ram base address (or if zero 0x200000) but the default address.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de --- Currently there is a bug in net/tftp.c introduced by commit a156c47e39ad ("tftp: prevent overwriting reserved memory") which does not allow loading to the second DRAM bank. Simon Goldschmidt is working to fix it.
Due to this bug with the proposed patch we see a Travis CI error for vexpress_ca15_tc2_defconfig and vexpress_ca9x4_defconfig. --- test/py/tests/test_net.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/test/py/tests/test_net.py b/test/py/tests/test_net.py index 9c395e69fa..9ca6743afd 100644 --- a/test/py/tests/test_net.py +++ b/test/py/tests/test_net.py @@ -145,11 +145,12 @@ def test_net_tftpboot(u_boot_console): pytest.skip('No TFTP readable file to read')
addr = f.get('addr', None) - if not addr: - addr = u_boot_utils.find_ram_base(u_boot_console)
fn = f['fn'] - output = u_boot_console.run_command('tftpboot %x %s' % (addr, fn)) + if not addr: + output = u_boot_console.run_command('tftpboot %s' % (fn)) + else: + output = u_boot_console.run_command('tftpboot %x %s' % (addr, fn)) expected_text = 'Bytes transferred = ' sz = f.get('size', None) if sz: @@ -163,7 +164,7 @@ def test_net_tftpboot(u_boot_console): if u_boot_console.config.buildconfig.get('config_cmd_crc32', 'n') != 'y': return
- output = u_boot_console.run_command('crc32 %x $filesize' % addr) + output = u_boot_console.run_command('crc32 $fileaddr $filesize') assert expected_crc in output
@pytest.mark.buildconfigspec('cmd_nfs')

On Sat, Jan 26, 2019 at 03:25:12PM +0100, Heinrich Schuchardt wrote:
On x86_64 the size of the file u-boot loaded by the tftp test has grown in size such that when loading the file to 0x200000 it overwrites a memory area reserved for PCI.
If no load address is specified for tftp do not use the ram base address (or if zero 0x200000) but the default address.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
Currently there is a bug in net/tftp.c introduced by commit a156c47e39ad ("tftp: prevent overwriting reserved memory") which does not allow loading to the second DRAM bank. Simon Goldschmidt is working to fix it.
Yes, a real bug and good job sorting it out.
Due to this bug with the proposed patch we see a Travis CI error for vexpress_ca15_tc2_defconfig and vexpress_ca9x4_defconfig.
It's breaking with whatever additional changes you're testing. Please just put this change in your WIP branch until Simon has fixed the problem you've found. Alternatively, fork uboot-test-hooks and make your WIP trees use that fork which specifies a different address to use for tftp? Or am I missing something else? Thanks!

On 1/26/19 4:58 PM, Tom Rini wrote:
On Sat, Jan 26, 2019 at 03:25:12PM +0100, Heinrich Schuchardt wrote:
On x86_64 the size of the file u-boot loaded by the tftp test has grown in size such that when loading the file to 0x200000 it overwrites a memory area reserved for PCI.
If no load address is specified for tftp do not use the ram base address (or if zero 0x200000) but the default adI dress.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
Currently there is a bug in net/tftp.c introduced by commit a156c47e39ad ("tftp: prevent overwriting reserved memory") which does not allow loading to the second DRAM bank. Simon Goldschmidt is working to fix it.
Yes, a real bug and good job sorting it out.
Due to this bug with the proposed patch we see a Travis CI error for vexpress_ca15_tc2_defconfig and vexpress_ca9x4_defconfig.
It's breaking with whatever additional changes you're testing. Please just put this change in your WIP branch until Simon has fixed the problem you've found. Alternatively, fork uboot-test-hooks and make your WIP trees use that fork which specifies a different address to use for tftp? Or am I missing something else? Thanks!
I can well understand that you do not want to see this this patch merged before Simon Goldschimidt's patch.
Maybe I should have also added a reference to this patch:
x86: #define CONFIG_LOADADDR 0x1100000 https://lists.denx.de/pipermail/u-boot/2019-January/356108.html
All three corrections are needed to let the efi-next patch queue (https://github.com/agraf/u-boot/commits/efi-next) pass Travis CI testing.
Best regards
Heinrich

On 1/26/19 7:25 AM, Heinrich Schuchardt wrote:
On x86_64 the size of the file u-boot loaded by the tftp test has grown in size such that when loading the file to 0x200000 it overwrites a memory area reserved for PCI.
If no load address is specified for tftp do not use the ram base address (or if zero 0x200000) but the default address.
I assume that default is $loadaddr? If so, then this patch seems fine.

On 1/26/19 9:33 PM, Stephen Warren wrote:
On 1/26/19 7:25 AM, Heinrich Schuchardt wrote:
On x86_64 the size of the file u-boot loaded by the tftp test has grown in size such that when loading the file to 0x200000 it overwrites a memory area reserved for PCI.
If no load address is specified for tftp do not use the ram base address (or if zero 0x200000) but the default address.
I assume that default is $loadaddr? If so, then this patch seems fine.
Thanks for reviewing.
Yes, the address `tftp filename` uses is environment variable loadaddr.
This is specified in cmd/net.c, function netboot_common():
188 /* pre-set load_addr */ 189 s = env_get("loadaddr");
Best regards
Heinrich Schuchardt

On Sat, Jan 26, 2019 at 03:25:12PM +0100, Heinrich Schuchardt wrote:
On x86_64 the size of the file u-boot loaded by the tftp test has grown in size such that when loading the file to 0x200000 it overwrites a memory area reserved for PCI.
If no load address is specified for tftp do not use the ram base address (or if zero 0x200000) but the default address.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
Applied to u-boot/master, thanks!
participants (3)
-
Heinrich Schuchardt
-
Stephen Warren
-
Tom Rini