All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] Ethernet persistence
@ 2014-02-27 16:09 Anthony Mahar
  2014-02-28 10:22 ` Michal Simek
  2014-02-28 14:24 ` Simon Glass
  0 siblings, 2 replies; 5+ messages in thread
From: Anthony Mahar @ 2014-02-27 16:09 UTC (permalink / raw)
  To: u-boot

How can I make the ethernet connection persistent (after first use), rather
than reconnecting/re initializing on each reuse? 

I'm working with a Xilinx Zynq zc706 board and am up and running u-boot
quite successfully.  My main use case is to store u-boot in on-board flash,
and have u-boot tftp get / boot the bitstream, kernel image, devicetree, and
ramdisk image.  The following script functions well:
	"qspiboot=echo Configure PL and booting Linux from TFTP... && " \
		"fpga info 0;"						    \
		"tftp 0x1000000 system.bin;"				    \
		"fpga load 0 0x1000000 cb44bc;" \
		"tftp 0x3000000 ${kernel_image};" \
		"tftp 0x2A00000 ${devicetree_image};" \
		"tftp 0x2000000 ${ramdisk_image};" \
		"bootm 0x3000000 0x2000000 0x2A00000\0" \


The ethernet (Zynq's gem.e000b000) will get initialized on first use, as
appropriate, however the Ethernet is reinitialized and auto negotiated again
for each subsequent tftp request which shouldn't be necessary.  A snippet is
listed below.  Each 'reconnection' takes several seconds... a few to auto
negotiate, then a few more for the Windows based TFTP server to recognize
the connection and allow connections to the server.  Multiply this by the
number of transfers and it takes a very long time to transfer a very little
amount of data.

Snippet:

Xilinx Device
Descriptor @ 0x3ffbaf78
Family:         Zynq PL
Interface type: Device configuration interface (Zynq)
Device Size:    13321404 bytes
Cookie:         0x45 (69)
Device name:    7z045
No Device Function Table.
Gem.e000b000 Waiting for PHY auto negotiation to complete....... done
Using Gem.e000b000 device
TFTP from server 192.168.2.1; our IP address is 192.168.2.10
Filename 'system.bin'.
Load address: 0x1000000
Loading: T #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ###############################################################
         953.1 KiB/s
done
Bytes transferred = 13321404 (cb44bc hex)
Gem.e000b000:7 is connected to Gem.e000b000.  Reconnecting to Gem.e000b000
Gem.e000b000 Waiting for PHY auto negotiation to complete....... done
Using Gem.e000b000 device
TFTP from server 192.168.2.1; our IP address is 192.168.2.10
Filename 'uImage'.
Load address: 0x3000000
Loading: T #################################################################
         #################################################################
         #################################################################
         ################
         429.7 KiB/s
done







--
View this message in context: http://u-boot.10912.n7.nabble.com/Ethernet-persistence-tp174934.html
Sent from the U-Boot mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] Ethernet persistence
  2014-02-27 16:09 [U-Boot] Ethernet persistence Anthony Mahar
@ 2014-02-28 10:22 ` Michal Simek
  2014-02-28 14:24 ` Simon Glass
  1 sibling, 0 replies; 5+ messages in thread
From: Michal Simek @ 2014-02-28 10:22 UTC (permalink / raw)
  To: u-boot

