提交 2a4d94dd 编写于 作者: K Konstantin Porotchkin 提交者: Stefan Roese

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: NKonstantin 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: NStefan Roese <sr@denx.de>
上级 ce0c7937
...@@ -404,6 +404,15 @@ static struct buffer_location buffer_loc; ...@@ -404,6 +404,15 @@ static struct buffer_location buffer_loc;
*/ */
#define BD_SPACE (1 << 20) #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 */ /* Utility/helper methods */
/* Write helper method */ /* Write helper method */
...@@ -1615,6 +1624,7 @@ static int mvneta_probe(struct udevice *dev) ...@@ -1615,6 +1624,7 @@ static int mvneta_probe(struct udevice *dev)
struct mii_dev *bus; struct mii_dev *bus;
unsigned long addr; unsigned long addr;
void *bd_space; void *bd_space;
int ret;
/* /*
* Allocate buffer area for descs and rx_buffers. This is only * Allocate buffer area for descs and rx_buffers. This is only
...@@ -1664,7 +1674,11 @@ static int mvneta_probe(struct udevice *dev) ...@@ -1664,7 +1674,11 @@ static int mvneta_probe(struct udevice *dev)
bus->priv = (void *)pp; bus->priv = (void *)pp;
pp->bus = bus; 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) static void mvneta_stop(struct udevice *dev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册