
Dear Dirk Eibach,
In message e8fccb4d422d619744521268691e5a9b@gdsys.cc you wrote:
You had the this, and now attempt to throw it away. This makes no sense.
In fact it does. We have FPGAs that are memory mapped and others that are not. They must be accessed by the same drivers. So the alternative would be to create FPGA instances at address NULL and getting the register offesets by casting pointers to u16. Not very nice either.
Your new code still boils down to using the same standard I/O accessors.
So your FPGA registers must be mapped somehow to I/O memory.
When you can do something like
+u16 fpga_get_reg(unsigned int fpga, u16 reg) +{ + return in_le16((u16 *)CONFIG_SYS_FPGA_BASE(fpga) + reg / sizeof(u16)); +}
why would you not be able to continue using in_le16() directly?
Sorry, I don't get it.
Best regards,
Wolfgang Denk