Only half of the init is actually common. Move that part into a new common file and call it from driver-model and legacy code. More common functions will be added in future patches. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>master
parent
c32a6fd07b
commit
818f91eb57
@ -0,0 +1,23 @@ |
|||||||
|
/*
|
||||||
|
* (C) Copyright 2001-2015 |
||||||
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
||||||
|
* Joe Hershberger, National Instruments |
||||||
|
* |
||||||
|
* SPDX-License-Identifier: GPL-2.0+ |
||||||
|
*/ |
||||||
|
|
||||||
|
#include <common.h> |
||||||
|
#include <miiphy.h> |
||||||
|
#include "eth_internal.h" |
||||||
|
|
||||||
|
void eth_common_init(void) |
||||||
|
{ |
||||||
|
bootstage_mark(BOOTSTAGE_ID_NET_ETH_START); |
||||||
|
#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) || defined(CONFIG_PHYLIB) |
||||||
|
miiphy_init(); |
||||||
|
#endif |
||||||
|
|
||||||
|
#ifdef CONFIG_PHYLIB |
||||||
|
phy_init(); |
||||||
|
#endif |
||||||
|
} |
@ -0,0 +1,15 @@ |
|||||||
|
/*
|
||||||
|
* (C) Copyright 2001-2015 |
||||||
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
||||||
|
* Joe Hershberger, National Instruments |
||||||
|
* |
||||||
|
* SPDX-License-Identifier: GPL-2.0+ |
||||||
|
*/ |
||||||
|
|
||||||
|
#ifndef __ETH_INTERNAL_H |
||||||
|
#define __ETH_INTERNAL_H |
||||||
|
|
||||||
|
/* Do init that is common to driver model and legacy networking */ |
||||||
|
void eth_common_init(void); |
||||||
|
|
||||||
|
#endif |
Loading…
Reference in new issue