[U-Boot] [PATCH V4 3/8] imx: fec: Resolve speed before configuring gasket

Stefano Babic
2012-04-20T07:30:54Z

On 20/04/2012 06:35, Timo Ketola wrote:
> [undeleted Stefano from CC-list]
>

Hi Timo, hi Troy,

> On 20.04.2012 00:23, Troy Kisky wrote:
>> On 4/19/2012 2:13 PM, Troy Kisky wrote:
>>> On 4/19/2012 1:18 PM, Timo Ketola wrote:
>>>> On 19.04.2012 22:27, Troy Kisky wrote:
>>>>> On 4/19/2012 1:55 AM, Timo Ketola wrote:
>>>>>> -#if !defined(CONFIG_MII)
>>>>>> - /* configure gasket for RMII, 50 MHz, no loopback, and no echo */
>>>>>> - writew(MIIGSK_CFGR_IF_MODE_RMII,&fec->eth->miigsk_cfgr);
>>>>>> +#if defined(CONFIG_RMII)
>>>>>
>>>>> While this change seems to make sense, it could break some boards.
>>>>
>>>> Please explain how. Every board using fec_mxc define CONFIG_MII -
>>>> they have to:
>>>>
>>>> #ifndef CONFIG_MII
>>>> #error "CONFIG_MII has to be defined!"
>>>> #endif
>>> Does every board that has a gasket define CONFIG_RMII?

as far as I can see, there are some inconsistencies. All boards define
CONFIG_MII, but they really need CONFIG_RMII, because only with my last
patch I set the gasket for MII. The driver has always set in a fixed way
the gasket for RMII, independently if CONFIG_RMII or CONFIG_MII was set,
and that is also wrong.

I would say that the configuration file of most boards using fec_mxc
must be changed.

And then fec_mxc.c does not need at all these lines:
#ifndef CONFIG_MII
#error "CONFIG_MII has to be defined!"
#endif

Boards are compiled clean without them. Correct me if I am wrong, but it
seems the correct way to do is to drop the unneeded check in the above
lines and sets CONFIG_RMII for all boards except the only one
(ima3-mx53), that needs really MII.

Best regards,
Stefano Babic

--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================