
On Sun, 5 Mar 2023 at 12:19, Pali Rohár pali@kernel.org wrote:
On Sunday 05 March 2023 21:30:57 Martin Rowe wrote:
A388 Clearfog MMC is either SD Card or eMMC with different behaviour for both. Setting MMC_BROKEN_CD allows both to correctly detect MMC.
When you are sending defconfig changes, please do not put there unrelated canonicalization changes. Canonicalization of defconfigs are done semi-automatically when Tom regenerates them. So avoid CONFIG_SUPPORT_EMMC_BOOT and CONFIG_CMD_MVEBU_BUBT changes for eMMC related change.
Noted. I'll fix it up.
Anyway, I have looked at how MMC_BROKEN_CD is working in u-boot. The
relevant part is sdhci_get_cd() function in drivers/mmc/sdhci.c file and in mmc_of_parse() function in drivers/mmc/mmc-uclass.c file.
So instead of MMC_BROKEN_CD would not it be better the following u-boot specific patch? cd-gpios is completely ignored by u-boot when non-removable is set.
Both are fine with me. I initially went with MMC_BROKEN_CD since it seemed like the established way. I've tested the patch below and the only issue is in the corner case of non-MMC boot while expecting something from MMC, but the error message is helpful enough ("Card did not respond to voltage select! : -110"). I'll resubmit with your patch instead.
diff --git a/arch/arm/dts/armada-388-clearfog-u-boot.dtsi b/arch/arm/dts/armada-388-clearfog-u-boot.dtsi index 96629294be4b..e725770c1899 100644 --- a/arch/arm/dts/armada-388-clearfog-u-boot.dtsi +++ b/arch/arm/dts/armada-388-clearfog-u-boot.dtsi @@ -10,6 +10,7 @@
&sdhci { u-boot,dm-spl;
non-removable; /* assume that the card is always present, required
for eMMC variant */ };
&gpio0 {
Signed-off-by: Martin Rowe martin.p.rowe@gmail.com
configs/clearfog_defconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig index 8cd35f9f1a..24e7c16ac7 100644 --- a/configs/clearfog_defconfig +++ b/configs/clearfog_defconfig @@ -46,7 +46,6 @@ CONFIG_CMD_USB=y CONFIG_CMD_TFTPPUT=y CONFIG_CMD_CACHE=y CONFIG_CMD_TIME=y -CONFIG_CMD_MVEBU_BUBT=y CONFIG_ENV_OVERWRITE=y CONFIG_ENV_MIN_ENTRIES=128 CONFIG_ARP_TIMEOUT=200 @@ -59,7 +58,7 @@ CONFIG_DM_I2C=y CONFIG_SYS_I2C_MVTWSI=y CONFIG_I2C_EEPROM=y CONFIG_SPL_I2C_EEPROM=y -CONFIG_SUPPORT_EMMC_BOOT=y +CONFIG_MMC_BROKEN_CD=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_SDMA=y CONFIG_MMC_SDHCI_MV=y -- 2.39.2