All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark-MC.Lee <Mark-MC.Lee@mediatek.com>
To: u-boot@lists.denx.de
Subject: [U-boot,1/2] eth: mtk-eth: enable mt7629 sgmii mode support in mediatek eth driver
Date: Mon, 15 Jun 2020 15:19:30 +0800	[thread overview]
Message-ID: <1592205570.22827.4.camel@mtksdccf07> (raw)
In-Reply-To: <CAPnjgZ24q8pG3QRihB_kQJDYDNn9vvoU66qWuB-koNYN+VYdSg@mail.gmail.com>

On Sun, 2020-05-31 at 08:08 -0600, Simon Glass wrote:
> Hi MarkLee,
> 
> On Wed, 27 May 2020 at 05:25, MarkLee <Mark-MC.Lee@mediatek.com> wrote:
> >
> > The sgmii mode init flow is almost the same for all mediatek SoC, the
> > only difference is the register offset(SGMSYS_GEN2_SPEED) is 0x2028
> > for old chip(mt7622) but changed to 0x128 for newer chip(mt7629 and
> > the following chips).
> >
> > Signed-off-by: MarkLee <Mark-MC.Lee@mediatek.com>
> > ---
> >  drivers/net/mtk_eth.h | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/net/mtk_eth.h b/drivers/net/mtk_eth.h
> > index f2940c9996..3c85eab91a 100644
> > --- a/drivers/net/mtk_eth.h
> > +++ b/drivers/net/mtk_eth.h
> > @@ -44,7 +44,12 @@
> >  #define SGMSYS_QPHY_PWR_STATE_CTRL     0xe8
> >  #define SGMII_PHYA_PWD                 BIT(4)
> >
> > +#if defined(CONFIG_TARGET_MT7622)
> >  #define SGMSYS_GEN2_SPEED              0x2028
> > +#else
> > +#define SGMSYS_GEN2_SPEED              0x128
> > +#endif
> 
> You can't check #ifdefs in drivers. You should use a compatible
> string, then device_get_driver_data() to decide what the value is
> here.
Thanks for your review and suggestion, will change to use private data
from dts to decide the value in the following V2 patch.
> 
> Or if this is board-specific you could add it to the device-tree node
> as a property, if it is in the binding.
> 
> Regards,
> Simon

  reply	other threads:[~2020-06-15  7:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-27 11:25 [U-boot,0/2] Enable mt7531 switch support for MT7629 MarkLee
2020-05-27 11:25 ` [U-boot, 1/2] eth: mtk-eth: enable mt7629 sgmii mode support in mediatek eth driver MarkLee
2020-05-31 14:08   ` [U-boot,1/2] " Simon Glass
2020-06-15  7:19     ` Mark-MC.Lee [this message]
2020-05-27 11:25 ` [U-boot, 2/2] arm: dts: mediatek: enable sgmii mode and mt7531 switch for mt7629 MarkLee

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=1592205570.22827.4.camel@mtksdccf07 \
    --to=mark-mc.lee@mediatek.com \
    --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.