
Wolfgang Denk wrote:
Dear Stefano Babic,
Hi Wolfgang,
I'm not sure. Here is where we enable the FEC because we want to use it in a network command, right?
No, the fec_probe() function is called as part of the cpu_eth_init() and sets the callbacks, among the other things. It is called always, independently if we are ready to use a network command or not, it depends only on CONFIG_FEC_MXC.
I do not find very correct that the MAC address is set in this function (and not set anymore). What happens if I set the ethaddr variable ? Changes will be not effective until next reset of the system. It is a different issue, I know, but related to the same function. I had move setting to fec_init(), but this is already implemented (and I can test only on a i.MX51 board).
Then this is the place to enable the needed clocks, too. These should not be globally enabled and running even if no network access is ever made - this would only increase the power dissipation, which is bad on battery operated devices.
However, I think it is the actual status in the driver, because the fec_probe is always called. The clock initialization should be moved as part of the fec_init() (that is, edev->init) to reach what you propose.
Best regards, Stefano Babic