aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-07-10 20:44:03 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-07-10 20:44:03 +0000
commitf083ca97435183b08711b6d4afa4e80faeb78b0f (patch)
tree90fbdf2a9a87e5c79440bdb59458e9ef32da50e1
parent6134a3de30499f22b3809943e59fe1db807bcec2 (diff)
downloadupstream-f083ca97435183b08711b6d4afa4e80faeb78b0f.tar.gz
upstream-f083ca97435183b08711b6d4afa4e80faeb78b0f.tar.bz2
upstream-f083ca97435183b08711b6d4afa4e80faeb78b0f.zip
octeon: fix edgerouter pro ethernet device probe order
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 41575
-rw-r--r--target/linux/octeon/patches-3.10/110-er200-ethernet_probe_order.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/target/linux/octeon/patches-3.10/110-er200-ethernet_probe_order.patch b/target/linux/octeon/patches-3.10/110-er200-ethernet_probe_order.patch
new file mode 100644
index 0000000000..3d39a04bfd
--- /dev/null
+++ b/target/linux/octeon/patches-3.10/110-er200-ethernet_probe_order.patch
@@ -0,0 +1,34 @@
+--- a/drivers/staging/octeon/ethernet.c
++++ b/drivers/staging/octeon/ethernet.c
+@@ -623,6 +623,7 @@ static int cvm_oct_probe(struct platform
+ int interface;
+ int fau = FAU_NUM_PACKET_BUFFERS_TO_FREE;
+ int qos;
++ int i;
+ struct device_node *pip;
+
+ octeon_mdiobus_force_mod_depencency();
+@@ -706,13 +707,19 @@ static int cvm_oct_probe(struct platform
+ }
+
+ num_interfaces = cvmx_helper_get_number_of_interfaces();
+- for (interface = 0; interface < num_interfaces; interface++) {
+- cvmx_helper_interface_mode_t imode =
+- cvmx_helper_interface_get_mode(interface);
+- int num_ports = cvmx_helper_ports_on_interface(interface);
++ for (i = 0; i < num_interfaces; i++) {
++ cvmx_helper_interface_mode_t imode;
++ int interface;
++ int num_ports;
+ int port;
+ int port_index;
+
++ interface = i;
++ if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_UBNT_E200)
++ interface = num_interfaces - (i + 1);
++
++ num_ports = cvmx_helper_ports_on_interface(interface);
++ imode = cvmx_helper_interface_get_mode(interface);
+ for (port_index = 0, port = cvmx_helper_get_ipd_port(interface, 0);
+ port < cvmx_helper_get_ipd_port(interface, num_ports);
+ port_index++, port++) {
Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * libfdt - Flat Device Tree manipulation
 *	Testcase for variable sized cells in dtc
 * Copyright (C) 2006 David Gibson, IBM Corporation.
 * Copyright (C) 2011 The Chromium Authors. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>

#include <libfdt.h>

#include "tests.h"
#include "testdata.h"

static void check_compare_properties(void *fdt,
				     char const *name_one,
				     char const *name_two)
{
	const void *propval;
	int proplen;

	propval = fdt_getprop(fdt, 0, name_one, &proplen);

	if (!propval)
		FAIL("fdt_getprop(\"%s\"): %s",
		     name_one,
		     fdt_strerror(proplen));

	check_getprop(fdt, 0, name_two, proplen, propval);
}

int main(int argc, char *argv[])
{
	void *fdt;
	uint8_t expected_8[6] = {TEST_CHAR1,
				 TEST_CHAR2,
				 TEST_CHAR3,
				 TEST_CHAR4,
				 TEST_CHAR5,
				 TEST_VALUE_1 >> 24};
	uint16_t expected_16[6];
	uint32_t expected_32[6];
	uint64_t expected_64[6];
	int i;

	for (i = 0; i < 5; ++i) {
		expected_16[i] = cpu_to_fdt16(expected_8[i]);
		expected_32[i] = cpu_to_fdt32(expected_8[i]);
		expected_64[i] = cpu_to_fdt64(expected_8[i]);
	}

	expected_16[5] = cpu_to_fdt16(TEST_VALUE_1 >> 16);
	expected_32[5] = cpu_to_fdt32(TEST_VALUE_1);
	expected_64[5] = cpu_to_fdt64(TEST_ADDR_1);

	test_init(argc, argv);
	fdt = load_blob_arg(argc, argv);

	check_getprop(fdt, 0, "cells-8b", sizeof(expected_8), expected_8);
	check_getprop(fdt, 0, "cells-16b", sizeof(expected_16), expected_16);
	check_getprop(fdt, 0, "cells-32b", sizeof(expected_32), expected_32);
	check_getprop(fdt, 0, "cells-64b", sizeof(expected_64), expected_64);

	check_compare_properties(fdt, "cells-one-16b", "cells-one-32b");

	PASS();
}