On 8/6/22 19:31, Ramon Fried wrote:
On Wed, Jul 13, 2022 at 5:02 PM Samuel Obuch <samuel.ob...@codasip.com> wrote:

Function ioremap_nocache seems to be defined only for mips and microblaze
architectures. Therefore, the function call in the emaclite driver causes
this driver to be unusable with other architectures, for example riscv.

Signed-off-by: Samuel Obuch <samuel.ob...@codasip.com>
---
  drivers/net/xilinx_emaclite.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c
index 6c9f1f7c27..5cd88e04fe 100644
--- a/drivers/net/xilinx_emaclite.c
+++ b/drivers/net/xilinx_emaclite.c
@@ -615,8 +615,12 @@ static int emaclite_of_to_plat(struct udevice *dev)
         int offset = 0;

         pdata->iobase = dev_read_addr(dev);
+#if defined(CONFIG_MICROBLAZE) || defined(CONFIG_MIPS)
         emaclite->regs = (struct emaclite_regs *)ioremap_nocache(pdata->iobase,
                                                                  0x10000);
+#else
+       emaclite->regs = (struct emaclite_regs *)pdata->iobase;
+#endif

         emaclite->phyaddr = -1;

--
2.31.1

Hm...
Well, this isn't right,The right solution is to replace
ioremap_nocache() with ioremap().
This way it will work both for MIPS and other architectures.
I can do it myself, you can fix your patch. let me know.

Microblaze doesn't define it now. But I agree that using ioremap which has implicit nocache is the right way to go.
It means please create the first patch which creates ioremap for microblaze,
Then second to replace ioremap_nocache() in emaclite driver to ioremap. And third to remove ioremap_nocache from microblaze io.h.

Thanks,
Michal

Reply via email to