Currently, the naming of the ethernet ports is not handled correctly in
the multi-CP (Communication Processor) case. On Armada 8k, the slave-CP
also instantiates an ethernet controller with the same device ID's.
This patch now takes this into account and adds the required base-id
so that the slave-CP ethernet devices will be named "mvpp2-3 ...".
This patch also updates my Copyright notice to include 2017 as well.
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Stefan Chulski <stefanc@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Nadav Haklai <nadavh@marvell.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* Marcin Wojtas <mw@semihalf.com>
*
* U-Boot version:
* Marcin Wojtas <mw@semihalf.com>
*
* U-Boot version:
- * Copyright (C) 2016 Stefan Roese <sr@denx.de>
+ * Copyright (C) 2016-2017 Stefan Roese <sr@denx.de>
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
/* Number of TXQs used by single port */
static int txq_number = MVPP2_DEFAULT_TXQ;
/* Number of TXQs used by single port */
static int txq_number = MVPP2_DEFAULT_TXQ;
#define MVPP2_DRIVER_NAME "mvpp2"
#define MVPP2_DRIVER_VERSION "1.0"
#define MVPP2_DRIVER_NAME "mvpp2"
#define MVPP2_DRIVER_VERSION "1.0"
char *name;
int subnode;
u32 id;
char *name;
int subnode;
u32 id;
/* Lookup eth driver */
drv = lists_uclass_lookup(UCLASS_ETH);
/* Lookup eth driver */
drv = lists_uclass_lookup(UCLASS_ETH);
+ base_id_add = base_id;
+
fdt_for_each_subnode(subnode, blob, node) {
fdt_for_each_subnode(subnode, blob, node) {
+ /* Increment base_id for all subnodes, also the disabled ones */
+ base_id++;
+
/* Skip disabled ports */
if (!fdtdec_get_is_enabled(blob, subnode))
continue;
/* Skip disabled ports */
if (!fdtdec_get_is_enabled(blob, subnode))
continue;
return -ENOMEM;
id = fdtdec_get_int(blob, subnode, "port-id", -1);
return -ENOMEM;
id = fdtdec_get_int(blob, subnode, "port-id", -1);
name = calloc(1, 16);
sprintf(name, "mvpp2-%d", id);
name = calloc(1, 16);
sprintf(name, "mvpp2-%d", id);