From 2a9d4f3d3b058ba9067e8b45ad0b3f6712606b66 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Thu, 24 Aug 2023 16:36:27 +0200 Subject: [PATCH] cn9130-crb: Add a workaround for the MMC timeout issue in U-Boot For some reason, the controller disables the bus power sometime after it was enabled by the driver. The reference manual says, in Table 645, about the SD_BUS_POWER bit: > ... It will be cleared if one of the following occurs: the > sd_bus_vlt and the voltage support in the Capabilities Register 1 do > not match or if a card removal state was detected. Further investigation will be needed to find the (electrical?) root-cause of this issue. --- board/aarch64/cn9130-crb/uboot/cn9130-crb-env.dtsi | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/board/aarch64/cn9130-crb/uboot/cn9130-crb-env.dtsi b/board/aarch64/cn9130-crb/uboot/cn9130-crb-env.dtsi index aa9a978b2..7d1ba5394 100644 --- a/board/aarch64/cn9130-crb/uboot/cn9130-crb-env.dtsi +++ b/board/aarch64/cn9130-crb/uboot/cn9130-crb-env.dtsi @@ -1,6 +1,19 @@ / { config { environment { + /* After the MMC driver has enabled bus power, + * the controller seems to sometimes detect a + * card removal state , which causes it to + * disable power again. This hack re-enables the + * bus power in those cases. + */ + bootcmd = " +setexpr.b pwrctl *0xf2780029 +setexpr pwrctl ${pwrctl} \"|\" 1 +mw.b 0xf2780029 ${pwrctl} + +run ixboot +"; boot_targets = "mmc1"; ethprime = "eth1";