jlaitine commented on PR #19883: URL: https://github.com/apache/nuttx/pull/19883#issuecomment-5316471841
Good initiative @Fishwaldo ! I have just a few comments on the sequence - I believe switching to high speed mode shouldn't be a capability of the driver; it should be just queried from the card if it supports the mode. That is, you should first send CMD6 with "check" to the card, and the interpret whether the card supports it - Only after the card replies that it supports the speed, you should switch to HS mode by re-sending the CMD6 with "switch" bits - You should always switch to HS mode, if the bus frequency is > 25MHz ; or, if the card doesn't support HS mode, you should restrict the bus speed to 25MHz - Driver support is, IMHO, more about whether the driver can switch to bus speeds above 25MHz; but it shouldn't be illegal to run the card in HS mode even with lower bus speeds. I implemented this earlier for imx9 only in a way that it tries to switch the card to HS mode in case the board defines bus speeds above 25MHz. I never started doing a generic support; I wasn't quite sure what would have been the "proper" way to do it. It should probably first check which bus speeds the driver supports and which modes the card supports - then make a list of supported modes by both card and driver and finally try to switch to highest possible mode. Then if that fails, drop down from there... On the other hand, probably all the cards out there nowdays do support HS mode, so perhaps it is fine to do as what you did - just always switch to that. I am not sure. Anyhow, I would like to see some discussion on how the generic support is baked in and what tradeoffs we can take w.r.t the specs. What you are trying to do is, of course, much better than what I did for just implementing the support for single architecture. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
