openwrtv4/target/linux
John Crispin c997410461 mpc85xx: fix WAN/LAN-MAC for TP-LINK TL-WDR4900 v1
This works around a bootloader issue where every device
has the same lan/wan-mac 00:04:9f:ef:01:01 - with this patch
we read the macs from config-partition during initial network
setup. We have 9 valid macs stored in the partition, the
1st two are used for the radios, 3 and 4 are now used for WAN/LAN.

on an already setup / running device we can get the real macs with
. /lib/functions.sh
. /lib/functions/system.sh
echo "LAN = $(mtd_get_mac_binary config 338)"
echo "WAN = $(mtd_get_mac_binary config 344)"

see:
https://dev.openwrt.org/ticket/14714

from the ticket / user klondike:
U-Boot passed this commit ecd1a09b81
http://u-boot.10912.n7.nabble.com/U-Boot-PATCH-mpc83xx-remove-hardcoded-network-addresses-from-config-files-td44372.html
I suppose to prevent this particular issue, but the WDR4900 may be using an old bootloader still affected.
                                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I have been checking the contents of the dtb on the flash, this particular bit is quite revealing:

ethernet@b0000 {
                        #address-cells = <0x1>;
                        #size-cells = <0x1>;
                        device_type = "network";
                        model = "eTSEC";
                        compatible = "fsl,etsec2";
                        fsl,num_rx_queues = <0x8>;
                        fsl,num_tx_queues = <0x8>;
                        local-mac-address = [00 00 00 00 00 00];
                                             ^^^^^^^^^^^^^^^^^

                        interrupt-parent = <0x2>;
                        phy-handle = <0x3>;
                        phy-connection-type = "rgmii-id";
                        ptimer-handle = <0x4>;

                        queue-group@0 {
                                #address-cells = <0x1>;
                                #size-cells = <0x1>;
                                reg = <0xb0000 0x1000>;
                                rx-bit-map = <0xff>;
                                tx-bit-map = <0xff>;
                                interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
                        };
                };

I also have been checking the live device map to find this:

root@GHS-AP3:~# hexdump -C /proc/device-tree/soc@ffe00000/ethernet@b0000/local-mac-address
00000000  00 04 9f ef 01 01                                 |......|
00000006
root@GHS-AP3:~# hexdump -C /proc/device-tree/soc@ffe00000/ethernet@b1000/local-mac-address
*
root@GHS-AP3:~# hexdump -C /proc/device-tree/soc@ffe00000/ethernet@b2000/local-mac-address
*

My conclussion is that U-Boot most likely finds the device and (as no valid MAC-address is provided)
falls back to the default MAC provided by the old code, the kernel then receives thee modified
device map from U-Boot and assumes this is the correct MAC for the device despite it obviously isn't.

This can be seen at
target/linux/mpc85xx/patches-3.10/140-powerpc-85xx-tl-wdr4900-v1-support.patch

The enetaddr is filled up by using the device tree data by the process_boot_dtb
function and used by the platform_fixups function to set the eth0 address
(by calling dt_fixup_mac_address_by_alias("ethernet0", enetaddr); ).
But instead we should be used the device address which to my understanding is
provided in the mtd.

Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>

SVN-Revision: 43074
2014-10-26 17:58:53 +00:00
..
adm5120 kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
adm8668 kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
amazon kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
ar7 kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
ar71xx ar71xx: refresh 3.10 patches 2014-10-24 20:39:42 +00:00
at91 kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
atheros kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
au1000 kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
avr32 kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
bcm53xx kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
brcm47xx kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
brcm63xx kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
brcm2708 kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
cns3xxx kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
cns21xx kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
cobalt kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
ep93xx kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
gemini kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
generic kernel: refresh generic 3.10 patches 2014-10-24 20:39:36 +00:00
imx6 kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
iop32x kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
ipq806x kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
ixp4xx kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
kirkwood kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
lantiq vgv7519: support more recent board release with vrx288 v1.2 2014-10-26 17:18:41 +00:00
malta kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
mcs814x kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
mpc52xx kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
mpc83xx kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
mpc85xx mpc85xx: fix WAN/LAN-MAC for TP-LINK TL-WDR4900 v1 2014-10-26 17:58:53 +00:00
mvebu kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
mxs kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
netlogic netlogic: use KERNEL_PATCHVER 2014-10-24 19:35:52 +00:00
octeon kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
omap kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
omap24xx kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
orion kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
ppc40x kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
ppc44x kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
pxa kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
ramips ramips: fix filenames in PorayDualSize factory images 2014-10-26 17:18:45 +00:00
rb532 kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
realview kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
sibyte kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
sparc kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
sunxi kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
uml kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
x86 kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
x86_64 kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
xburst kernel: makefiles: make use of new var KERNEL_PATCHVER 2014-10-24 19:34:02 +00:00
Makefile