This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM623: copying files to eMMC causes kernel crash fixed in SDK10.1 clarification

Part Number: AM623

Tool/software:

My customer has partial board eMMC HS200 stability of copy larger file in Linux fail. with patch form this thread can fix the failure board.

In SDK10.01 release noted stated the copy larger file fail issue resolved. then compared the patch to relative files of SDK9.2, SDK10.0 and SDK10.1, summary and questions as below:

#1. Before SDK10.1, UBOOT and Kernel dtsi sdhci0 parameters all use same parameters, but doesn't follow datasheet.

	sdhci0: mmc@fa10000 {
		compatible = "ti,am62-sdhci";
		reg = <0x00 0x0fa10000 0x00 0x1000>, <0x00 0x0fa18000 0x00 0x400>;
		interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
		power-domains = <&k3_pds 57 TI_SCI_PD_EXCLUSIVE>;
		clocks = <&k3_clks 57 5>, <&k3_clks 57 6>;
		clock-names = "clk_ahb", "clk_xin";
		assigned-clocks = <&k3_clks 57 6>;
		assigned-clock-parents = <&k3_clks 57 8>;
		bus-width = <8>;
		mmc-ddr-1_8v;
		mmc-hs200-1_8v;
		ti,clkbuf-sel = <0x7>;
		ti,otap-del-sel-legacy = <0x0>;
		ti,otap-del-sel-mmc-hs = <0x0>;
		ti,otap-del-sel-ddr52 = <0x5>;
		ti,otap-del-sel-hs200 = <0x5>;
		ti,itap-del-sel-legacy = <0xa>;
		ti,itap-del-sel-mmc-hs = <0x1>;
		status = "disabled";
	};

#2. In SDK10.1, UBOOT still use upper/old parameter. Kernel dts updated as below to follow datasheet.

Questions:

#2.1 Why UBOOT use different tap delay parameter which doesn't follow datasheet but still can work at HS200.

#2.2. Why Linux must use tap delay value as datasheet, is it the major factor fixed the issue? or just update it to follow datasheet? but forgot to update UBOOT dts fil?

	sdhci0: mmc@fa10000 {
		compatible = "ti,am62-sdhci";
		reg = <0x00 0x0fa10000 0x00 0x1000>, <0x00 0x0fa18000 0x00 0x400>;
		interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
		power-domains = <&k3_pds 57 TI_SCI_PD_EXCLUSIVE>;
		clocks = <&k3_clks 57 5>, <&k3_clks 57 6>;
		clock-names = "clk_ahb", "clk_xin";
		assigned-clocks = <&k3_clks 57 6>;
		assigned-clock-parents = <&k3_clks 57 8>;
		bus-width = <8>;
		mmc-ddr-1_8v;
		mmc-hs200-1_8v;
		ti,clkbuf-sel = <0x7>;
		ti,otap-del-sel-legacy = <0x0>;
		ti,otap-del-sel-mmc-hs = <0x0>;
		ti,otap-del-sel-hs200 = <0x6>;
		ti,itap-del-sel-legacy = <0x0>;
		ti,itap-del-sel-mmc-hs = <0x0>;
		status = "disabled";
	};
   

#3. There are some change in drivers/mmc/host/sdhci_am654.c, but did not find below change in SDK10.1 compare to the patch in upper thread, is this patch not required actually?

 static u8 sdhci_am654_write_power_on(struct sdhci_host *host, u8 val, int reg)
 {
 	writeb(val, host->ioaddr + reg);
@@ -706,6 +753,12 @@ static int sdhci_am654_init(struct sdhci_host *host)
 	u32 mask;
 	u32 val;
 	int ret;
+	u16 ctrl;
+
+	/* Unset CTRL_VDD_180 */
+	ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2);
+	ctrl &= ~SDHCI_CTRL_VDD_180;
+	sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2);

#4. sdhci_am654.c, the major change is adding sdhci_am654_start_signal_voltage_switch() call. What problem was fixed by this change?

#5. From the upper thread, change the serial resistors can help the problem. originally it is 33ohm, some board can't boot. then change to 22ohm, can boot. 

#6. With patch, no matter the resistor is 33ohm, 22ohm, or 0ohm, all can boot up. Seems the patch effects more than hardware factors. 

