Hi,
I'm working with an i.MX8MM board where the eMMC clock (CLK) is active only during command transactions. For the eMMC's Background Operations (BKOPS) to function correctly, a continuous clock is required. After reviewing the kernel documentation for the i.MX8MM's MMC controller (fsl,imx8mm-usdhc), I couldn't find an option to keep the CLK active continuously. Is there a configuration in the microprocessor or eMMC driver that allows the CLK to remain active to support BKOPS?
Hello @nzeta
I hope you are doing very well.
Did you tried with mmc-utils?
you can try the command (I am using other board but it should works):
root@imx93frdm:~# mmc extcsd read /dev/mmcblk0 | grep BKOPS
Background operations support [BKOPS_SUPPORT: 0x01]
Background operations status [BKOPS_STATUS: 0x00]
Enable background operations handshake [BKOPS_EN]: 0x00
To enable:
root@imx93frdm:~# mmc bkops_en manual /dev/mmcblk0
root@imx93frdm:~# mmc extcsd read /dev/mmcblk0 | grep BKOPS
Background operations support [BKOPS_SUPPORT: 0x01]
Background operations status [BKOPS_STATUS: 0x00]
Enable background operations handshake [BKOPS_EN]: 0x01
Please try it.
Best regards,
Salas.
Hi,
We've been testing the behavior of the Background Operations (BKOPS) feature on our eMMC, specifically focusing on the BKOPS_EN register. Since MANUAL_EN (bit 0) is a One-Time Programmable (OTP) register, we followed a step-by-step approach to testing:
Here’s an example of the register state when only MANUAL_EN is enabled:
~ # mmc extcsd read /dev/mmcblk2 | grep BKOPS
Background operations support [BKOPS_SUPPORT: 0x01]
Background operations status [BKOPS_STATUS: 0x00]
Enable background operations handshake [BKOPS_EN]: 0x01
We're monitoring the CLK signal, and we noticed that the clock stops when the eMMC is idle. However, we do see activity on the clock when forcing operations, such as writing to memory or reading registers using mmc-utils.
Since BKOPS relies on an active clock, we are concerned that automatic background operations will not execute correctly if the clock is stopped during periods of inactivity. This is particularly critical for data retention at high temperatures, as eMMC devices do not have good data retention and we rely on periodic refresh cycles to maintain data integrity.
Once MANUAL_EN is enabled, when first time power up,it will show BKOPS_STATUS "1".
When you use mmc extcsd write to set the BKOPS_START [164].
eMMC will start bkops, you can check the clock. And you will see the BKOPS_STATUS is clear to "0".
What I can't understand is such a basic function. Is there a problem or something? It needs to be suspected. This is a basic and fundamental function.
It is easy to test it with bkops manual. Because BKOPS_STATUS will change before and after the operation. If the host does not drive clock to emmc, this bkops cannot be completed. No changes in BKOPS_STATUS will be seen.
When you use the mmc extcsd write to tigger BKOPS, it can not run correct and finished, right?
Have you tested it? It is basic feature. Should work fine.
Memory manufactorer has told us that we can enable automatic refresh and patrol by configuring the appropriate eMMC registers:
EXT_CSD[163] BKOPS_EN Bit[1] AUTO_EN=1b
However, the BKOPS operations for patrol and refresh do not operate if the eMMC clock (CLK) is stopped, which is managed by the host. From our analysis, the CLK is only active when new commands are issued.
We suppose that we could try to execute BKOPS_START commands manually, but we want to avoid that step and use the automatic background operations of the memory.
Is it possible that we have any missconfiguration in our imx8mm dts board? Can the CLK be active all the time?
"When you use the mmc extcsd write to tigger BKOPS, it can not run correct and finished, right?"
This is a previous reply. This mmc extcsd write can set Manual BKOPS, and can also set auto BKOPS.
If the emmc is doing BKOPS, the host will read busy. Under the emmc busy state, the host will not cancel clock.
The question is, have you tested it yet? This is a basic function, and generally there will be no problem.
Have you read the linux mmc driver?
Have you read the emmc spec?
So far, I only see you typing.