All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Neil Armstrong <narmstrong@baylibre.com>, <davem@davemloft.net>,
	<harini.katakam@xilinx.com>, <boris.brezillon@free-electrons.com>,
	<alexandre.belloni@free-electrons.com>,
	<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<joshc@ni.com>
Subject: Re: [PATCH v3 net-next] net: ethernet: cadence-macb: Add disabled usrio caps
Date: Mon, 4 Jan 2016 10:25:13 +0100	[thread overview]
Message-ID: <568A3A79.5070502@atmel.com> (raw)
In-Reply-To: <1451898103-21868-1-git-send-email-narmstrong@baylibre.com>

Le 04/01/2016 10:01, Neil Armstrong a écrit :
> On some platforms, the macb integration does not use the USRIO
> register to configure the (R)MII port and clocks.
> When the register is not implemented and the MACB error signal
> is connected to the bus error, reading or writing to the USRIO
> register can trigger some Imprecise External Aborts on ARM platforms.
> 
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> ---
>  drivers/net/ethernet/cadence/macb.c | 27 +++++++++++++++------------
>  drivers/net/ethernet/cadence/macb.h |  1 +
>  2 files changed, 16 insertions(+), 12 deletions(-)
> 
> Nicolas,
> I post only the first patch of the previous set posted here :
> http://lkml.kernel.org/r/1449582726-6148-1-git-send-email-narmstrong@baylibre.com
> to hopefully make it into the 4.5 merge time,
> I'll post the vendor prefix once this patch will hit mainline.

Okay, but I don't see how you will activate this capability (or I lost
track of it). So, before I can accept one solution, can you please
repost the whole solution as a v4.

Thanks. Bye,


