Message ID | 20180730124509.13063-5-jagan@amarulasolutions.com |
---|---|
State | Changes Requested |
Delegated to: | Joe Hershberger |
Headers | show |
Series | net: fec: Code Improvement/cleanups | expand |
On Mon, Jul 30, 2018 at 7:45 AM, Jagan Teki <jagan@amarulasolutions.com> wrote: > Usually PHYADDR is used while PHYLIB is defined, but > boards like apx4devkit, mx6qarm2 are not using PHYLIB > but they are using CONFIG_FEC_MXC_PHYADDR. > > So, future patches will convert CONFIG_FEC_MXC_PHYADDR to > generic CONFIG_PHY_ADDR and that will depends on PHYLIB. > Handle this special case for this boards by adding default > CONFIG_FEC_MXC_PHYADDR to 0 if not defined so-that it can't > depends on PHYLIB local to fec_mxc. Boards which are using > PHY_ADDR in future will anyway use PHYLIB. > > Cc: Ye Li <ye.li@nxp.com> > Cc: Jason Liu <jason.hui.liu@nxp.com> > Cc: Lauri Hintsala <lauri.hintsala@bluegiga.com> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index fc42978a20..49bb926efa 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -50,6 +50,10 @@ DECLARE_GLOBAL_DATA_PTR; #define CONFIG_FEC_XCV_TYPE PHY_INTERFACE_MODE_MII100 #endif +#if defined(CONFIG_TARGET_APX4DEVKIT) || defined(CONFIG_TARGET_MX6QARM2) +# define CONFIG_FEC_MXC_PHY_ADDR 0 +#endif + /* * The i.MX28 operates with packets in big endian. We need to swap them before * sending and after receiving. diff --git a/include/configs/apx4devkit.h b/include/configs/apx4devkit.h index 475f9c372f..aa129edc89 100644 --- a/include/configs/apx4devkit.h +++ b/include/configs/apx4devkit.h @@ -52,7 +52,6 @@ /* FEC Ethernet on SoC */ #ifdef CONFIG_CMD_NET #define CONFIG_ETHPRIME "FEC" -#define CONFIG_FEC_MXC_PHYADDR 0 #define IMX_FEC_BASE MXS_ENET0_BASE #endif diff --git a/include/configs/mx6qarm2.h b/include/configs/mx6qarm2.h index b82b8325ff..06043c888f 100644 --- a/include/configs/mx6qarm2.h +++ b/include/configs/mx6qarm2.h @@ -22,7 +22,6 @@ #define IMX_FEC_BASE ENET_BASE_ADDR #define CONFIG_FEC_XCV_TYPE PHY_INTERFACE_MODE_RGMII -#define CONFIG_FEC_MXC_PHYADDR 0 #define CONFIG_EXTRA_ENV_SETTINGS \ "script=boot.scr\0" \
Usually PHYADDR is used while PHYLIB is defined, but boards like apx4devkit, mx6qarm2 are not using PHYLIB but they are using CONFIG_FEC_MXC_PHYADDR. So, future patches will convert CONFIG_FEC_MXC_PHYADDR to generic CONFIG_PHY_ADDR and that will depends on PHYLIB. Handle this special case for this boards by adding default CONFIG_FEC_MXC_PHYADDR to 0 if not defined so-that it can't depends on PHYLIB local to fec_mxc. Boards which are using PHY_ADDR in future will anyway use PHYLIB. Cc: Ye Li <ye.li@nxp.com> Cc: Jason Liu <jason.hui.liu@nxp.com> Cc: Lauri Hintsala <lauri.hintsala@bluegiga.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> --- drivers/net/fec_mxc.c | 4 ++++ include/configs/apx4devkit.h | 1 - include/configs/mx6qarm2.h | 1 - 3 files changed, 4 insertions(+), 2 deletions(-)