Hi,
we have connected a marvel switch 88E6352 to some GPIOs of the Apalis. The Apalis shall drive the mdio protocol in order to configure the switch. Basically we want to have an interface in C (in userspace) like:
find -name mdio
./bus/platform/devices/mdio
./devices/soc0/mdio
./firmware/devicetree/base/soc/aips-bus@02100000/ethernet@02188000/mdio
./firmware/devicetree/base/mdio
/sys/bus/mdio_bus/devices# ls
2188000.ethernet:07
What 's the interface of this driver? I currently do not know enough about the linux phy implementation.
Could the marvel kernel driver also be used together with the mdio-bitbang driver?
What would be the DTS configuration?
Actually I would prefer to use a manual read/write interface, as I already have code available what to write to the registers.
Sorry, this is not really a Toradex specific question, but maybe you could point me into the right direction.
We also need to use the network interface of the apalis, so as I understand there is no way to use the onboard PHY to control the external marvel switch. MDC pin of the apalis is also not accessible. Thus we need to use GPIO bitbang. Thats 's why ETH.MDC and MDIO etc. of the switch are now connected to the GPIOs as can be seen in the image. The question is, if I can use the bitbang kernel driver for this purpose.
Maybe even implementing the MDIO protocol in bitbang from userspace could do it?
Thank you for your reply. Please correct me if understood wrong, Ethernet MAC layer didn’t connect between iMX6 and marvel switch, only MDIO interface is connected.
At the moment I don’t have concrete information for your use case. We are guessing below suggestions would work
Option #1: First, you would try on-module PHY with the bitbang driver to test that on here. you need to enable CONFIG_MDIO_BITBANG.
We saw documentation for the compatible switch here: Documentation/devicetree/bindings/net/dsa/marvell.txt. This you would try, please refer an example on below links
We are working on option 1, let you know the update as soon as we have something to share with you.
If you are looking 2nd Ethernet interface then Apalis iMX8 will be the first module in the Apalis form factor which features a second Ethernet MAC. This module has a second RGMII/RMII (including MDIO/MDC) interface on the module edge connector. This allows having a secondary Ethernet PHY on the carrier board.
Dear @raja.tx,
thank you very much for your support!
Yesterday I already successfully implemented option 2, GPIO to MDIO bit-bang from userspace via Sysfs. It works and the switch now also works.
Of course this solution is not very efficient or fast, but performance is not so critical. Anyway, using a Kernel driver would be nicer, thanks for the link to the android driver. So if you have information how to make this driver work with linux, I would be happy to try it out.
Best,
Matthias
Regarding the android driver, I think you just need to customise it for linux and then it should work. General Information about writing kernel module is described here.