UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
680 Views
Registered: ‎05-12-2012

How to boot Linux (U-BOOT, GMII2RGMII and TFTP)?

Jump to solution

Hi!

My custom board consist two Ethernets MACs connected thru EMIO by means of GMII2RGMII cores. I succesfully run last linux kernel and both interfaces work smoothly.

Now I want to boot my board from TFTP server. But as I can see u-boot does't support configuration of GMII2RGMII core. I inspect zynq_gem.c u-boot driver for it and I can not find any mention about GMII2RGMII core.

But I also read documentation on ethernet driver in u-boot and found this line in it: This driver can be used with gmii2rgmii converter driver

I'm frustrating a little about this now. Should I find a solution in existed driver, or may be I need to patch it to have needed functionality?

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
Adventurer
Adventurer
636 Views
Registered: ‎05-12-2012

Re: How to boot Linux (U-BOOT, GMII2RGMII and TFTP)?

Jump to solution

I already found a solution, by patching zynq_gem.c ethernet driver in u-boot.

In function static int zynq_gem_init(struct udevice *dev) I insert code that shown below:

 

	switch (priv->phydev->speed) {
		case SPEED_10: {
			priv->bus->write(priv->bus, 8, 8, 0x10, 0x0100);
			printf("Gmii2Rgmii adapter configuration 10 Mb/s done!\n");
		}
		break;

		case SPEED_100: {
			priv->bus->write(priv->bus, 8, 8, 0x10, 0x2000);
			printf("Gmii2Rgmii adapter configuration 100 Mb/s done!\n");
		}
		break;

		case SPEED_1000: {
			priv->bus->write(priv->bus, 8, 8, 0x10, 0x0040);
			printf("Gmii2Rgmii adapter configuration 1000 Mb/s done!\n");
		}
		break;
	}

i.e. configure GMII2GRMII adapter manually. May be too dirty, but it works. Finally I can boot from TFTP server. Anybody know a better solution?

 

0 Kudos
4 Replies
Xilinx Employee
Xilinx Employee
654 Views
Registered: ‎02-07-2018

Re: How to boot Linux (U-BOOT, GMII2RGMII and TFTP)?

Jump to solution

Hi @dm.pogrebnoy

Not verified tftp boot with your similar design, but in general below are the steps.

 

Run below commands in u-boot console:

1.dhcp   

2.setenv serverip <HOST IP ADDR>

3.run netboot;

You can setup the tftp server  in host side using below steps.

1. sudo apt-get install xinetd tftpd tftpd
2. sudo vim /etc/xinetd.d/tftp
3.Add the following structute in /etc/xinetd.d/tftp file if it not there or edit if it exists.
service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /tftpboot
disable = no
}

4. sudo service xinetd restart

Testing tftp sever:
1. cp <file > /tftpboot
2. sudo chmod 777 /tftpboot
3.tftp localhost 
4. get <filename>

If the file received successfully without any error from the tftpserver then tftp service is configured correctly.

 Thanks & regards

Aravind

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

 

0 Kudos
Adventurer
Adventurer
637 Views
Registered: ‎05-12-2012

Re: How to boot Linux (U-BOOT, GMII2RGMII and TFTP)?

Jump to solution

I already found a solution, by patching zynq_gem.c ethernet driver in u-boot.

In function static int zynq_gem_init(struct udevice *dev) I insert code that shown below:

 

	switch (priv->phydev->speed) {
		case SPEED_10: {
			priv->bus->write(priv->bus, 8, 8, 0x10, 0x0100);
			printf("Gmii2Rgmii adapter configuration 10 Mb/s done!\n");
		}
		break;

		case SPEED_100: {
			priv->bus->write(priv->bus, 8, 8, 0x10, 0x2000);
			printf("Gmii2Rgmii adapter configuration 100 Mb/s done!\n");
		}
		break;

		case SPEED_1000: {
			priv->bus->write(priv->bus, 8, 8, 0x10, 0x0040);
			printf("Gmii2Rgmii adapter configuration 1000 Mb/s done!\n");
		}
		break;
	}

i.e. configure GMII2GRMII adapter manually. May be too dirty, but it works. Finally I can boot from TFTP server. Anybody know a better solution?

 

0 Kudos
Xilinx Employee
Xilinx Employee
605 Views
Registered: ‎02-07-2018

Re: How to boot Linux (U-BOOT, GMII2RGMII and TFTP)?

Jump to solution

HI @dm.pogrebnoy

 

Thanks for sharing the solution.

 

Thanks & regards

Aravind

0 Kudos
Explorer
Explorer
554 Views
Registered: ‎06-03-2015

Re: How to boot Linux (U-BOOT, GMII2RGMII and TFTP)?

Jump to solution

Hi

Basically Ethernet boot support from u-boot : 

1st Part:

Adding Ethernet controller Mux pins in one function

Call the same function using structure 

Add ethernet controller register values in "Include " directory

2nd Part:

u-boot intilization code looks for set of I/O devices at the time of boot_init_r which will initilizes serial console, uart console & Ethernet console  (If so, it will call Mux pins structure and Mac controller register definitions from include directory)

Based on the above procedure, you are adding  the corrspending Mac controller Speed which will be one of configuration to make the PHY controller up and start transmitting packets, so the procedure followed by you is right.

If still have doubts, look for "Ethernet Porting on U-boot " , will giuve the same procedure 

 

Thanks & Regards

Satish G

 

 

 

 

 

 

 

 

 

 

G Satish Kumar
0 Kudos