
On 14/12/2011 15:27, Veli-Pekka Peltola wrote:
But now I understand that our way is far away from optimal so this will be reworked in v2.
In this way you can also profit of the work already done in the SPL code.
+void imx_get_mac_from_fuse(char *mac) +{
- memset(mac, 0, 6);
+}
This is wrong, and surely you do not get the address from fuses.
What is correct way to get ethernet mac from environment instead of fuses? FEC driver seems to call imx_get_mac_from_fuse always. Should it be changed to use a new configuration option? Or should we try to read mac from fuses which are zeros and then fall back to environment?
I have supposed that new Freescale's SOCs are always delivered with a valid MAC address in the fuses. Some IMX SOCs have no fuse at all, and the MAC address is only taken from the environment, such as the MX35.
I see here a couple of points. First at all, imx_get_mac_from_fuse should be factorized between your board and m28evk. Maybe we need some CONFIG_ to add the vendor part, but reading from fuse itself can be shared code. and if the values read are all zeroes, we have the fallback to the environment ethaddr variable.
Do you get the revision from an environment and not from hardware ?
Yes, that's the plan. In the history we have used revision number to include information about integrated modem, wifi and so on.
There is a big chance to have the wrong revision number...
Yes but even with empty environment the board will still boot up.
Of course, until you do not do something different in code based on the revision number, such as setting the MUX differently or putting the gpio in a different mode...if you only print the revision number, there is no issue.
You set the environment in NAND, but you reserve only one sector for each of the two copies. If the single sector becomes bad, you lose the redundancy. Should you not have more as one sector for the environment ?
Statistically this has not been a problem so far.
There is no rule - nothing happens until the sector becomes bad. Then the redundancy feature is not available anymore. It depends on you to check the risk and decide to increase the size or not.
Best regards, Stefano Babic