All of lore.kernel.org
 help / color / mirror / Atom feed
From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
To: Byungho An <bh74.an@samsung.com>
Cc: netdev@vger.kernel.org, rayagond@vayavyalabs.com
Subject: Re: [net-next.git 4/8] stmmac: initial support to manage pcs modes
Date: Tue, 02 Apr 2013 14:29:02 +0200	[thread overview]
Message-ID: <515ACF0E.6010100@st.com> (raw)
In-Reply-To: <000301ce2d05$57a153c0$06e3fb40$%an@samsung.com>

Hello Byungho

On 3/30/2013 6:13 AM, Byungho An wrote:
> On 3/26/2013 11:46 PM, Giuseppe CAVALLARO wrote:
>> This patch adds the minimal support to manage the PCS
>> modes (RGMII/SGMII) and restart the ANE.
>> Both TBI and RTBI are not yet supported.
>>
> [snip]
> .
>>   /**
>>    * stmmac_init_phy - PHY initialization
>>    * @dev: net device structure
>> @@ -1141,10 +1159,13 @@ static int stmmac_open(struct net_device *dev)
>>
>>   	stmmac_check_ether_addr(priv);
>>
>> -	ret = stmmac_init_phy(dev);
>> -	if (unlikely(ret)) {
>> -		pr_err("%s: Cannot attach to PHY (error: %d)\n", __func__,
>> ret);
>> -		goto open_error;
>> +	if (!priv->pcs) {
>> +		ret = stmmac_init_phy(dev);
>> +		if (ret) {
>> +			pr_err("%s: Cannot attach to PHY (error: %d)\n",
>> +			       __func__, ret);
>> +			goto open_error;
>> +		}
>>   	}
>>
> I think, even though SGMII do auto-negotiation with phy, stmmac_init_phy
> function is needed. In this condition "if (!priv->pcs)", SGMII platform
> can't attach phy.
> IMO, it is same in case of stmmac_mdio_register(ndev).
> In my platform, I modified this condition for SGMII like below.
> 	if (priv->pcs != STMMAC_PCS_RGMII && priv->pcs STMMAC_PCS_TBI &&
> priv->pcs != STMMAC_PCS_RTBI)

pls can you send a patch for this on top of net-next branch (with me on Cc)?

Indeed for sgmii I expected to also manage ane w/o invoking the PAL.
As you know I have no SGMII hw where test; at any rate I will check 
again asap.

peppe

>
>>   	/* Create and initialize the TX/RX descriptors chains. */
>> @@ -1233,7 +1254,12 @@ static int stmmac_open(struct net_device *dev)
>>   		phy_start(priv->phydev);
>>
>>   	priv->tx_lpi_timer = STMMAC_DEFAULT_TWT_LS_TIMER;
>> -	priv->eee_enabled = stmmac_eee_init(priv);
>> +
>> +	/* Using PCS we cannot dial with the phy registers at this stage
>> +	 * so we do not support extra feature like EEE.
>> +	 */
>> +	if (!priv->pcs)
>> +		priv->eee_enabled = stmmac_eee_init(priv);
>>
>>   	stmmac_init_tx_coalesce(priv);
>>
>> @@ -1242,6 +1268,9 @@ static int stmmac_open(struct net_device *dev)
>>   		priv->hw->dma->rx_watchdog(priv->ioaddr, MAX_DMA_RIWT);
>>   	}
>>
>> +	if (priv->pcs && priv->hw->mac->ctrl_ane)
>> +		priv->hw->mac->ctrl_ane(priv->ioaddr, 0);
>> +
>>   	napi_enable(&priv->napi);
>>   	netif_start_queue(dev);
>>
>> @@ -2225,12 +2254,16 @@ struct stmmac_priv *stmmac_dvr_probe(struct device
>> *device,
>>   	else
>>   		priv->clk_csr = priv->plat->clk_csr;
>>
>> -	/* MDIO bus Registration */
>> -	ret = stmmac_mdio_register(ndev);
>> -	if (ret < 0) {
>> -		pr_debug("%s: MDIO bus (id: %d) registration failed",
>> -			 __func__, priv->plat->bus_id);
>> -		goto error_mdio_register;
>> +	stmmac_check_pcs_mode(priv);
>> +
>> +	if (!priv->pcs) {
>> +		/* MDIO bus Registration */
>> +		ret = stmmac_mdio_register(ndev);
>> +		if (ret < 0) {
>> +			pr_debug("%s: MDIO bus (id: %d) registration
> failed",
>> +				 __func__, priv->plat->bus_id);
>> +			goto error_mdio_register;
>> +		}
>>   	}
>>
>>   	return priv;
>> @@ -2263,7 +2296,8 @@ int stmmac_dvr_remove(struct net_device *ndev)
>>   	priv->hw->dma->stop_tx(priv->ioaddr);
>>
>>   	stmmac_set_mac(priv->ioaddr, false);
>> -	stmmac_mdio_unregister(ndev);
>> +	if (!priv->pcs)
>> +		stmmac_mdio_unregister(ndev);
>>   	netif_carrier_off(ndev);
>>   	unregister_netdev(ndev);
>>   	free_netdev(ndev);
>> --
>> 1.7.4.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>

  reply	other threads:[~2013-04-02 12:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-26 14:43 [net-next.git 0/8 (v2)] stmmac: update to March_2013 (ext desc, PTP, SGMII) Giuseppe CAVALLARO
2013-03-26 14:43 ` [net-next.git 1/8] stmmac: reorganize chain/ring modes removing Koptions Giuseppe CAVALLARO
2013-03-26 14:43 ` [net-next.git 2/8 (v2)] stmmac: support extend descriptors Giuseppe CAVALLARO
2013-03-26 14:43 ` [net-next.git 3/8] stmmac: start adding pcs and rgmii core irq Giuseppe CAVALLARO
2013-03-26 14:43 ` [net-next.git 4/8] stmmac: initial support to manage pcs modes Giuseppe CAVALLARO
2013-03-30  5:13   ` Byungho An
2013-04-02 12:29     ` Giuseppe CAVALLARO [this message]
2013-03-26 14:43 ` [net-next.git 5/8 (v2)] stmmac: add tx_skbuff_dma to save descriptors used by PTP Giuseppe CAVALLARO
2013-03-26 14:43 ` [net-next.git 6/8 (v2)] stmmac: add IEEE PTPv1 and PTPv2 support Giuseppe CAVALLARO
2013-03-26 14:43 ` [net-next.git 7/8 (v2)] stmmac: add the support for PTP hw clock driver Giuseppe CAVALLARO
2013-03-26 14:43 ` [net-next.git 8/8] stmmac: update the Doc and Version (PTP+SGMII) Giuseppe CAVALLARO
2013-03-26 16:53 ` [net-next.git 0/8 (v2)] stmmac: update to March_2013 (ext desc, PTP, SGMII) 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=515ACF0E.6010100@st.com \
    --to=peppe.cavallaro@st.com \
    --cc=bh74.an@samsung.com \
    --cc=netdev@vger.kernel.org \
    --cc=rayagond@vayavyalabs.com \
    /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.