All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Dimitrov <picmaster@mail.bg>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/4] net: fec: do not access reserved register for i.MX6UL
Date: Wed, 05 Aug 2015 17:31:27 +0300	[thread overview]
Message-ID: <55C21E3F.2040604@mail.bg> (raw)
In-Reply-To: <1438596380-4632-2-git-send-email-Peng.Fan@freescale.com>

Hi Peng,

On 08/03/2015 01:06 PM, Peng Fan wrote:
> The MIB RAM and FIFO receive start register does not exist on
> i.MX6UL. Accessing these register will cause enet not work well.
>
> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
> Signed-off-by: Fugang Duan <B38611@freescale.com>
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> ---
>   drivers/net/fec_mxc.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index c5dcbbb..7fb1d5f 100644
> --- a/drivers/net/fec_mxc.c
> +++ b/drivers/net/fec_mxc.c
> @@ -520,8 +520,10 @@ static int fec_open(struct eth_device *edev)
>   static int fec_init(struct eth_device *dev, bd_t* bd)
>   {
>   	struct fec_priv *fec = (struct fec_priv *)dev->priv;
> +#if !defined(CONFIG_MX6UL)
>   	uint32_t mib_ptr = (uint32_t)&fec->eth->rmon_t_drop;
>   	int i;
> +#endif
>
>   	/* Initialize MAC address */
>   	fec_set_hwaddr(dev);
> @@ -551,12 +553,14 @@ static int fec_init(struct eth_device *dev, bd_t* bd)
>   	writel(0x00000000, &fec->eth->gaddr2);
>
>
> +#if !defined(CONFIG_MX6UL)
>   	/* clear MIB RAM */
>   	for (i = mib_ptr; i <= mib_ptr + 0xfc; i += 4)
>   		writel(0, i);
>
>   	/* FIFO receive start register */
>   	writel(0x520, &fec->eth->r_fstart);
> +#endif
>
>   	/* size and address of each buffer */
>   	writel(FEC_MAX_PKT_SIZE, &fec->eth->emrbr);
>

Is it possible to do runtime check for the SoC type, instead of ifdefs?

Regards,
Nikolay

  reply	other threads:[~2015-08-05 14:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03 10:06 [U-Boot] [PATCH 1/4] imx: clock support enet2 anatop clock support Peng Fan
2015-08-03 10:06 ` [U-Boot] [PATCH 2/4] net: fec: do not access reserved register for i.MX6UL Peng Fan
2015-08-05 14:31   ` Nikolay Dimitrov [this message]
2015-08-06  4:41     ` Peng Fan
2015-08-06  7:39       ` Nikolay Dimitrov
2015-08-06 13:54       ` Stefano Babic
2015-08-07  1:08         ` Peng Fan
2015-08-07  7:05           ` Stefano Babic
2015-08-03 10:06 ` [U-Boot] [PATCH 3/4] comment: net: Add CMD_MII in Kconfig Peng Fan
2015-08-11 15:59   ` Joe Hershberger
2015-08-03 10:06 ` [U-Boot] [PATCH 4/4] imx: mx6ul_14x14_evk add ENET support Peng Fan
2015-08-03 10:39   ` Fabio Estevam
2015-08-03 11:32     ` Peng Fan
2015-08-03 12:50       ` Stefano Babic
2015-08-03 11:45         ` Peng Fan
2015-08-03 10:49 ` [U-Boot] [PATCH 1/4] imx: clock support enet2 anatop clock support Fabio Estevam
2015-08-03 11:59 ` Stefano Babic
2015-08-03 11:30   ` Peng Fan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55C21E3F.2040604@mail.bg \
    --to=picmaster@mail.bg \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.