001-mtk-0017-net-mediatek-remap-iobase-address.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. From 391785398f61c85e6b55b1e9edbab94e3ba1b783 Mon Sep 17 00:00:00 2001
  2. From: Weijie Gao <[email protected]>
  3. Date: Fri, 20 May 2022 11:23:31 +0800
  4. Subject: [PATCH 17/25] net: mediatek: remap iobase address
  5. The iobase address from dts node is actually physical address. It's
  6. identical to the virtual address in ARM platform. This is ok because this
  7. driver was used only by ARM platforms (mt7622/mt7623 ...).
  8. But now this driver will be used by mt7621 which is a MIPS SoC. For MIPS
  9. platform the physical address space is mapped to KSEG0 and KSEG1 and this
  10. makes the virtual address apparently not idential to its physical address.
  11. To solve this issue, this patch replaces dev_read_addr with dev_remap_addr
  12. to get the remapped iobase address.
  13. Reviewed-by: Ramon Fried <[email protected]>
  14. Signed-off-by: Weijie Gao <[email protected]>
  15. ---
  16. drivers/net/mtk_eth.c | 2 +-
  17. 1 file changed, 1 insertion(+), 1 deletion(-)
  18. --- a/drivers/net/mtk_eth.c
  19. +++ b/drivers/net/mtk_eth.c
  20. @@ -1419,7 +1419,7 @@ static int mtk_eth_of_to_plat(struct ude
  21. priv->soc = dev_get_driver_data(dev);
  22. - pdata->iobase = dev_read_addr(dev);
  23. + pdata->iobase = (phys_addr_t)dev_remap_addr(dev);
  24. /* get corresponding ethsys phandle */
  25. ret = dev_read_phandle_with_args(dev, "mediatek,ethsys", NULL, 0, 0,