octeon: add support for the octeon mips64 SoC
[openwrt/openwrt.git] / target / linux / octeon / patches-3.10 / 0001-MIPS-Octeon-Fix-DT-pruning-bug-with-pip-ports.patch
1 From ab2bb148c5932712d2717a7f3a452846f07a660a Mon Sep 17 00:00:00 2001
2 From: Faidon Liambotis <paravoid@debian.org>
3 Date: Thu, 11 Jul 2013 21:08:09 +0000
4 Subject: [PATCH] MIPS: Octeon: Fix DT pruning bug with pip ports
5
6 During the pruning of the device tree octeon_fdt_pip_iface() is called
7 for each PIP interface and every port up to the port count is removed
8 from the device tree. However, the count was set to the return value of
9 cvmx_helper_interface_enumerate() which doesn't actually return the
10 count but just returns zero on success. This effectively removed *all*
11 ports from the tree.
12
13 Use cvmx_helper_ports_on_interface() instead to fix this. This
14 successfully restores the 3 ports of my ERLite-3 and fixes the "kernel
15 assigns random MAC addresses" issue.
16
17 Signed-off-by: Faidon Liambotis <paravoid@debian.org>
18 Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
19 Acked-by: David Daney <david.daney@cavium.com>
20 Cc: linux-mips@linux-mips.org
21 Patchwork: https://patchwork.linux-mips.org/patch/5587/
22 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
23 ---
24 arch/mips/cavium-octeon/octeon-platform.c | 5 +++--
25 1 file changed, 3 insertions(+), 2 deletions(-)
26
27 diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c
28 index 7b746e7..1830874 100644
29 --- a/arch/mips/cavium-octeon/octeon-platform.c
30 +++ b/arch/mips/cavium-octeon/octeon-platform.c
31 @@ -334,9 +334,10 @@ static void __init octeon_fdt_pip_iface(int pip, int idx, u64 *pmac)
32 char name_buffer[20];
33 int iface;
34 int p;
35 - int count;
36 + int count = 0;
37
38 - count = cvmx_helper_interface_enumerate(idx);
39 + if (cvmx_helper_interface_enumerate(idx) == 0)
40 + count = cvmx_helper_ports_on_interface(idx);
41
42 snprintf(name_buffer, sizeof(name_buffer), "interface@%d", idx);
43 iface = fdt_subnode_offset(initial_boot_params, pip, name_buffer);
44 --
45 1.7.10.4
46