How can I read MII registers on PHy chip from EZSDK Linux? I compiled MIITools, but it could n't read the mii registers.
My design is the same as DM8148, byt I changed the PHY to PEF7071.
Where can I find suitable driver for this chip?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
How can I read MII registers on PHy chip from EZSDK Linux? I compiled MIITools, but it could n't read the mii registers.
My design is the same as DM8148, byt I changed the PHY to PEF7071.
Where can I find suitable driver for this chip?
Mans,
mans said:How can I read MII registers on PHy chip from EZSDK Linux?
Do you mean the registers of the external PHY chip? If yes, these should be read with the DM814x EMAC MDIO module. See DM814x TRM, sections 9.2.4 MDIO and 9.3.3 MDIO Software Interface
For example code, you can check EZSDK u-boot, files:
board/ti/ti8148/evm.c
drivers/net/cpsw.c
The function cpsw_mdio_read() is used for reading MII registers of the external PHY schip (see cpsw.c file).
For example code in EZSDK linux:
/arch/arm/mach-omap2/devices.c
/drivers/net/davinci_mdio.c
The function davinci_mdio_read() is used for reading MII registers of the external PHY schip (see davinci_mdio.c file).
Best regards,
Pavel
Below is a link to the DM814x TRM:
http://www.ti.com/lit/ug/sprugz8e/sprugz8e.pdf
Best regards,
Pavel
Thanks.
Is there any tools that we could run to read these registers? We tried MII-Tools (http://man7.org/linux/man-pages/man8/mii-tool.8.html) but it could not read PHY registers.
Mans,
mans said:We tried MII-Tools (http://man7.org/linux/man-pages/man8/mii-tool.8.html) but it could not read PHY registers.
I found on several E2E posts that mii-tool can not be used to access the EMAC PHY from the user space:
http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/286649.aspx
http://e2e.ti.com/support/embedded/linux/f/354/t/218006.aspx
Some community members state that use mmi-tool from the u-boot, but not from user space.
You can try using devmem2 tool or ethtool from user space:
http://e2e.ti.com/support/embedded/linux/f/354/p/199983/734173.aspx#734173
http://e2e.ti.com/support/embedded/linux/f/354/t/60214.aspx
Best regards,
Pavel
It seems that ethtools doesn't support this.
/root # ethtool -i eth0
driver: TI CPSW Driver v1.0
version: 1.0
firmware-version:
bus-info: cpsw
supports-statistics: no
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no
Is there any documentation on how to use ethtool to read PHY registers?
Mans,
It seems that ethtool can be used for register dump on a desktop PC, but register dump on DM814x device is not supported with ethtool.
Regarding the devmem2 tool, it can read the DM814x Ethernet subsystem registers, but it seams can not read the PHY registers, as these are external for the DM814x device and have some complexity for the read/write operations (see TRM MDIO).
I will check with the Ethernet experts if we have user space tool for reading the PHY registers, but at this point I can not find such.
Best regards,
Pavel
Thanks.
Is there any port ot ethtool for windows that can read mii registers on pc? When we loose Ethernet, we may try to find what is wrong by looking at mii registers on pc Ethernet.
As we are using Linux on a vm system, we can not use ethtool to read mii registers as I believe VM doesn't have direct access to Ethernet card, instead it uses a virtual LAN driver.
http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/p/364693/1339667.aspx#1339667