aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/uboot-mediatek/patches/001-mtk-0019-net-mediatek-add-support-for-MediaTek-MT7621-SoC.patch
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2022-07-11 21:15:32 +0100
committerDaniel Golle <daniel@makrotopia.org>2022-07-11 21:27:24 +0100
commit2f7fb57c12d7afe5be7747611bceec92a4c0c834 (patch)
tree8766380a7feeb1350a6b78aa01014a8cb43c4e05 /package/boot/uboot-mediatek/patches/001-mtk-0019-net-mediatek-add-support-for-MediaTek-MT7621-SoC.patch
parentfa75a3a935b26378630498ba7d3f6a0b5b11f86e (diff)
downloadupstream-2f7fb57c12d7afe5be7747611bceec92a4c0c834.tar.gz
upstream-2f7fb57c12d7afe5be7747611bceec92a4c0c834.tar.bz2
upstream-2f7fb57c12d7afe5be7747611bceec92a4c0c834.zip
uboot-ramips: add support for MT7621, merge into uboot-mediatek
* Merge uboot-ramips into uboot-mediatek. * Port support for the RAVPower RP WD009 to U-Boot 2022.07. * Add support for MT7621 and add builds for the reference boards. * Add builds for MT7620 and MT7628 reference boards. This should help to make development of U-Boot-level board support for all MediaTek targets much easier. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'package/boot/uboot-mediatek/patches/001-mtk-0019-net-mediatek-add-support-for-MediaTek-MT7621-SoC.patch')
-rw-r--r--package/boot/uboot-mediatek/patches/001-mtk-0019-net-mediatek-add-support-for-MediaTek-MT7621-SoC.patch72
1 files changed, 72 insertions, 0 deletions
diff --git a/package/boot/uboot-mediatek/patches/001-mtk-0019-net-mediatek-add-support-for-MediaTek-MT7621-SoC.patch b/package/boot/uboot-mediatek/patches/001-mtk-0019-net-mediatek-add-support-for-MediaTek-MT7621-SoC.patch
new file mode 100644
index 0000000000..ce087fe3ac
--- /dev/null
+++ b/package/boot/uboot-mediatek/patches/001-mtk-0019-net-mediatek-add-support-for-MediaTek-MT7621-SoC.patch
@@ -0,0 +1,72 @@
+From 7237a6a0c020c05bb819774391154b40b2cfaabd Mon Sep 17 00:00:00 2001
+From: Weijie Gao <weijie.gao@mediatek.com>
+Date: Fri, 20 May 2022 11:23:42 +0800
+Subject: [PATCH 19/25] net: mediatek: add support for MediaTek MT7621 SoC
+
+This patch adds GMAC support for MediaTek MT7621 SoC.
+MT7621 has the same GMAC/Switch configuration as MT7623.
+
+Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
+Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
+---
+ 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.36.1
+