summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorKonstantin Porotchkin <kostap@marvell.com>2017-02-16 13:52:27 +0200
committerStefan Roese <sr@denx.de>2017-03-29 07:38:09 +0200
commit2a4d94dd6cf4abf3dbd3854a803fd4fd6aa47307 (patch)
tree8846cedceb74ea4cebc17c6c988d221b39e8745a /drivers/net
parentce0c79372d62544fa8dda30756dcde74abf5bb02 (diff)
mvebu: neta: Add support for board init function
Add ability to use board-specific initialization flow to NETA driver (for instance Ethernet switch bring-up) Signed-off-by: Konstantin Porotchkin <kostap@marvell.com> Cc: Stefan Roese <sr@denx.de> Cc: Igal Liberman <igall@marvell.com> Cc: Nadav Haklai <nadavh@marvell.com> Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/mvneta.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c
index 674075f037..a1e2136e35 100644
--- a/drivers/net/mvneta.c
+++ b/drivers/net/mvneta.c
@@ -404,6 +404,15 @@ static struct buffer_location buffer_loc;
*/
#define BD_SPACE (1 << 20)
+/*
+ * Dummy implementation that can be overwritten by a board
+ * specific function
+ */
+__weak int board_network_enable(struct mii_dev *bus)
+{
+ return 0;
+}
+
/* Utility/helper methods */
/* Write helper method */
@@ -1615,6 +1624,7 @@ static int mvneta_probe(struct udevice *dev)
struct mii_dev *bus;
unsigned long addr;
void *bd_space;
+ int ret;
/*
* Allocate buffer area for descs and rx_buffers. This is only
@@ -1664,7 +1674,11 @@ static int mvneta_probe(struct udevice *dev)
bus->priv = (void *)pp;
pp->bus = bus;
- return mdio_register(bus);
+ ret = mdio_register(bus);
+ if (ret)
+ return ret;
+
+ return board_network_enable(bus);
}
static void mvneta_stop(struct udevice *dev)