USDHC driver failure and imx8mm platfrom support

Stefan Kalkowski stefan.kalkowski at genode-labs.com
Mon Nov 21 16:45:16 CET 2022


Hello Jean-Adrien,

On Fri, Nov 18, 2022 at 02:45:21PM +0100, Jean-Adrien Domage wrote:
> 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?

Thank you for the detailed explanation and background information!
The CCM register definitions alone are not necessarily the only thing
that differ. You might need to look at the tree structure, meaning
the dependencies in between the clocks too.
Maybe it helps to identify the differences within the Linux kernel
code at drivers/clk/imx/clk-imx8m*.c?

> 
> 2. To someone with experience with the `sd_card_drv` imx8mq, do you think
> fixing the CCM would also solve any voltage validation sequences?

I really don't know, but I would not necessarily exclude it. But when
looking at the device-tree of the `imx8mm-*.dts` files in Linux, I
assume the pin settings are more important.

> 
> 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.

For getting fast results, we've set static IOMUX controls within
bootstrap, but nothing keeps you from having a dedicated pin control
service, which allows changing the pin settings dynamically. Please,
have a look at the example driver `src/drivers/pin` within the
genode-allwinner repository.
When having such a driver, you can change the settings dynamically via
the pin_control and pin_state session interfaces.

Regards
Stefan

> 
> 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

> _______________________________________________
> Genode users mailing list
> users at lists.genode.org
> https://lists.genode.org/listinfo/users


-- 
Stefan Kalkowski
Genode labs

https://github.com/skalk | https://genode.org



More information about the users mailing list