[U-Boot-Users] [PATCH] Set fileaddr and filesize environment variables upon download of a file

Hi everybody,
load-from-disk commands set the fileaddr and filesize environment variables upon completion. This patch adds the same functionality for load-from-network commands (BOOTP, TFTP, NFS, ...).
The fileaddr environment variable is set to the address at which the file has been loaded. The filesize environment variable is set to the size of the file in bytes.
This enables further commands to access the file (to copy it to flash memory for instance).
Laurent Pinchart

In message 200609201042.12600.laurent.pinchart@tbox.biz you wrote:
load-from-disk commands set the fileaddr and filesize environment variables upon completion. This patch adds the same functionality for load-from-network commands (BOOTP, TFTP, NFS, ...).
I reject your patch, as it is redundant.
The fileaddr environment variable is set to the address at which the file has
This is redundant. The information is already available in the loadaddr environment variable.
been loaded. The filesize environment variable is set to the size of the file in bytes.
This is redundant. The filesize variable already gets set by the current code.
Best regards,
Wolfgang Denk

In message 200609201042.12600.laurent.pinchart@tbox.biz you wrote:
load-from-disk commands set the fileaddr and filesize environment variables upon completion. This patch adds the same functionality for load-from-network commands (BOOTP, TFTP, NFS, ...).
I reject your patch, as it is redundant.
The fileaddr environment variable is set to the address at which the file has
This is redundant. The information is already available in the loadaddr environment variable.
The current code (git head) does not set the loadaddr environment variable upon completion of the tftpboot command.
You might have mistaken the purpose of my patch. The loadaddr environment variable is the default address used by load commands. The load-from-network commands already support the loadaddr variable. What my patch adds to the load-from-network commands is the ability to set the fileaddr and filesize variables, much like the load-from-disks commands do. This is not supported yet.
been loaded. The filesize environment variable is set to the size of the file in bytes.
This is redundant. The filesize variable already gets set by the current code.
Best regards,
Laurent Pinchart

In message 200610101121.54820.laurent.pinchart@tbox.biz you wrote:
You might have mistaken the purpose of my patch. The loadaddr environment variable is the default address used by load commands. The load-from-network commands already support the loadaddr variable. What my patch adds to the load-from-network commands is the ability to set the fileaddr and filesize variables, much like the load-from-disks commands do. This is not supported yet.
As mentioned before, your patch is redundand.
NetLoop() in "net/net.c" will set "fileaddr" after a succesful download. Also, "filesize" already gets set there.
This has been available for years.
Demo:
=> print fileaddr filesize ## Error: "fileaddr" not defined ## Error: "filesize" not defined => tftp 12345 /tftpboot/ocotea/uImage Waiting for PHY auto negotiation to complete.. done ENET Speed is 100 Mbps - FULL duplex connection Using ppc_4xx_eth0 device TFTP from server 192.168.1.1; our IP address is 192.168.80.2 Filename '/tftpboot/ocotea/uImage'. Load address: 0x12345 Loading: ################################################################# ################################################################# ########################################################## done Bytes transferred = 957895 (e9dc7 hex) => print fileaddr filesize fileaddr=12345 filesize=e9dc7 =>
I don't get what you want to add - what you're asking for is already there, and has been there for a long, long time.
Best regards,
Wolfgang Denk
participants (2)
-
Laurent Pinchart
-
Wolfgang Denk