So need clarification about the driver change.

  • Hi Tony,

    The TAPDLY value update in kernel devicetree was along with the kernel sdhci_am654.c driver update, but we have update the U-Boot sdhci driver yet (given we haven't got any U-Boot MMC issue report), so U-Boot still uses the old values.

    I will look into the sdhci_am654.c patch difference from the referred e2e thread and SDK10.1 and get back to you later.

  • Thanks Bin.

    Question list from customer:

    #1. The root cause of HS200 fail.

    #2. Why adjust serial resistor varies the result? change 33ohm to 22ohm can improve fail board boot rate without patch.

    #3. Why set SDHCI_CTRL_VDD_180 impact ACMD6 command? from test result, if set SDHCI_CTRL_VDD_180=1, will result in ACMD6 timeout on fail board.

    #4. According to TRM, need to set SDHCI_CTRL_VDD_180 to select Signal voltage, it is in such way in general eMMC driver sdhci.c, why removed it in patch for TI driver.

    #5. Are there other patches regarding eMMC?

  • Hi Tony,

    As discussed offline, instead using the patch from the referred e2e thread, please ask the customer to test the following two kernel patches taken from SDK10.1.

    https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/commit/?h=10.01.03&id=5bc0054f6e8f93be56a5cf2570e9db9d40f5d665

    https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/commit/?h=10.01.03&id=32ae7316ddc6d9b6bb0d87706cf7daa44c4c1e92

  • Hi Bin,

    The second patch modified MMC1/2 default delay value beside MMC0, is it necessary?

  • Hi Tony,

    Those are not relevant to the eMMC crash issue.

  • Hi Bin,

    I patched it on to SDK9.2.1.09 and flash to eMMC, remove SD card to boot from eMMC, it keep output mmc Power on failed, need to insert SD card to stop it.

    am62xx-evm login: [   14.223159] sdhci-am654 fa00000.mmc: Power on failed
    [   15.780291] sdhci-am654 fa00000.mmc: Power on failed
    [   17.544416] sdhci-am654 fa00000.mmc: Power on failed
    [   17.675477] kauditd_printk_skb: 21 callbacks suppressed
    [   17.675526] audit: type=1334 audit(1742880428.018:49): prog-id=24 op=UNLOAD
    [   17.688182] audit: type=1334 audit(1742880428.018:50): prog-id=23 op=UNLOAD
    [   19.098170] sdhci-am654 fa00000.mmc: Power on failed
    [   20.658198] sdhci-am654 fa00000.mmc: Power on failed
    [   22.223385] sdhci-am654 fa00000.mmc: Power on failed
    [   23.991010] sdhci-am654 fa00000.mmc: Power on failed
    [   25.551112] sdhci-am654 fa00000.mmc: Power on failed
    [   27.106770] sdhci-am654 fa00000.mmc: Power on failed
    [   28.668938] sdhci-am654 fa00000.mmc: Power on failed
    [   30.435782] sdhci-am654 fa00000.mmc: Power on failed
    [   31.999871] sdhci-am654 fa00000.mmc: Power on failed
    [   33.562245] sdhci-am654 fa00000.mmc: Power on failed
    [   35.124446] sdhci-am654 fa00000.mmc: Power on failed
    [   36.889351] sdhci-am654 fa00000.mmc: Power on failed
    [   38.453327] sdhci-am654 fa00000.mmc: Power on failed
    [   40.015681] sdhci-am654 fa00000.mmc: Power on failed
    [   41.577733] sdhci-am654 fa00000.mmc: Power on failed
    [   43.344968] sdhci-am654 fa00000.mmc: Power on failed
    [   44.459545] audit: type=1334 audit(1742880513.686:51): prog-id=26 op=UNLOAD
    [   44.466826] audit: type=1334 audit(1742880513.686:52): prog-id=25 op=UNLOAD
    [   44.901024] sdhci-am654 fa00000.mmc: Power on failed
    [   46.456899] sdhci-am654 fa00000.mmc: Power on failed
    [   48.020138] sdhci-am654 fa00000.mmc: Power on failed
    [   49.784400] sdhci-am654 fa00000.mmc: Power on failed
    [   51.340854] sdhci-am654 fa00000.mmc: Power on failed
    [   52.896653] sdhci-am654 fa00000.mmc: Power on failed
    [   54.459675] sdhci-am654 fa00000.mmc: Power on failed
    [   56.219258] sdhci-am654 fa00000.mmc: Power on failed
    [   57.779037] sdhci-am654 fa00000.mmc: Power on failed
    [   59.334966] sdhci-am654 fa00000.mmc: Power on failed
    [   60.890651] sdhci-am654 fa00000.mmc: Power on failed
    [   62.658268] sdhci-am654 fa00000.mmc: Power on failed

    BTW, SDK9.2.1.09 sdhci_am654x.c has hs200_tunning in this structure compare to SDK9.2.1.10 need to remove it to apply patch, then add back, otherwise can't make successful.

    struct sdhci_am654_data {
    struct regmap *base;
    bool legacy_otapdly;
    u32 otap_del_sel[ARRAY_SIZE(td)];
    u32 itap_del_sel[ARRAY_SIZE(td)];
    u32 itap_del_ena[ARRAY_SIZE(td)];
    int clkbuf_sel;
    int trm_icp;
    int drv_strength;
    int strb_sel;
    u32 flags;
    u32 quirks;
    bool dll_enable;
    bool hs200_tunning;

  • Hi Tony,

    I patched it on to SDK9.2.1.09 and flash to eMMC, remove SD card to boot from eMMC, it keep output mmc Power on failed,

    Does this sdcard "power on failed" problem only happen after you applied the patch?

  • It is not relevant to eMMC boot, need to disable MMC1 in kernel dts. it is same with SDK9.2 and latest SDK10.1y. I will start a new thread to discuss it.