> 
> Regards,
> Neil
> 
> diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
> index 8b45bc9..fa53bc3 100644
> --- a/drivers/net/ethernet/cadence/macb.c
> +++ b/drivers/net/ethernet/cadence/macb.c
> @@ -2124,7 +2124,8 @@ static void macb_get_regs(struct net_device *dev, struct ethtool_regs *regs,
>  	regs_buff[10] = macb_tx_dma(&bp->queues[0], tail);
>  	regs_buff[11] = macb_tx_dma(&bp->queues[0], head);
>  
> -	regs_buff[12] = macb_or_gem_readl(bp, USRIO);
> +	if (!(bp->caps & MACB_CAPS_USRIO_DISABLED))
> +		regs_buff[12] = macb_or_gem_readl(bp, USRIO);
>  	if (macb_is_gem(bp)) {
>  		regs_buff[13] = gem_readl(bp, DMACFG);
>  	}
> @@ -2403,19 +2404,21 @@ static int macb_init(struct platform_device *pdev)
>  		dev->hw_features &= ~NETIF_F_SG;
>  	dev->features = dev->hw_features;
>  
> -	val = 0;
> -	if (bp->phy_interface == PHY_INTERFACE_MODE_RGMII)
> -		val = GEM_BIT(RGMII);
> -	else if (bp->phy_interface == PHY_INTERFACE_MODE_RMII &&
> -		 (bp->caps & MACB_CAPS_USRIO_DEFAULT_IS_MII))
> -		val = MACB_BIT(RMII);
> -	else if (!(bp->caps & MACB_CAPS_USRIO_DEFAULT_IS_MII))
> -		val = MACB_BIT(MII);
> +	if (!(bp->caps & MACB_CAPS_USRIO_DISABLED)) {
> +		val = 0;
> +		if (bp->phy_interface == PHY_INTERFACE_MODE_RGMII)
> +			val = GEM_BIT(RGMII);
> +		else if (bp->phy_interface == PHY_INTERFACE_MODE_RMII &&
> +			 (bp->caps & MACB_CAPS_USRIO_DEFAULT_IS_MII))
> +			val = MACB_BIT(RMII);
> +		else if (!(bp->caps & MACB_CAPS_USRIO_DEFAULT_IS_MII))
> +			val = MACB_BIT(MII);
>  
> -	if (bp->caps & MACB_CAPS_USRIO_HAS_CLKEN)
> -		val |= MACB_BIT(CLKEN);
> +		if (bp->caps & MACB_CAPS_USRIO_HAS_CLKEN)
> +			val |= MACB_BIT(CLKEN);
>  
> -	macb_or_gem_writel(bp, USRIO, val);
> +		macb_or_gem_writel(bp, USRIO, val);
> +	}
>  
>  	/* Set MII management clock divider */
>  	val = macb_mdc_clk_div(bp);
> diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
> index 5c03e81..0d4ecfc 100644
> --- a/drivers/net/ethernet/cadence/macb.h
> +++ b/drivers/net/ethernet/cadence/macb.h
> @@ -400,6 +400,7 @@
>  #define MACB_CAPS_USRIO_HAS_CLKEN		0x00000002
>  #define MACB_CAPS_USRIO_DEFAULT_IS_MII		0x00000004
>  #define MACB_CAPS_NO_GIGABIT_HALF		0x00000008
> +#define MACB_CAPS_USRIO_DISABLED		0x00000010
>  #define MACB_CAPS_FIFO_MODE			0x10000000
>  #define MACB_CAPS_GIGABIT_MODE_AVAILABLE	0x20000000
>  #define MACB_CAPS_SG_DISABLED			0x40000000
> 


-- 
Nicolas Ferre

  reply	other threads:[~2016-01-04  9:24 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-07 10:58 [PATCH net 0/2] Add a property to disable MACB USRIO register Neil Armstrong
2015-12-07 10:58 ` [PATCH net 1/2] net: cadence: macb: Disable USRIO register on some platforms Neil Armstrong
2015-12-07 19:09   ` David Miller
2015-12-07 19:09     ` David Miller
2015-12-07 19:32   ` Josh Cartwright
2015-12-08  9:21     ` Neil Armstrong
2015-12-08  9:38       ` Nicolas Ferre
2015-12-08  9:38         ` Nicolas Ferre
2015-12-08  9:38         ` Nicolas Ferre
2015-12-07 10:58 ` [PATCH net 2/2] bindings: net: macb: add no-usrio optional property Neil Armstrong
2015-12-08 15:26   ` Rob Herring
2015-12-08 13:52 ` [PATCH v2 net-next 0/3] Add new capability and parse from DT Neil Armstrong
2015-12-08 13:52   ` [PATCH v2 net-next 1/3] net: ethernet: cadence-macb: Add disabled usrio caps Neil Armstrong
2015-12-08 13:52     ` Neil Armstrong
2015-12-08 13:52   ` [PATCH v2 net-next 2/3] net: ethernet: cadence-macb: Add fallback to read DT provided caps Neil Armstrong
2015-12-08 15:00     ` Arnd Bergmann
2015-12-08 16:22       ` Nicolas Ferre
2015-12-08 16:22         ` Nicolas Ferre
2015-12-08 13:52   ` [PATCH v2 net-next 3/3] bindings: ethernet: macb: Add optional caps properties Neil Armstrong
2015-12-08 13:52     ` Neil Armstrong
2015-12-09  3:49     ` Rob Herring
2016-01-04  9:01   ` [PATCH v3 net-next] net: ethernet: cadence-macb: Add disabled usrio caps Neil Armstrong
2016-01-04  9:25     ` Nicolas Ferre [this message]
2016-01-04  9:42     ` [PATCH v4 net-next 0/3] Add new capability and macb DT variant Neil Armstrong
2016-01-04  9:42       ` [PATCH v4 net-next 1/3] net: ethernet: cadence-macb: Add disabled usrio caps Neil Armstrong
2016-01-04  9:42         ` Neil Armstrong
2016-01-04  9:42       ` [PATCH v4 net-next 2/3] net: macb: Add NPx macb config using USRIO_DISABLED cap Neil Armstrong
2016-01-04 10:38         ` Nicolas Ferre
2016-01-04 10:38           ` Nicolas Ferre
2016-01-04 10:38           ` Nicolas Ferre
2016-01-05 12:20           ` Neil Armstrong
2016-01-05 13:27             ` Nicolas Ferre
2016-01-05 13:27               ` Nicolas Ferre
2016-01-05 13:27               ` Nicolas Ferre
2016-01-04  9:42       ` [PATCH v4 net-next 3/3] dt-bindings: net: macb: Add NPx macb variant Neil Armstrong
2016-01-04  9:42         ` Neil Armstrong
2016-01-05 13:39       ` [PATCH v5 net-next 0/3] Add new capability and macb DT variant Neil Armstrong
2016-01-05 13:39         ` Neil Armstrong
2016-01-05 13:39         ` [PATCH v5 net-next 1/3] net: ethernet: cadence-macb: Add disabled usrio caps Neil Armstrong
2016-01-05 13:45           ` Nicolas Ferre
2016-01-05 13:45             ` Nicolas Ferre
2016-01-05 13:39         ` [PATCH v5 net-next 2/3] net: macb: Add NP4 macb config using USRIO_DISABLED Neil Armstrong
2016-01-05 13:39           ` Neil Armstrong
2016-01-05 13:45           ` Nicolas Ferre
2016-01-05 13:45             ` Nicolas Ferre
2016-01-05 13:39         ` [PATCH v5 net-next 3/3] dt-bindings: net: macb: Add NP4 macb variant Neil Armstrong
2016-01-05 13:39           ` Neil Armstrong
2016-01-05 13:46           ` Nicolas Ferre
2016-01-05 13:46             ` Nicolas Ferre
2016-01-05 13:46             ` Nicolas Ferre
2016-01-06 14:52           ` Rob Herring
2016-01-07 21:26         ` [PATCH v5 net-next 0/3] Add new capability and macb DT variant David Miller

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=568A3A79.5070502@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=davem@davemloft.net \
    --cc=harini.katakam@xilinx.com \
    --cc=joshc@ni.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=narmstrong@baylibre.com \
    --cc=netdev@vger.kernel.org \
    /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.