Hello
could somebody add something like that:
gpio_free(TX28_FEC_PHY_RESET);
to kernel ethernet drive ? (mach-mxs.c)
Our iMX 287 works in somewhat harsh environment and due to electric discharges nearby, there is necessity to reset eth phy time to time from linux user space.
This is unable due to locked proper gpio pin in kernel driver.
After adding piece of code mentioned above, we are able to reset phy. But is this really right way to do it ?
thanks
regards Klaban Jan
From my point of view using a GPIO isn't a solution, because the ethernet driver must be notified about the reset to restore the necessary registers. The right approach would be to implement IOCTL in the driver to reset the PHY and call the IOCTL from user space. So you needn't to handle about locking and so on.
yes i agree
i did it that way because i need it to be ready for a bit hostile environment, but i the future would be better solution via ioctl or something like that
unfortunately i'm not so good at kernel programing :smileyhappy:
i consider it a suggestion for a bit better usability in industrial environment
btw. we are using karo tx28 cpu module with two eth interface (but only with one phy), and second added phy is reseted via same gpio pin, so it could be a bit tricky to implement such ioctl, because reset will affect both eths
Hello,
could you please explain why these resets are necessary and what is your expected behavior of the i.MX287?
Have you tried to compile the ethernet driver as module? So it's possible to unload and load it, which should result in a phy reset.
BR Stefan Wahren
Hello
well, good point with having driver as module, i'll try it, but i think i'll have to shut down network interface before disabling module, but it could work
anyway, under some electromagnetic discharges case, ethernet stops working at all, interface sees eth line up, but nothing goes out or in, not a single bit
but after reseting phy, everything is ok again, so that is the reason why i would like to have that ability
what about using a different GPIO pin, lets said GPIO1 of the i.MX28 connect it to the PHY RESET pin, which it is the one already connected so both pins are at the same PHY REset pin, but since the GPIO1 it is not in the kernel can be modify in the application .
unofrtunately, this is not a way, PCB and circuits are already done, you know, phy is already placed on same PCB as cpu by manufacturer
OK, so then I think you need to modify the driver, so the this pin get out of the lock from the Kernel and then handle as a module externally but seems too mucho maybe a rework from another GPIO still be a good option, lets said the same LED from the board or something like that