Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ethernet LED blinking changes DAC voltage #205

Closed
lneuhaus opened this issue Jan 13, 2021 · 5 comments
Closed

Ethernet LED blinking changes DAC voltage #205

lneuhaus opened this issue Jan 13, 2021 · 5 comments

Comments

@lneuhaus
Copy link

lneuhaus commented Jan 13, 2021

When the ethernet LED on a Stemlab125-14 blinks, this results in a change in DAC voltage of the order of ~0.5 mV. We have confirmed this correlation with a photodetector placed near the ethernet port LED. I believe the linux OS ethernet driver is responsible for this blinking. Is there a way to disable it to get the best possible noise performance out of a redpitaya?

@jeras
Copy link
Contributor

jeras commented Jan 13, 2021

Ethernet port blinking probably can be controlled through the devicetree.

This is the device tree file to modify:
https://github.com/RedPitaya/RedPitaya/blob/master/fpga/dts/ethernet.dtsi

This describes the available led options:
https://github.com/RedPitaya/linux-xlnx/blob/branch-redpitaya-v2017.2/include/dt-bindings/phy/phy-leds.h

This is the Lantiq PHY linux driver source:
https://github.com/RedPitaya/linux-xlnx/blob/branch-redpitaya-v2017.2/drivers/net/phy/lantiq.c

If the change could not be applied at runtime, then the simplest approach would be to create an alternative .dtb file, and overwrite the original on the SD card FAT partition.

It has been a couple of years since I last worked with devicetree, so you will probably have to find somebody else to help with how to properly apply it.

@lneuhaus
Copy link
Author

Thanks for these hints. I was able to solve it using https://github.com/PieVo/mdio-tool in the following way:

ssh root@my-redpitaya-hostname
git clone https://github.com/PieVo/mdio-tool.git
cd mdio-tool
cmake .
make
./mdio-tool w eth0 0x1b 0x0000

To re-enable blinking, run

./mdio-tool w eth0 0x1b 0x0f00

The registers addresses and lots of more info can be found at https://datasheet.octopart.com/PEF-7071-V-V1.5-Lantiq-datasheet-62314344.pdf, e.g. page 126.

If anyone knows how I have to modify the .dtsi-file that would be great!

@lneuhaus
Copy link
Author

Something like


 
/*
 * Lantiq ethernet PHY 
 */
&gem0 {
	phy-handle = <&ethernet_0_mdio>;
	ethernet_0_mdio: ethernet_0_mdio@1 {
		reg = <1>;
		reg = <0x1b 0x0000>;
	};
};

maybe?

@lneuhaus
Copy link
Author

Is this fixed by fbbbde8? Is a usage example for the command-line tool to disable ethernet LEDs available?

@crtvalentincic
Copy link

This feature is available in the latest beta release 1.04-11, usage example can be seen here: https://redpitaya.readthedocs.io/en/latest/appsFeatures/command_line_tools/com_line_tool.html#led-enable-disable-utility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants