[PATCH v3 1/2] net: fec: Add possibility to enable TXC delay

Stefano Babic sbabic at denx.de
Fri Apr 17 18:35:13 CEST 2020


Hi Philippe,

On 11/03/20 11:52, Philippe Schenker wrote:
> This patch enables the possibility to set FEC_ENET_ENABLE_TXC_DELAY or
> FEC_ENET_ENABLE_RXC_DELAY so one can via a define enable the RXC or TXC
> delay in the MAC.
> 
> Signed-off-by: Philippe Schenker <philippe.schenker at toradex.com>
> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov at toradex.com>
> 
> ---
> 
> Changes in v3:
> - Add Olek's reviewed-by tag
> 
> Changes in v2: None
> 
>  drivers/net/fec_mxc.c | 10 ++++++++++
>  drivers/net/fec_mxc.h |  2 ++
>  2 files changed, 12 insertions(+)
> 
> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index bc5b63d7881..345d37be4e8 100644
> --- a/drivers/net/fec_mxc.c
> +++ b/drivers/net/fec_mxc.c
> @@ -503,6 +503,16 @@ static int fec_open(struct eth_device *edev)
>  	writel(readl(&fec->eth->ecntrl) | FEC_ECNTRL_ETHER_EN,
>  	       &fec->eth->ecntrl);
>  
> +#ifdef FEC_ENET_ENABLE_TXC_DELAY
> +	writel(readl(&fec->eth->ecntrl) | FEC_ECNTRL_TXC_DLY,
> +	       &fec->eth->ecntrl);
> +#endif
> +
> +#ifdef FEC_ENET_ENABLE_RXC_DELAY
> +	writel(readl(&fec->eth->ecntrl) | FEC_ECNTRL_RXC_DLY,
> +	       &fec->eth->ecntrl);
> +#endif
> +
>  #if defined(CONFIG_MX25) || defined(CONFIG_MX53) || defined(CONFIG_MX6SL)
>  	udelay(100);
>  
> diff --git a/drivers/net/fec_mxc.h b/drivers/net/fec_mxc.h
> index 159aec89679..3c8fdda2638 100644
> --- a/drivers/net/fec_mxc.h
> +++ b/drivers/net/fec_mxc.h
> @@ -188,6 +188,8 @@ struct ethernet_regs {
>  #define FEC_ECNTRL_ETHER_EN		0x00000002	/* enable the FEC */
>  #define FEC_ECNTRL_SPEED		0x00000020
>  #define FEC_ECNTRL_DBSWAP		0x00000100
> +#define FEC_ECNTRL_TXC_DLY		0x00010000	/* TXC delayed */
> +#define FEC_ECNTRL_RXC_DLY		0x00020000	/* RXC delayed */
>  
>  #define FEC_X_WMRK_STRFWD		0x00000100
>  
> 

But these are not exactly the properties removed by verdin-imx8mm in
DTS, that is for example rgmii_rxc_dly ? And then, should not be better
to support it in DT instead of a CONFIG_ ?

Regards,
Stefano

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================


More information about the U-Boot mailing list