All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramon Fried <rfried.dev@gmail.com>
To: Weijie Gao <weijie.gao@mediatek.com>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	 GSS_MTK_Uboot_upstream <GSS_MTK_Uboot_upstream@mediatek.com>,
	 Joe Hershberger <joe.hershberger@ni.com>
Subject: Re: [PATCH v4 19/25] net: mediatek: add support for MediaTek MT7621 SoC
Date: Mon, 16 May 2022 03:25:47 +0300	[thread overview]
Message-ID: <CAGi-RUK3SZG8TDhcUhUbOKFBFtzNmDwHV_JMHu5QEnJ5YEWJ7Q@mail.gmail.com> (raw)
In-Reply-To: <f1808e72628baed6a3b36bd534ceadf7016cd9d8.1652183768.git.weijie.gao@mediatek.com>

On Tue, May 10, 2022 at 3:20 PM Weijie Gao <weijie.gao@mediatek.com> wrote:
>
> This patch adds GMAC support for MediaTek MT7621 SoC.
> MT7621 has the same GMAC/Switch configuration as MT7623.
>
> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
> ---
> v4 changes:
>   Split unrelated changes to new patches
> v3 changes:
>   Add register remap needed by mt7621
>   Fix use of noncached_alloc
> v2 changes: none
> ---
>  drivers/net/mtk_eth.c | 21 +++++++++++++++------
>  1 file changed, 15 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/mtk_eth.c b/drivers/net/mtk_eth.c
> index ac1e8abd71..4fe7ee0d36 100644
> --- a/drivers/net/mtk_eth.c
> +++ b/drivers/net/mtk_eth.c
> @@ -145,7 +145,8 @@ enum mtk_switch {
>  enum mtk_soc {
>         SOC_MT7623,
>         SOC_MT7629,
> -       SOC_MT7622
> +       SOC_MT7622,
> +       SOC_MT7621
>  };
>
>  struct mtk_eth_priv {
> @@ -675,12 +676,18 @@ static int mt7530_pad_clk_setup(struct mtk_eth_priv *priv, int mode)
>  static int mt7530_setup(struct mtk_eth_priv *priv)
>  {
>         u16 phy_addr, phy_val;
> -       u32 val;
> +       u32 val, txdrv;
>         int i;
>
> -       /* Select 250MHz clk for RGMII mode */
> -       mtk_ethsys_rmw(priv, ETHSYS_CLKCFG0_REG,
> -                      ETHSYS_TRGMII_CLK_SEL362_5, 0);
> +       if (priv->soc != SOC_MT7621) {
> +               /* Select 250MHz clk for RGMII mode */
> +               mtk_ethsys_rmw(priv, ETHSYS_CLKCFG0_REG,
> +                              ETHSYS_TRGMII_CLK_SEL362_5, 0);
> +
> +               txdrv = 8;
> +       } else {
> +               txdrv = 4;
> +       }
>
>         /* Modify HWTRAP first to allow direct access to internal PHYs */
>         mt753x_reg_read(priv, HWTRAP_REG, &val);
> @@ -738,7 +745,8 @@ static int mt7530_setup(struct mtk_eth_priv *priv)
>         /* Lower Tx Driving for TRGMII path */
>         for (i = 0 ; i < NUM_TRGMII_CTRL ; i++)
>                 mt753x_reg_write(priv, MT7530_TRGMII_TD_ODT(i),
> -                                (8 << TD_DM_DRVP_S) | (8 << TD_DM_DRVN_S));
> +                                (txdrv << TD_DM_DRVP_S) |
> +                                (txdrv << TD_DM_DRVN_S));
>
>         for (i = 0 ; i < NUM_TRGMII_CTRL; i++)
>                 mt753x_reg_rmw(priv, MT7530_TRGMII_RD(i), RD_TAP_M, 16);
> @@ -1540,6 +1548,7 @@ static const struct udevice_id mtk_eth_ids[] = {
>         { .compatible = "mediatek,mt7629-eth", .data = SOC_MT7629 },
>         { .compatible = "mediatek,mt7623-eth", .data = SOC_MT7623 },
>         { .compatible = "mediatek,mt7622-eth", .data = SOC_MT7622 },
> +       { .compatible = "mediatek,mt7621-eth", .data = SOC_MT7621 },
>         {}
>  };
>
> --
> 2.17.1
>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>

  reply	other threads:[~2022-05-16  0:26 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10 12:18 [PATCH v4 00/25] Add support for MediaTek MT7621 SoC Weijie Gao
2022-05-10 12:18 ` [PATCH v4 01/25] mips: add asm/mipsmtregs.h for MIPS multi-threading Weijie Gao
2022-05-10 12:18 ` [PATCH v4 02/25] mips: add more definitions for asm/cm.h Weijie Gao
2022-05-10 12:18 ` [PATCH v4 03/25] mips: add __image_copy_len for SPL linker script Weijie Gao
2022-05-10 12:18 ` [PATCH v4 04/25] mips: add support for noncached_alloc() Weijie Gao
2022-05-10 12:18 ` [PATCH v4 05/25] mips: mtmips: add support for MediaTek MT7621 SoC Weijie Gao
2022-05-11 16:36   ` Sean Anderson
2022-05-12  3:00     ` Weijie Gao
2022-05-10 12:18 ` [PATCH v4 06/25] mips: mtmips: add two reference boards for mt7621 Weijie Gao
2022-05-10 13:26   ` Stefan Roese
2022-05-10 12:18 ` [PATCH v4 07/25] doc: mediatek: add documentation for mt7621 reference boards Weijie Gao
2022-05-10 12:18 ` [PATCH v4 08/25] clk: mtmips: add clock driver for MediaTek MT7621 SoC Weijie Gao
2022-05-11 16:29   ` Sean Anderson
2022-05-12  2:38     ` Weijie Gao
2022-05-10 12:18 ` [PATCH v4 09/25] reset: mtmips: add reset controller support " Weijie Gao
2022-05-10 12:18 ` [PATCH v4 10/25] pinctrl: mtmips: add " Weijie Gao
2022-05-10 12:19 ` [PATCH v4 11/25] usb: xhci-mtk: " Weijie Gao
2022-05-10 12:19 ` [PATCH v4 12/25] phy: mtk-tphy: " Weijie Gao
2022-05-10 12:19 ` [PATCH v4 13/25] spi: " Weijie Gao
2022-05-10 12:19 ` [PATCH v4 14/25] gpio: " Weijie Gao
2022-05-10 12:19 ` [PATCH v4 15/25] watchdog: " Weijie Gao
2022-05-10 12:19 ` [PATCH v4 16/25] mmc: mediatek: " Weijie Gao
2022-05-10 12:19 ` [PATCH v4 17/25] net: mediatek: remap iobase address Weijie Gao
2022-05-16  0:24   ` Ramon Fried
2022-05-10 12:19 ` [PATCH v4 18/25] net: mediatek: use regmap api to modify ethsys registers Weijie Gao
2022-05-16  0:25   ` Ramon Fried
2022-05-10 12:19 ` [PATCH v4 19/25] net: mediatek: add support for MediaTek MT7621 SoC Weijie Gao
2022-05-16  0:25   ` Ramon Fried [this message]
2022-05-10 12:19 ` [PATCH v4 20/25] nand: raw: " Weijie Gao
2022-05-10 12:20 ` [PATCH v4 21/25] spl: allow using nand base without standard nand driver Weijie Gao
2022-05-10 12:20 ` [PATCH v4 22/25] spl: spl_legacy: fix the use of SPL_COPY_PAYLOAD_ONLY Weijie Gao
2022-05-10 12:20 ` [PATCH v4 23/25] spl: nand: support loading legacy image with payload compressed Weijie Gao
2022-05-10 12:20 ` [PATCH v4 24/25] tools: mtk_image: add support for MT7621 NAND images Weijie Gao
2022-05-10 12:20 ` [PATCH v4 25/25] MAINTAINERS: update maintainer for MediaTek MIPS platform Weijie Gao

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=CAGi-RUK3SZG8TDhcUhUbOKFBFtzNmDwHV_JMHu5QEnJ5YEWJ7Q@mail.gmail.com \
    --to=rfried.dev@gmail.com \
    --cc=GSS_MTK_Uboot_upstream@mediatek.com \
    --cc=joe.hershberger@ni.com \
    --cc=u-boot@lists.denx.de \
    --cc=weijie.gao@mediatek.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.