[LEDE-DEV] [PATCH] ramips: add support for Loewe WMDR-143N

Mathias Kresin dev at kresin.me
Wed Jul 19 06:35:59 PDT 2017


2017-07-18 21:15 GMT+02:00 Oliver Fleischmann <ogf at bnv-bamberg.de>:
>>> +&pinctrl {
>>> +       state_default: pinctrl0 {
>>> +               gpio {
>>> +                       ralink,group = "i2c", "jtag", "uartf";
>>> +                       ralink,function = "gpio";
>>> +               };
>>> +       };
>>> +};
>>
>> Same as above. None if the pins in these groups are used as GPIO.
>
> But if I remove this part, the kernel hangs during boot reproducibly:
>
> (...)
> [    0.134508] clocksource: jiffies: mask: 0xffffffff max_cycles:
> 0xffffffff, max_idle_ns: 19112604462750000 ns
> [    0.154048] futex hash table entries: 256 (order: -1, 3072 bytes)
> [    0.166222] pinctrl core: initialized pinctrl subsystem
> [    0.177541] NET: Registered protocol family 16
>
> and gone. It doesn't matter if I leave all three groups or only one of them,
> but as soon as I remove them all, it hangs. So I'd prefer to keep this...

I'm not entirely sure, but It rather looks like a (driver) bug to me.
If it is a bug, I prefer to see this bug fixed instead of adding not
required pinmuxes to workaround a possible bug.

>>> +&ethernet {
>>> +       mtd-mac-address = <&factory 0x4>;
>>> +
>>> +       port at 0 {
>>> +               phy-handle = <&phy0>;
>>> +               phy-mode = "mii";
>>> +       };
>>> +       mdio-bus {
>>> +               status = "okay";
>>> +
>>> +               phy0: ethernet-phy at 0 {
>>> +                       reg = <0>;
>>> +                       phy-mode = "mii";
>>> +               };
>>> +       };
>>> +};
>>> +
>>> +&wmac {
>>> +       status = "okay";
>>> +       ralink,mtd-eeprom = <&factory 0>;
>>> +       mtd-mac-address = <&factory 0x4>;
>>> +       mtd-mac-address-increment = <1>;
>>
>>
>> Have you validated against the original firmware that wireless and
>> ethernet have different mac addresses? Is it the wireless mac address
>> that is incremented? I'm somehow in doubt here, since there is no
>> ethernet by default for this board.
>
>
> With the original firmware, both interfaces do indeed have different mac
> addresses. The wireless interface uses the one from the "Factory"
> partition (e.g. F8:35:DD:C9:1B:19), not incremented (sorry).
>
> The ethernet interface has a completely different address (e.g.
> 00:0C:43:28:80:0F). I have no idea where it comes from, I can't find it in
> any of the configuration partitions wether in binary or in ASCII. It gets
> set by a kernel module (raeth.ko). In the hexdump of this binary module, I
> can find a part of this address (00 0c 43 28 80 00) hardcoded.
>
> So I thought, just incrementing the given address for the second interface
> would do for the beginning. Do you have a suggestion for a better solution?

00:0C:43 is the RaLink mac prefix and 00:0C:43:28:80:0F is set as
default mac address by the proprietary driver. Most likely it is the
same for all WMDR-143N boards.

Long story short, there is no designated mac address for the ethernet
interface and we should not use the incremented wireless mac address
for the ethernet interface. The resulting mac address might be used by
other boards. Just drop  mtd-mac-address* from the dts. This way a
random one is used. Not a perfect solution, but IMHO better than what
you have at the moment.

Alternatively, it would be possible to set 00:0C:43:28:80:0F for the
ethernet of all WMDR-143N boards by using

  mac-address = [ 00 0C 43 28 80 0F ];

in the dts. Use whatever you prefer.

Mathias



More information about the Lede-dev mailing list