atmel-mci: slot number vs SDIO function ID
Hello,
I encounter problems using a specific SDIO card with the atmel-mci driver. As far as I understand, the reason for this problem is a colliding usage of the 'reg' property in the SDIO and the atmel-mci implementation.
In detail:
This is a custom hardware board, based on a SAMA5D36 processor, where the SDIO card is attached to MMC2. The SDIO card is a silabs wf200 wifi transceiver.
This driver need a device tree node as child to the mmc device tree node to work, as documented in Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml, and this device tree request the 'reg' property set to 1 to indicate that we want this device tree node to match SDIO function 1. Such usage of the 'reg' property to select the SDIO function is documented in Documentation/devicetree/bindings/mmc/mmc-controller.yaml. On the other hand, the documentation of the atmel-mci controller claims that the 'reg' property selects the MMC slot to be used, as documented in Documentation/devicetree/bindings/mmc/atmel,hsmci.yaml
These two definitions collide and prevent the driver of the wifi card to work with the atmel mci controller: If I set the 'reg' value to 1, the generic SDIO implementation matches the device tree properly, but the card does not come up because it is on slot 0 and the atmel-mmc implemention uses slot 1 instead because of his interpretation of the 'reg' value. If I set the 'reg' value to 0, then the card is properly detected, but the device tree node does not match and therefore the wfx driver probe fails.
Since the multi-slot support in the atmel-mci is marked 'experimental' (for years...), I guess that this implementation should be changed to correspond to the definition of the 'reg' property as described in Documentation/devicetree/bindings/mmc/mmc-controller.yaml?
I did a patch that solved my problem, by adding another device tree property 'slot' to the atmel-mci driver and use that new property instead of the 'reg' property to identify the slot. But I am unsure that this is the right way.
I observed this on linux kernel version 6.6.118, but there seems to be no changes handling that topic since then.
Best regards, Ulrich Mohr