[U-Boot] TFTP server support in U-boot

Dear All,
As of now in the U-boot only TFTP client is supported. I am planning to have TFTP server support in the u-boot. Can you please help me in this regarding?
Please provide me few links if this has been done already, or links from where i can take some information and start working on it.
Hope to get some advice on this soon from you.
Thanks, Santosh

Hello Santosh,
santosh pattar wrote:
Dear All,
As of now in the U-boot only TFTP client is supported. I am planning to have TFTP server support in the u-boot. Can you please help me in this regarding?
Please provide me few links if this has been done already, or links from where i can take some information and start working on it.
I believe this has come up before, so search the mail archives. I don't remember anybody posting a patch, though. In general, U-boot doesn't 'serve', so you have quite a bit of work to do. Luckily, TFTP is one of the more trivial protocols, hence the name.
I'm curious why you want to do this. People generally use U-boot as transient software for loading operating systems that are much more suitable for serving images. Do you have a situation where you have several identical devices and want to reduce the upstream network load? In that case, you may want to look into the multicast TFTP instead.
regards, Ben

Ben Warren wrote:
Hello Santosh,
santosh pattar wrote:
Dear All,
As of now in the U-boot only TFTP client is supported. I am planning to have TFTP server support in the u-boot. Can you please help me in this regarding?
Please provide me few links if this has been done already, or links from where i can take some information and start working on it.
I believe this has come up before, so search the mail archives. I don't remember anybody posting a patch, though. In general, U-boot doesn't 'serve', so you have quite a bit of work to do. Luckily, TFTP is one of the more trivial protocols, hence the name.
Do search the archives because my memory isn't what it used to be, but I don't recall a TFTP server coming up. Periodically FTP support comes up and then silently disappears when the requester figures out how much work it would be. Despite sharing 3/4 of the characters and supporting the same concept, TFTP and FTP are totally different animals.
I'm curious why you want to do this. People generally use U-boot as transient software for loading operating systems that are much more suitable for serving images. Do you have a situation where you have several identical devices and want to reduce the upstream network load? In that case, you may want to look into the multicast TFTP instead.
regards, Ben
If you really need this, I would suggest adding a simple (modal) "tftp server" command so that, when you execute the command all u-boot is doing is TFTP server work until something indicates "done" (e.g. a file was successfully transfered) and then the command exits. This would fit well into the u-boot restricted architecture that is characterized by being single threaded with no tasking.
Trying to do a full fledged tftp server that runs independently in the background is going to be a lot harder because there is no "background" in u-boot.
Best regards, gvb

Dear Ben,
Thank you very much for the suggestion. Actually i could able to get the TFTP server up in u-boot. This Server wont run in the background all the time. The senario is like this, Board comes up and checks for validation of the image on the flash. If the validation fails it switches to the server mode that is its in the listening mode. If any read/write (RRQ/WRQ) requests come to the board, it services them and as you suggested if complete/done command(file) comes it switches from server mode and continues with the regular operation.
Now i am able to service Read and write operations which come from TFTP client(PC based) .But this needs still lot of testing and validation. Can we make this as part of u-boot main line release? please let me know your views.
And if you say yes , we can make this as part of u-boot main line release then i would need help from your side in finding out the different test cases to test this fully.
Thank you very much for your suggestion.
Regards, santosh
On 12/16/08, Jerry Van Baren gerald.vanbaren@ge.com wrote:
Ben Warren wrote:
Hello Santosh,
santosh pattar wrote:
Dear All,
As of now in the U-boot only TFTP client is supported. I am planning to have TFTP server support in the u-boot. Can you please help me in this regarding?
Please provide me few links if this has been done already, or links from where i can take some information and start working on it.
I believe this has come up before, so search the mail archives. I don't remember anybody posting a patch, though. In general, U-boot doesn't 'serve', so you have quite a bit of work to do. Luckily, TFTP is one of the more trivial protocols, hence the name.
Do search the archives because my memory isn't what it used to be, but I don't recall a TFTP server coming up. Periodically FTP support comes up and then silently disappears when the requester figures out how much work it would be. Despite sharing 3/4 of the characters and supporting the same concept, TFTP and FTP are totally different animals.
I'm curious why you want to do this. People generally use U-boot as transient software for loading operating systems that are much more suitable for serving images. Do you have a situation where you have several identical devices and want to reduce the upstream network load? In that case, you may want to look into the multicast TFTP instead.
regards, Ben
If you really need this, I would suggest adding a simple (modal) "tftp server" command so that, when you execute the command all u-boot is doing is TFTP server work until something indicates "done" (e.g. a file was successfully transfered) and then the command exits. This would fit well into the u-boot restricted architecture that is characterized by being single threaded with no tasking.
Trying to do a full fledged tftp server that runs independently in the background is going to be a lot harder because there is no "background" in u-boot.
Best regards, gvb

Dear "santosh pattar",
In message 19f3dfd10812162008q27069e30uec230196911ba3f3@mail.gmail.com you wrote:
Thank you very much for the suggestion. Actually i could able to get the TFTP server up in u-boot. This Server wont run in the background all the time. The senario is like this, Board comes up and checks for validation of the image on the flash. If the validation fails it switches to the server mode that is its in the listening mode. If any read/write (RRQ/WRQ) requests come to the board, it services them and as you suggested if complete/done command(file) comes it switches from server mode and continues with the regular operation.
And why exactly cannot this be done using normal TFTP client mode that everybody else uses?
Best regards,
Wolfgang Denk

Hi Santosh,
santosh pattar wrote:
Dear Ben,
Thank you very much for the suggestion. Actually i could able to get the TFTP server up in u-boot. This Server wont run in the background all the time. The senario is like this, Board comes up and checks for validation of the image on the flash. If the validation fails it switches to the server mode that is its in the listening mode. If any read/write (RRQ/WRQ) requests come to the board, it services them and as you suggested if complete/done command(file) comes it switches from server mode and continues with the regular operation.
Now i am able to service Read and write operations which come from TFTP client(PC based) .But this needs still lot of testing and validation. Can we make this as part of u-boot main line release? please let me know your views.
I'm not yet convinced of the utility of a TFTP server, though. Lots of people validate the flash version and pull an image via TFTP if needed, but are able to do it using the TFTP client. It looks like you're downloading code to your board, using a 'put' operation from the Windows client, right? If the problem is that you don't have a TFTP server on your PC, there are plenty of free Windows TFTP servers out there. Google can help.
If, on the other hand, you can clearly explain why you need a server in U-boot, of course we'll listen and will accept patches that meet all of the standard criteria.
And if you say yes , we can make this as part of u-boot main line release then i would need help from your side in finding out the different test cases to test this fully.
Thank you very much for your suggestion.
Regards, santosh
regards, Ben
participants (4)
-
Ben Warren
-
Jerry Van Baren
-
santosh pattar
-
Wolfgang Denk