Intel® SoC FPGA Embedded Development Suite
Support for SoC FPGA Software Development, SoC FPGA HPS Architecture, HPS SoC Boot and Configuration, Operating Systems

EMAC drivers Agilex5

K606
New Contributor III
818 Views

I would like to use these Altera drivers (Driver 0, Driver 1) for the EMACs on the Agilex5.

They seem to be compatible as followed:

 

compatible = "altr,socfpga-stmmac-a10-s10",
		"snps,dwxgmac-2.10",
		"snps,dwxgmac";

 

My question is: is it possible to use these drivers without connecting to a PHY? Or do they need a PHY to be instantiated and tested?

 

And if so - would the followin .dts change be sufficient?

&gmac0 {
	status = "okay";
};

&gmac1 {
	status = "okay";
};

Thanks,

K

0 Kudos
1 Solution
MattG_Altera
Employee
700 Views

I am not an expert on the GMII interface, but your connections look correct to me. Clocks and resets need to be connected appropriately, and the tx related signals of one ethernet need to be connected to corresponding rx related signals on the other ethernet.

 

You'll know you have the connections correct when link gets established on both ends as observed with ifconfig or ip commands.

View solution in original post

4 Replies
MattG_Altera
Employee
789 Views

I can think of two possible use cases to use the ethernet drivers without connecting the device to an external phy:

  • Enable loopback on the internal devices.
  • Connect emac0 and emac1 together in the FPGA.

In either case, your suggested device tree change is sufficient to properly bind the driver instances to the devices.

K606
New Contributor III
737 Views

Hi Matt,

 

I like the idea of the 2nd one you suggested.

 

Looking into the EMAC interface provided by the Agilex5 HPS - I can see that the connections are GMII.

 

Would I be correct to say that to connect the two it would look like this (1Gbps):

    assign emac0_app_rst_reset_n_wire = rst_n;                  // Same reset as all other comonents in Qsys top level design
    //assign emac0_mac_tx_clk_i_wire = clk;                     // not used in 1/2.5 Gbps
    assign emac0_mac_rx_clk_wire = emac1_mac_tx_clk_o_wire;     // emac0 rx clock = emac1 tx clock
    assign emac0_mac_rxdv_wire = emac1_mac_txen_wire;           // emac0 data valid  = emac1 enable
    assign emac0_mac_rxer_wire = emac1_mac_txer_wire;           // emac0 rx error = emac1 tx error
    assign emac0_mac_rxd_wire = emac1_mac_txd_o_wire;           // emac0 data in =  emac1 data out
    //assign emac0_mac_col_wire = 1'b0;                         // unused since not using half duplex
    assign emac0_mac_crs_wire = 1'b1;                           // signal is never idle

With symmetrical design for emac1?

 

I suppose I just need to know how to feed in to each block correct clock, reset, enable and valid signals given that there is no PHY involved 

0 Kudos
MattG_Altera
Employee
701 Views

I am not an expert on the GMII interface, but your connections look correct to me. Clocks and resets need to be connected appropriately, and the tx related signals of one ethernet need to be connected to corresponding rx related signals on the other ethernet.

 

You'll know you have the connections correct when link gets established on both ends as observed with ifconfig or ip commands.

Jeet14
Employee
601 Views

I’m glad that your question has been addressed, I now transition this thread to community support. If you have a new question, Please login to ‘https://supporttickets.intel.com/s/?language=en_US’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.


0 Kudos
Reply