Message ID | 40c222760c85905f081e9b9f0c2091e960aac7bd.1652183768.git.weijie.gao@mediatek.com |
---|---|
State | Superseded |
Delegated to: | Daniel Schwierzeck |
Headers | show |
Series | Add support for MediaTek MT7621 SoC | expand |
On Tue, May 10, 2022 at 3:20 PM Weijie Gao <weijie.gao@mediatek.com> wrote: > > 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 > Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
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,
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(-)