Skip to contentSkip to conversation

Set fileaddr and filesize environment variables upon download of a file

PATCH New Laurent Pinchart 2 participants 4 messages Sep 20, 2006 – Oct 10, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmd_net.patch
Type: text/x-diff
Size: 581 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20060920/cea01ea0/attachment.patch

#1 lore raw

PATCH 1/1 Set fileaddr and filesize environment variables upon download of a file

Quoted 4 lines · In message <[email protected]> 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.

Quoted 1 line

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.

Quoted 2 lines

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

Signature · 5 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Einstein argued that there must be simplified explanations of nature,
because God is not capricious or arbitrary. No  such  faith  comforts
the software engineer.                             - Fred Brooks, Jr.
#2 lore raw

PATCH 1/1 Set fileaddr and filesize environment variables upon download of a file

Quoted 5 lines
Quoted 3 lines · In message <[email protected]> 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, ...).

Quoted 7 lines

I reject your patch, as it is redundant.

Quoted 2 lines

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.

Quoted 5 lines
Quoted 2 lines

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

#3 lore raw

PATCH 1/1 Set fileaddr and filesize environment variables upon download of a file

Quoted 7 lines · In message <[email protected]> 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

Signature · 7 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
That's their goal, remember, a goal that's really contrary to that of
the programmer or administrator. We just want to get our  jobs  done.
$Bill  just  wants  to  become  $$Bill. These aren't even marginallly
congruent.
         -- Tom Christiansen in <[email protected]>