Closed bunnie closed 4 years ago
Hi Bunnie,
You are correct, reading the control register with a 2-byte access is the most efficient way to read the control register. Doing so has no impact on stability. The driver uses a 4-byte access for compatibility issues especially with SDIO drivers on various hosts. Some of this drivers require a 32-bit aligned size. It is the case for some MCUs or Linux hosts (https://elixir.bootlin.com/linux/latest/source/drivers/mmc/core/sdio_io.c#L205).
Makes sense, and thanks for explaining the issue. We'll keep this as a patch in our branch then.
the reg16 calls set the size field to 4, which causes an extra two cycles to occur for 16-bit reads/writes.
At least on my system, I am able to reduce this to just the 2 bytes expected of a 16-bit read/write and I have not seen any instability yet.