On 02/27/2014 05:09 PM, Anthony Mahar wrote:
> How can I make the ethernet connection persistent (after first use), rather
> than reconnecting/re initializing on each reuse? 
> 
> I'm working with a Xilinx Zynq zc706 board and am up and running u-boot
> quite successfully.  My main use case is to store u-boot in on-board flash,
> and have u-boot tftp get / boot the bitstream, kernel image, devicetree, and
> ramdisk image.  The following script functions well:
> 	"qspiboot=echo Configure PL and booting Linux from TFTP... && " \
> 		"fpga info 0;"						    \
> 		"tftp 0x1000000 system.bin;"				    \
> 		"fpga load 0 0x1000000 cb44bc;" \
> 		"tftp 0x3000000 ${kernel_image};" \
> 		"tftp 0x2A00000 ${devicetree_image};" \
> 		"tftp 0x2000000 ${ramdisk_image};" \
> 		"bootm 0x3000000 0x2000000 0x2A00000\0" \
> 
> 
> The ethernet (Zynq's gem.e000b000) will get initialized on first use, as
> appropriate, however the Ethernet is reinitialized and auto negotiated again
> for each subsequent tftp request which shouldn't be necessary.  A snippet is
> listed below.  Each 'reconnection' takes several seconds... a few to auto
> negotiate, then a few more for the Windows based TFTP server to recognize
> the connection and allow connections to the server.  Multiply this by the
> number of transfers and it takes a very long time to transfer a very little
> amount of data.
> 
> Snippet:
> 
> Xilinx Device
> Descriptor @ 0x3ffbaf78
> Family:         Zynq PL
> Interface type: Device configuration interface (Zynq)
> Device Size:    13321404 bytes
> Cookie:         0x45 (69)
> Device name:    7z045
> No Device Function Table.
> Gem.e000b000 Waiting for PHY auto negotiation to complete....... done
> Using Gem.e000b000 device
> TFTP from server 192.168.2.1; our IP address is 192.168.2.10
> Filename 'system.bin'.
> Load address: 0x1000000
> Loading: T #################################################################
>          #################################################################
>          #################################################################
>          #################################################################
>          #################################################################
>          #################################################################
>          #################################################################
>          #################################################################
>          #################################################################
>          #################################################################
>          #################################################################
>          #################################################################
>          #################################################################
>          ###############################################################
>          953.1 KiB/s
> done
> Bytes transferred = 13321404 (cb44bc hex)
> Gem.e000b000:7 is connected to Gem.e000b000.  Reconnecting to Gem.e000b000
> Gem.e000b000 Waiting for PHY auto negotiation to complete....... done
> Using Gem.e000b000 device
> TFTP from server 192.168.2.1; our IP address is 192.168.2.10
> Filename 'uImage'.
> Load address: 0x3000000
> Loading: T #################################################################
>          #################################################################
>          #################################################################
>          ################
>          429.7 KiB/s
> done
> 

I am not sure if this is intention with phylib but this was bring up
with phylib. I still support non-phylib version in xilinx u-boot git version
(but it is not regularly tested).

Not sure what your system.bin is but if you use FIT then you can just download
one image.

Thanks
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140228/8eb09d47/attachment.pgp>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] Ethernet persistence
  2014-02-27 16:09 [U-Boot] Ethernet persistence Anthony Mahar
  2014-02-28 10:22 ` Michal Simek
@ 2014-02-28 14:24 ` Simon Glass
  2014-02-28 14:33   ` Michal Simek
  2014-02-28 17:33   ` Scott Wood
  1 sibling, 2 replies; 5+ messages in thread
From: Simon Glass @ 2014-02-28 14:24 UTC (permalink / raw)
  To: u-boot

Hi Anthony,

On 27 February 2014 09:09, Anthony Mahar <anthony.j.mahar@gmail.com> wrote:

> How can I make the ethernet connection persistent (after first use), rather
> than reconnecting/re initializing on each reuse?
>
> I'm working with a Xilinx Zynq zc706 board and am up and running u-boot
> quite successfully.  My main use case is to store u-boot in on-board flash,
> and have u-boot tftp get / boot the bitstream, kernel image, devicetree,
> and
> ramdisk image.  The following script functions well:
>         "qspiboot=echo Configure PL and booting Linux from TFTP... && " \
>                 "fpga info 0;"
>  \
>                 "tftp 0x1000000 system.bin;"
>  \
>                 "fpga load 0 0x1000000 cb44bc;" \
>                 "tftp 0x3000000 ${kernel_image};" \
>                 "tftp 0x2A00000 ${devicetree_image};" \
>                 "tftp 0x2000000 ${ramdisk_image};" \
>                 "bootm 0x3000000 0x2000000 0x2A00000\0" \
>
>
> The ethernet (Zynq's gem.e000b000) will get initialized on first use, as
> appropriate, however the Ethernet is reinitialized and auto negotiated
> again
> for each subsequent tftp request which shouldn't be necessary.  A snippet
> is
> listed below.  Each 'reconnection' takes several seconds... a few to auto
> negotiate, then a few more for the Windows based TFTP server to recognize
> the connection and allow connections to the server.  Multiply this by the
> number of transfers and it takes a very long time to transfer a very little
> amount of data.
>

Yes as Michal says you should use FIT and put everything in one file, or
less than 4. I'm not sure if we have a command to load your FPGA image from
FIT though. We could add one fairly easily now that we have
fit_image_load().

Also take a look at asix_init() in drivers/usb/eth, which does not re-init
the link if it is already up. This speeds things up.

Regards,
Simon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] Ethernet persistence
  2014-02-28 14:24 ` Simon Glass
@ 2014-02-28 14:33   ` Michal Simek
  2014-02-28 17:33   ` Scott Wood
  1 sibling, 0 replies; 5+ messages in thread
From: Michal Simek @ 2014-02-28 14:33 UTC (permalink / raw)
  To: u-boot

Hi Simon,

On 02/28/2014 03:24 PM, Simon Glass wrote:
> Hi Anthony,
> 
> On 27 February 2014 09:09, Anthony Mahar <anthony.j.mahar@gmail.com> wrote:
> 
>> How can I make the ethernet connection persistent (after first use), rather
>> than reconnecting/re initializing on each reuse?
>>
>> I'm working with a Xilinx Zynq zc706 board and am up and running u-boot
>> quite successfully.  My main use case is to store u-boot in on-board flash,
>> and have u-boot tftp get / boot the bitstream, kernel image, devicetree,
>> and
>> ramdisk image.  The following script functions well:
>>         "qspiboot=echo Configure PL and booting Linux from TFTP... && " \
>>                 "fpga info 0;"
>>  \
>>                 "tftp 0x1000000 system.bin;"
>>  \
>>                 "fpga load 0 0x1000000 cb44bc;" \
>>                 "tftp 0x3000000 ${kernel_image};" \
>>                 "tftp 0x2A00000 ${devicetree_image};" \
>>                 "tftp 0x2000000 ${ramdisk_image};" \
>>                 "bootm 0x3000000 0x2000000 0x2A00000\0" \
>>
>>
>> The ethernet (Zynq's gem.e000b000) will get initialized on first use, as
>> appropriate, however the Ethernet is reinitialized and auto negotiated
>> again
>> for each subsequent tftp request which shouldn't be necessary.  A snippet
>> is
>> listed below.  Each 'reconnection' takes several seconds... a few to auto
>> negotiate, then a few more for the Windows based TFTP server to recognize
>> the connection and allow connections to the server.  Multiply this by the
>> number of transfers and it takes a very long time to transfer a very little
>> amount of data.
>>
> 
> Yes as Michal says you should use FIT and put everything in one file, or
> less than 4. I'm not sure if we have a command to load your FPGA image from
> FIT though. We could add one fairly easily now that we have
> fit_image_load().

I have this on my todo list and definitely I would love to extend FIT image
with adding FPGA to it.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140228/51b7ebfd/attachment.pgp>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] Ethernet persistence
  2014-02-28 14:24 ` Simon Glass
  2014-02-28 14:33   ` Michal Simek
@ 2014-02-28 17:33   ` Scott Wood
  1 sibling, 0 replies; 5+ messages in thread
