Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Future work for i.MX8 uSDHC driver #187

Open
2 of 10 tasks
Ivan-Velickovic opened this issue Aug 2, 2024 · 2 comments
Open
2 of 10 tasks

Future work for i.MX8 uSDHC driver #187

Ivan-Velickovic opened this issue Aug 2, 2024 · 2 comments

Comments

@Ivan-Velickovic
Copy link
Collaborator

Ivan-Velickovic commented Aug 2, 2024

#157 adds initial support for the i.MX8 based MMC block device.

The main motivation for this is to support experimentation regarding hot-plugging and so we do not implement all driver features you would expect with a uSDHC driver.

Below is various future work we may or may not implement. It is likely for the minor things and high-speed mode to be implemented eventually.

  • Version 1 SD cards (the initialisation flow)
  • Version 2 SDSC / SDXC cards (only because I haven't implemented support for calculating card capacity)
  • High-speed mode
  • Hook it up to a clock driver
  • Figure out if there is an optimal value for 'watermark level'. Right now we set it as the maximum (U-Boot does the same thing).
  • Properly initialise/reset VEND_SPEC register.
  • Voltage Negotiation (anything but 3.3V)
  • Card detect does not work (see followup comment)
  • When reading/writing blocks, we always set the block length with a uSDHC command. Don't think it should be necessary more than once so we should be able to omit it.
  • Properly set block config read_only flag.
@Ivan-Velickovic
Copy link
Collaborator Author

Ivan-Velickovic commented Aug 2, 2024

Whoops, wrong repository (fixed now).

@Ivan-Velickovic Ivan-Velickovic transferred this issue from au-ts/libvmm Aug 2, 2024
@midnightveil
Copy link
Contributor

Regarding card detection:

Neither the MaaxBoard nor the i.MX8MM-EVK board's (nominally-iMX8-specific) uSDHC controller fire the CINSIEN/CRMIEN IRQs for card insertion / removal, as per the standard SD-PHY specifications. However:

The iMX8MM-EVK specifies the cd-gpios property in its device tree, and is correctly updates to reflect the card status:

# in
u-boot=> gpio status
Bank GPIO1_:
GPIO1_15: input: 0 [x] [email protected]
# out
u-boot=> gpio status
Bank GPIO1_:
GPIO1_15: input: 1 [x] [email protected]

In contrast, the MaaXboard does not set the cd-gpios property in its device tree, and so U-Boot/Linux don't know about unplug/replug. However, there is still a GPIO linked up to the card detect pin:

# from running `gpio status -a` in uboot
$ diff ~/plug.txt ~/unplug.txt
8c8
< GPIO1_6: input: 0 [ ]
---
> GPIO1_6: input: 1 [ ]

For this feature to work, we need a GPIO driver and to listen for interrupts on those pins, as per the device tree for mmc controllers.

midnightveil added a commit that referenced this issue Aug 7, 2024
They weren't used anywhere, and wouldn't be handled correctly if they occurred.
Also see the notes about card detect on these boards in issue #187
#187 (comment)

Signed-off-by: julia <[email protected]>
midnightveil added a commit that referenced this issue Aug 9, 2024
They weren't used anywhere, and wouldn't be handled correctly if they occurred.
Also see the notes about card detect on these boards in issue #187
#187 (comment)

Signed-off-by: julia <[email protected]>
Ivan-Velickovic pushed a commit that referenced this issue Aug 9, 2024
They weren't used anywhere, and wouldn't be handled correctly if they occurred.
Also see the notes about card detect on these boards in issue #187
#187 (comment)

Signed-off-by: julia <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants