Patch to add support for turning off mmc CMDQ support (for RP64 + Foresee eMMC)
Here's a patch that adds support for turning off mmc command queuing (CMDQ) from kernel command line. It should help with emmc cards that report having CMDQ support but don't actually work when kernel switches CMDQ on. CMDQ can be disabled from kernel by adding mmc_cmdqueue=off
parameter to kernel command line. Without the new parameter CMDQ works as before the patch.
NOTE 1: I don't really know if the problem is with Foresee eMMC cards or Arasan host controller of RockPro64 or combination of both. I have 32GB and 64GB Foresee eMMC cards that report having CMDQ and they don't work if CMDQ is on. With CMDQ disabled they've been working just fine. That's why I'm not sure if mmc_cmdqueue=off
should be added by default. I can add it manually myself for my boards.
NOTE 2: U-Boot also needs CONFIG_MMC_HS200_SUPPORT=y
and CONFIG_SPL_MMC_HS200_SUPPORT=y
to be able run kernel and root fs from 32GB and 64GB Foresee eMMC cards. I'll create a separate issue to uboot-rockpro64 for that.
For reference, here's a log snippet taken with older kernel (5.0) with CMDQ problems. running CQE recovery
just keeps timing out forever (RootFS is on emmc).
[ 6.204097] mmc1: running CQE recovery
[ 66.553464] mmc1: cqhci: timeout for tag 0
[ 66.554097] mmc1: cqhci: ============ CQHCI REGISTER DUMP ===========
[ 66.555023] mmc1: cqhci: Caps: 0x00000000 | Version: 0x00000510
[ 66.555945] mmc1: cqhci: Config: 0x00000000 | Control: 0x00000000
[ 66.556867] mmc1: cqhci: Int stat: 0x00000000 | Int enab: 0x00000000
[ 66.557790] mmc1: cqhci: Int sig: 0x00000000 | Int Coal: 0x00000000
[ 66.558710] mmc1: cqhci: TDL base: 0x00000000 | TDL up32: 0x00000000
[ 66.559632] mmc1: cqhci: Doorbell: 0x00000000 | TCN: 0x00000000
[ 66.560553] mmc1: cqhci: Dev queue: 0x00000000 | Dev Pend: 0x00000000
[ 66.561475] mmc1: cqhci: Task clr: 0x00000000 | SSC1: 0x00011000
[ 66.562396] mmc1: cqhci: SSC2: 0x00000000 | DCMD rsp: 0x00000000
[ 66.563317] mmc1: cqhci: RED mask: 0xfdf9a080 | TERRI: 0x00000000
[ 66.564238] mmc1: cqhci: Resp idx: 0x00000000 | Resp arg: 0x00000000
[ 66.565159] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
[ 66.566081] mmc1: sdhci: Sys addr: 0x00000000 | Version: 0x00001002
[ 66.567001] mmc1: sdhci: Blk size: 0x00007200 | Blk cnt: 0x00000000
[ 66.567922] mmc1: sdhci: Argument: 0x00010000 | Trn mode: 0x00000010
[ 66.568844] mmc1: sdhci: Present: 0x1fff0000 | Host ctl: 0x00000034
[ 66.569765] mmc1: sdhci: Power: 0x0000000b | Blk gap: 0x00000080
[ 66.570686] mmc1: sdhci: Wake-up: 0x00000000 | Clock: 0x00000007
[ 66.571608] mmc1: sdhci: Timeout: 0x0000000e | Int stat: 0x00000000
[ 66.572530] mmc1: sdhci: Int enab: 0x02ff4000 | Sig enab: 0x02ff4000
[ 66.573451] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
[ 66.574373] mmc1: sdhci: Caps: 0x44edc880 | Caps_1: 0x800020f7
[ 66.575294] mmc1: sdhci: Cmd: 0x00000d1a | Max curr: 0x00000000
[ 66.576214] mmc1: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x642017c5
[ 66.577136] mmc1: sdhci: Resp[2]: 0x4e436172 | Resp[3]: 0x00880103
[ 66.578055] mmc1: sdhci: Host ctl2: 0x00000083
[ 66.578699] mmc1: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0xf711c208
[ 66.579617] mmc1: sdhci: ============================================
[ 66.580800] mmc1: running CQE recovery
0018-mmc-core-Add-MMC-Command-Queue-Support-kernel-parame.patch