Dear Genodians,
I need help with the clock controller module in the platform
driver for an imx8mm-based SoC. We must configure the clock
controller module to communicate with an eMMC device.
We have worked with the Compulab imx8mm IoT gateway for a year. So
far, it has worked exceptionally well. We received a board from
Compulab with a new revision and an updated Linux BSP a few weeks
ago.
Unfortunately, the new version of that board broke the eMMC
driver. I have not yet been able to get eMMC working with the new
driver.
We ported the eMMC driver from the older Linux BSP for the older
version of the board. That version of the driver does not work
with the new board because of a voltage validation sequence
failure. I suspect this is because we assumed only minimal
modifications are needed in the platform driver to enable imx8mm
from the existing imx8mq base. I recently discovered that the CCM
register definition differs quite substantially between imx8mm and
imx8mq. You can see this discrepancy in section 5.1.8.1
("CCM_analog memory map definition") from the SoC reference manual
of the imx8mq and imx8mm SoC.
It looks like the older board worked out of pure luck because
U-Boot sets these CCM registers correctly, and the platform driver
does not alter them in a way that breaks the expected behavior.
Here are my thoughts on solving the eMMC driver of the new board:
There appears to be no way around rewriting `ccm.cc` and `ccm.h`
of the `platform_drv` for the imx8mm SoC to set the CCM registers
correctly.
However, I'm not 100% convinced that it would help with my eMMC
problem.
1. This approach seems straightforward fix the CCM registers to
set the proper clock settings and gating. Can someone confirm?
2. To someone with experience with the `sd_card_drv` imx8mq, do
you think fixing the CCM would also solve any voltage validation
sequences?
3. The new Linux eMMC driver tries to reconfigure the `pinctrl`
for the controller multiple times. Is it currently impossible to
do that from a component with base-hw kernel using the Linux DDE?
Only the `platform.cc` from the `bootstrap` boot module seems to
be able to set that configuration. Setting that configuration
within the `bootstrap` module is how we currently achieve it on
the older board.
I have pushed my imx8mm changes to the following repository:
https://github.com/a-dmg/genode-imx/tree/1558-merge_imx_and_imx8mm_repos
This repo works with Genode 22.08 on the older revision of the
Compulab imx8mm IoT gateway. I created a run script called
`sd_card_imx8mm_iot_gate.run` to verify this.
Cheers!
Jad
----
Jean-Adrien Domage
Software Engineer
Gapfruit AG