From: Scott Wood @ 2014-02-28 17:33 UTC (permalink / raw)
  To: u-boot

On Fri, 2014-02-28 at 07:24 -0700, Simon Glass wrote:
> Hi Anthony,
> 
> On 27 February 2014 09:09, Anthony Mahar <anthony.j.mahar@gmail.com> wrote:
> 
> > How can I make the ethernet connection persistent (after first use), rather
> > than reconnecting/re initializing on each reuse?
> >
> > I'm working with a Xilinx Zynq zc706 board and am up and running u-boot
> > quite successfully.  My main use case is to store u-boot in on-board flash,
> > and have u-boot tftp get / boot the bitstream, kernel image, devicetree,
> > and
> > ramdisk image.  The following script functions well:
> >         "qspiboot=echo Configure PL and booting Linux from TFTP... && " \
> >                 "fpga info 0;"
> >  \
> >                 "tftp 0x1000000 system.bin;"
> >  \
> >                 "fpga load 0 0x1000000 cb44bc;" \
> >                 "tftp 0x3000000 ${kernel_image};" \
> >                 "tftp 0x2A00000 ${devicetree_image};" \
> >                 "tftp 0x2000000 ${ramdisk_image};" \
> >                 "bootm 0x3000000 0x2000000 0x2A00000\0" \
> >
> >
> > The ethernet (Zynq's gem.e000b000) will get initialized on first use, as
> > appropriate, however the Ethernet is reinitialized and auto negotiated
> > again
> > for each subsequent tftp request which shouldn't be necessary.  A snippet
> > is
> > listed below.  Each 'reconnection' takes several seconds... a few to auto
> > negotiate, then a few more for the Windows based TFTP server to recognize
> > the connection and allow connections to the server.  Multiply this by the
> > number of transfers and it takes a very long time to transfer a very little
> > amount of data.
> >
> 
> Yes as Michal says you should use FIT and put everything in one file, or
> less than 4. I'm not sure if we have a command to load your FPGA image from
> FIT though. We could add one fairly easily now that we have
> fit_image_load().

FIT is not particularly convenient when repeatedly updating a single
component, and requires more work to assemble.  I thought it was meant
to replace old-style multi-image, not to deprecate individual images.

> Also take a look at asix_init() in drivers/usb/eth, which does not re-init
> the link if it is already up. This speeds things up.

So the question is why other ethernet drivers don't do this...

-Scott

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-28 17:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-27 16:09 [U-Boot] Ethernet persistence Anthony Mahar
2014-02-28 10:22 ` Michal Simek
2014-02-28 14:24 ` Simon Glass
2014-02-28 14:33   ` Michal Simek
2014-02-28 17:33   ` Scott Wood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.