On 15/11/19 1:18 PM, haibo.chen@xxxxxxx wrote: > From: Haibo Chen <haibo.chen@xxxxxxx> > > Since L4.15, community involve the commit 105819c8a545 ("mmc: core: use mrq->sbc > when sending CMD23 for RPMB"), let the usdhc to decide whether to use ACMD23 for > RPMB. This CMD23 for RPMB need to set the bit 31 to its argument, if not, the > RPMB write operation will return general fail. > > According to the sdhci logic, SDMA mode will disable the ACMD23, and only in > ADMA mode, it will chose to use ACMD23 if the host support. But according to > debug, and confirm with IC, the imx6qpdl/imx6sx/imx6sl/imx7d do not support > the ACMD23 feature completely. These SoCs only use the 16 bit block count of > the register 0x4 (BLOCK_ATT) as the CMD23's argument in ACMD23 mode, which > means it will ignore the upper 16 bit of the CMD23's argument. This will block > the reliable write operation in RPMB, because RPMB reliable write need to set > the bit31 of the CMD23's argument. This is the hardware limitation. Due to > imx6sl use SDMA, so for imx6qpdl/imx6sx/imx7d, it need to broke the ACMD23 for > eMMC, SD card do not has this limitation, because SD card do not support reliable > write. > > For imx6ul/imx6ull/imx6sll/imx7ulp/imx8, it support the ACMD23 completely, it > change to use the 0x0 register (DS_ADDR) to put the CMD23's argument in ADMA mode. > > This patch handle 'fsl,auto-cmd23-broken' from devicetree. > > Signed-off-by: Haibo Chen <haibo.chen@xxxxxxx> > --- > drivers/mmc/host/sdhci-esdhc-imx.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c > index 80a148f8009e..83b4156b2cf4 100644 > --- a/drivers/mmc/host/sdhci-esdhc-imx.c > +++ b/drivers/mmc/host/sdhci-esdhc-imx.c > @@ -1374,6 +1374,9 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev, > if (of_find_property(np, "no-1-8-v", NULL)) > host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V; > > + if (of_find_property(np, "fsl,auto-cmd23-broken", NULL)) > + host->quirks2 |= SDHCI_QUIRK2_ACMD23_BROKEN; I guess it could be "sdhci,auto-cmd23-broken" and you could put it in sdhci_get_property() and use that. > + > if (of_property_read_u32(np, "fsl,delay-line", &boarddata->delay_line)) > boarddata->delay_line = 0; > >