All of lore.kernel.org
 help / color / mirror / Atom feed
From: Weijie Gao <weijie.gao@mediatek.com>
To: <u-boot@lists.denx.de>
Cc: GSS_MTK_Uboot_upstream <GSS_MTK_Uboot_upstream@mediatek.com>,
	"Joe Hershberger" <joe.hershberger@ni.com>,
	Ramon Fried <rfried.dev@gmail.com>,
	Weijie Gao <weijie.gao@mediatek.com>
Subject: [PATCH v4 17/25] net: mediatek: remap iobase address
Date: Tue, 10 May 2022 20:19:37 +0800	[thread overview]
Message-ID: <40c222760c85905f081e9b9f0c2091e960aac7bd.1652183768.git.weijie.gao@mediatek.com> (raw)
In-Reply-To: <cover.1652183768.git.weijie.gao@mediatek.com>

The iobase address from dts node is actually physical address. It's
identical to the virtual address in ARM platform. This is ok because this
driver was used only by ARM platforms (mt7622/mt7623 ...).

But now this driver will be used by mt7621 which is a MIPS SoC. For MIPS
platform the physical address space is mapped to KSEG0 and KSEG1 and this
makes the virtual address apparently not idential to its physical address.

To solve this issue, this patch replaces dev_read_addr with dev_remap_addr
to get the remapped iobase address.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
---
v4 changes: new
---
 drivers/net/mtk_eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mtk_eth.c b/drivers/net/mtk_eth.c
index 666ddeb10d..caa83b7cec 100644
--- a/drivers/net/mtk_eth.c
+++ b/drivers/net/mtk_eth.c
@@ -1419,7 +1419,7 @@ static int mtk_eth_of_to_plat(struct udevice *dev)
 
 	priv->soc = dev_get_driver_data(dev);
 
-	pdata->iobase = dev_read_addr(dev);
+	pdata->iobase = (phys_addr_t)dev_remap_addr(dev);
 
 	/* get corresponding ethsys phandle */
 	ret = dev_read_phandle_with_args(dev, "mediatek,ethsys", NULL, 0, 0,
-- 
2.17.1


  parent reply	other threads:[~2022-05-10 12:30 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 ` Weijie Gao [this message]
2022-05-16  0:24   ` [PATCH v4 17/25] net: mediatek: remap iobase address 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
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=40c222760c85905f081e9b9f0c2091e960aac7bd.1652183768.git.weijie.gao@mediatek.com \
    --to=weijie.gao@mediatek.com \
    --cc=GSS_MTK_Uboot_upstream@mediatek.com \
    --cc=joe.hershberger@ni.com \
    --cc=rfried.dev@gmail.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.