Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1469477 > unrolled thread

Re: [PATCH v2 1/5] ethernet: add sun8i-emac driver

Started byLABBE Corentin <clabbe.montjoie@gmail.com>
First post2016-08-24 16:10 +0200
Last post2016-08-24 16:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v2 1/5] ethernet: add sun8i-emac driver LABBE Corentin <clabbe.montjoie@gmail.com> - 2016-08-24 16:10 +0200

#1469477 — Re: [PATCH v2 1/5] ethernet: add sun8i-emac driver

FromLABBE Corentin <clabbe.montjoie@gmail.com>
Date2016-08-24 16:10 +0200
SubjectRe: [PATCH v2 1/5] ethernet: add sun8i-emac driver
Message-ID<s9H2q-3m5-9@gated-at.bofh.it>
> > +/* Set Management Data Clock, must be call after device reset */
> > +static void sun8i_emac_set_mdc(struct net_device *ndev)
> > +{
> > +	struct sun8i_emac_priv *priv = netdev_priv(ndev);
> > +	unsigned long rate;
> > +	u32 reg;
> > +
> > +	rate = clk_get_rate(priv->ahb_clk);
> > +	if (rate > 160000000)
> > +		reg = 0x3 << 20; /* AHB / 128 */
> > +	else if (rate > 80000000)
> > +		reg = 0x2 << 20; /* AHB / 64 */
> > +	else if (rate > 40000000)
> > +		reg = 0x1 << 20; /* AHB / 32 */
> > +	else
> > +		reg = 0x0 << 20; /* AHB / 16 */
> > +	netif_dbg(priv, link, ndev, "MDC auto : %x\n", reg);
> > +	writel(reg, priv->base + SUN8I_EMAC_MDIO_CMD);
> 
> You could also expose that as a clock.
> 

For which purpose ?
No ethernet driver expose the MDC as clock and I dont see any interest:
- I dont think that tuning it give any gain
- Knowing it's value is of little interest

Regards

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web