raspberrypi / windows-drivers

Windows IOT drivers
MIT License
121 stars 33 forks source link

bcmemmc2 - use OverrrideFlags #29

Closed idigdoug closed 3 years ago

idigdoug commented 3 years ago

We're currently using service parameters (which apply at the driver level) to disable UHS. We should instead be using OverrideFlags (which apply at the device level).

For future consideration, sdbus.sys DMA works fine on RPi400. If we could get a distinct hardware ID for the new chip (e.g. a REV), we could enable DMA support on RPi400. In fact, on RPi400, sdbus.sys seems to work ok with no overrides, so it would be reasonable to declare the C0 revision as compatible with standard sdhost.

mariobalanica commented 3 years ago

Is the full list of per-device flags documented anywhere?

idigdoug commented 3 years ago

Unfortunately, I am not aware of any documentation for any of the flags (Parameters, DmaMethod, OverrideFlags).

idigdoug commented 3 years ago

One additional comment is that I did some experimentation and sdbus actually worked just fine (for the SD cards I tried) without any OverrideFlags. Without any flags, it attempts to set 1.8v, fails, resets the port, and just runs in HighSpeed. The only flag that is truly needed is DmaMode, and that is only needed for the B0 stepping.

mariobalanica commented 3 years ago

One additional comment is that I did some experimentation and sdbus actually worked just fine (for the SD cards I tried) without any OverrideFlags. Without any flags, it attempts to set 1.8v, fails, resets the port, and just runs in HighSpeed.

Have you tested this on the B0 revision too? It never reads my card without disabling support for UHS-I.

idigdoug commented 3 years ago

I tested 2 cards, with and without OverrideFlags, on both B0 (my RPi4) and C0 (my RPi400). Worked ok for me in all cases. But I don't like relying on the error recovery, so the OverrideFlags are definitely something we want to keep. If you have cards that didn't work without UHS-I disabled, it would definitely be a good idea to test those before committing this.

idigdoug commented 3 years ago

Ok, my tests are flawed because there were remnants of previous drivers. Testing is starting over...

idigdoug commented 3 years ago

Ok, you are correct. With OverrideFlags = 0, things do not work.

With the OverrideFlags = 0x10008000, things are fine. I successfully tested 5 cards on my RPi4 and 1 card on RPi400.

mariobalanica commented 3 years ago

Good! Thanks.