diff mbox series

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

Message ID 20190126142512.22498-1-xypron.glpk@gmx.de
State Accepted
Commit b1b1bab7f92b838a252ab977f56d9c3584c14fb7
Delegated to: Tom Rini
Headers show
Series [U-Boot,1/1] test/py: use default load address for tftp | expand

Commit Message

Heinrich Schuchardt Jan. 26, 2019, 2:25 p.m. UTC
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(-)

Comments

Tom Rini Jan. 26, 2019, 3:58 p.m. UTC | #1
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!
Heinrich Schuchardt Jan. 26, 2019, 4:25 p.m. UTC | #2
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
Stephen Warren Jan. 26, 2019, 8:33 p.m. UTC | #3
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.
Heinrich Schuchardt Jan. 26, 2019, 9:40 p.m. UTC | #4
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
Tom Rini Feb. 13, 2019, 12:56 a.m. UTC | #5
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!
diff mbox series

Patch

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')