01-04-2016 03:09 AM
Hello,
In petalinux 2015.4, the configuration for ethernet is provided with "cdns,gem" compatible.
In the "cdns,gem" Timestamping Unit cpabability (MACB_CAPS_TSU) is not enabled.
But in "cdns,zynqmp-gem" Timestamping Unit cpabability is enabled (.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO | MACB_CAPS_TSU). If i want to change the compatible in device tree to "cdns,zynqmp-gem" what are the other details i have to change.
gem0: ethernet@e000b000 {
compatible = "cdns,gem";
reg = <0xe000b000 0x1000>;
status = "disabled";
interrupts = <0 22 4>;
clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
clock-names = "pclk", "hclk", "tx_clk";
#address-cells = <1>;
#size-cells = <0>;
};
Thanks,
Karikalan K
01-04-2016 06:23 AM
Hi Karikalan,
That compatible string is for the MAC that is in the Zynq MPSOC, but not in Zynq 7000 if that's what you are thinking.
Thanks
John
01-04-2016 09:29 PM
Hello John,
Thanks for your response.
I think i am not little bit clear with my query.
Let me breif, my agenda is to achecive Hardware Time staming for PTP messages and my processor is Xilinx XC7Z020.
When i boot up the board with petalinux, ptp clock is not reflected in "/dev/".
While debugging the source code of ethernet driver (MACB), i found that ptp initialization is happening after checking the capability of the device.
if ((gem_readl(bp, DCFG5) & GEM_BIT(TSU)) &&
(bp->caps & MACB_CAPS_TSU)) {
macb_ptp_init(bp);
}
In parallel i checked the MAC configuration in device tree of "zynq-7000". It is configured with "cdns,gem".
gem0: ethernet@e000b000 {
compatible = "cdns,gem";
reg = <0xe000b000 0x1000>;
status = "disabled";
interrupts = <0 22 4>;
clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
clock-names = "pclk", "hclk", "tx_clk";
#address-cells = <1>;
#size-cells = <0>;
};
In ethernet driver (macb.c), the device capability configurtion corresponding to "cdns,gem" is not configured with "MACB_CAPS_TSU", so ptp is not intialised.
But "MACB_CAPS_TSU" is enabled in "cdns,zynqmp-gem",
static const struct of_device_id macb_dt_ids[] = {
{ .compatible = "cdns,at32ap7000-macb" },
{ .compatible = "cdns,at91sam9260-macb" },
{ .compatible = "cdns,macb" },
{ .compatible = "cdns,pc302-gem", .data = &pc302gem_config },
{ .compatible = "cdns,gem", .data = &pc302gem_config },
{ .compatible = "atmel,sama5d3-gem", .data = &sama5d3_config },
{ .compatible = "atmel,sama5d4-gem", .data = &sama5d4_config },
{ .compatible = "cdns,zynqmp-gem", .data = &zynqmp_config},
{ /* sentinel */ }
};
static const struct macb_config pc302gem_config = {
.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE,
.dma_burst_length = 16,
};
static const struct macb_config zynqmp_config = {
.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO | MACB_CAPS_TSU,
.dma_burst_length = 16,
.jumbo_max_len = 10240,
};
Fine.
My question is can i directly change the MAC configuration in device tree to "cdns,zynqmp-gem" or correspondingly whether i have to change other details in device tree like interrupt , clocks, clock name etc...
Let me know if you need further info.
Thanks,
Karikalan K
01-05-2016 12:44 AM
????
zynqMP is ultrascale + Zynq and the hardware is TOTALLY different.
you can not of course use ZU+ driver on ZYNQ 7 !!
01-05-2016 02:11 AM
Hello,
Then how to enable ptp configuration for Zynq?
Regards,
Karikalan K
01-05-2016 02:45 AM
let say so:
I would be VERY surprised if there is a configuration trick that works with current mainstream - xilinx kernel and drivers and fully supports PTP...
more likely deep PATCHING is required, and some 3-6 week work in testing and debugging.. have fun!
and lets hope a +surprise that it works and no patching is required.. we can always hope :)
01-05-2016 05:59 AM
It might be worth reviewing the hardware and it's capabilities on this page. The Xilinx (not Cadence) driver was being used for this test and the newer cadence driver does not support it from what I've heard (not facts :)).
http://www.wiki.xilinx.com/Zynq-7000+AP+SoC+-+Precision+Timing+with+IEEE1588+v2+Protocol+Tech+Tip
Thanks
John
01-05-2016 06:39 AM
nanu super eh!
there is some TIP, and some comments that it aint working, and then some more rumor that that there are unknown diffferencies that may case unknown..
==> 2+ weeks of hard work (to get it working)
01-05-2016 10:39 PM
Hello John,
In the link provided they are using "emacps" driver.
If new cadence driver is not supporting the PTP (Harware timestamping) means, is it possible to use the emacps driver by changing the device tree compatible details directly as below or is there any addition changes has to be done in interrupts and clocks.
gem0: ethernet@e000b000 {
compatible = "cdns,gem";
compatible = "xlnx,ps7-ethernet-1.00.a"
reg = <0xe000b000 0x1000>;
status = "disabled";
interrupts = <0 22 4>;
clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
clock-names = "pclk", "hclk", "tx_clk";
#address-cells = <1>;
#size-cells = <0>;
};
By the way, is there any patch available for cadence driver to support PTP (Hardware Timestamping) .
Regards,
Karikalan K
03-30-2016 03:09 AM
In regards to prevoius comment - It is better just to cahnge system-top.dts
xemacps ethernet driver (and its timestamping) needs also be enabled in the kernel of course
In my example (PicoZed & Petalinux 2015.4) system-top.dts (etherent stuff only)
&gem0 { compatible = "xlnx,ps7-ethernet-1.00.a"; /* reg = <0xe000b000 0x1000>; --- already in zynq-7000.dtsi in 2015.4 */ /* status = "okay"; --- already in pcw.dtsi in 2015.4 */ /* interrupts = <0 22 4>; --- already in zynq-7000.dtsi in 2015.4 */ clocks = <&clkc 13>, <&clkc 30>; clock-names = "ref_clk", "aper_clk"; /* local-mac-address = [aa bb cc dd 19 86]; --- already in system-conf.dtsi in 2015.4 */ xlnx,has-mdio = <0x1>; /* is present in 2014.4 thus I added it here */ /* #address-cells = <1>; */ /* #size-cells = <0>; */ }; &gem0 { phy-handle = <&phy0>; /* phy-mode = "rgmii-id"; --- already in pcw.dtsi in 2015.4 */ mdio { #address-cells = <1>; #size-cells = <0>; phy0: phy@0 { compatible = "marvell,88e1510"; device_type = "ethernet-phy"; reg = <0x0>; marvell,reg-init = <3 16 0xff00 0x1e 3 17 0xfff0 0x00>; }; }; };
If you run into somthing like
ifconfig: SIOCSIFFLAGS: No such device or address
then probably the PHY part in your system-top.dts is incorrect - browse the forum there is a lot about it
With Regards
T