Project

General

Profile

eMMC not enabling on Docker based image buiding

Added by Sandeep Sivadas 2 months ago

Hi,

I tried to build am572x image using docker build environment with eMMC enabled. But my image not detecting eMMC.
I have modified the kernel file am57xx-mitysom-baseboard.dtsi as

&mmc2 {
status = "okay";

pinctrl-names = "default";
pinctrl-0 = <&mmc2_pins_default>;
vmmc-supply = <&v3_3d>;
bus-width = <8>;
ti,non-removable;
cap-mmc-dual-data-rate;
};

uboot details are

{GPMC_A8, (M14 | PIN_INPUT_PULLDOWN)},    /* N7 gpmc_a8.gpio1_30 J5.12 */
{GPMC_A9, (M14 | PIN_INPUT_PULLDOWN)},    /* R4 gpmc_a9.gpio1_31 J5.13 */
{GPMC_A10, (M14 | PIN_INPUT_PULLDOWN)},    /* N9 gpmc_a10.gpio2_0 J5.10 */
{GPMC_A11, (M14 | PIN_INPUT_PULLDOWN)},    /* P9 gpmc_a11.gpio2_1 J5.8 */
{GPMC_A12, (M14 | PIN_INPUT_PULLDOWN)},    /* P4 gpmc_a12.gpio2_2 J11.8 */
{GPMC_A13, (M1 | PIN_INPUT | MANUAL_MODE)},    /* R3 gpmc_a13.qspi1_rtclk */
{GPMC_A14, (M1 | PIN_INPUT | MANUAL_MODE)},    /* T2 gpmc_a14.qspi1_d3 */
{GPMC_A15, (M1 | PIN_INPUT | MANUAL_MODE)},    /* U2 gpmc_a15.qspi1_d2 */
{GPMC_A16, (M1 | PIN_INPUT | MANUAL_MODE)},    /* U1 gpmc_a16.qspi1_d0 */
{GPMC_A17, (M1 | PIN_INPUT | MANUAL_MODE)},    /* P3 gpmc_a17.qspi1_d1 */
{GPMC_A18, (M1 | PIN_OUTPUT | MANUAL_MODE)},    /* R2 gpmc_a18.qspi1_sclk */

I am getting eMMC data when kernel buiding separately as given in wiki
https://support.criticallink.com/redmine/projects/mitysom_am57x/wiki/Linux_Kernel

Kindly look in to it.

With regards
Sandeep S


Replies (7)

RE: eMMC not enabling on Docker based image buiding - Added by Jonathan Cormier 2 months ago

Which kernel are you using? Can you please share whole boot logs for working and non-working cases.

Note: It doesn't make much sense that a docker build vs a native build would behave that differently. The emmc is all setup in the device tree and the device tree compiler isn't even cross compiling. You should be able to use dtc on your generated dtb files to print the contents of them and then compare the emmc sections to see if they are infact different.

I've also used the fdt-viewer to more easily view a dtb file and double check that specific changes I made, made it into the dtb.

Here is a tested emmc config for the 4.19 kernel.

/* eMMC */
&mmc2 {
>-------status = "okay";

>-------vmmc-supply = <&v3_3d>;
>-------vqmmc-supply = <&v1_8d>;
>-------bus-width = <8>;
>-------ti,non-removable;
>-------non-removable;
>-------// Handle resetting eMMC
>-------// Currently gpio7_6 is not pinmuxed in u-boot, leaving this hear in case it turns out we need this to boot from eMMC
>-------// mmc-pwrseq = <&emmc_pwrseq>;

>-------dmas = <&sdma_xbar 47>, <&sdma_xbar 48>;
>-------dma-names = "tx", "rx";
>-------pinctrl-names = "default", "hs", "ddr_1_8v", "hs200_1_8v";
>-------pinctrl-0 = <&mmc2_pins_default>;
>-------pinctrl-1 = <&mmc2_pins_hs>;
>-------pinctrl-2 = <&mmc2_pins_ddr_rev20>;
>-------pinctrl-3 = <&mmc2_pins_hs200>;
};

Also the pinmux you sent me doesn't make sense. Its setting pins up for gpio and qspi. Those pins also don't have a mmc2 pinmux available.

Here is an example of a working mmc2 pinmux but I don't know which pins you've hooked up your emmc to.

   {GPMC_A19, (M1 | PIN_INPUT_PULLUP)},    /* K7 gpmc_a19.mmc2_dat4 */
   {GPMC_A20, (M1 | PIN_INPUT_PULLUP)},    /* M7 gpmc_a20.mmc2_dat5 */
   {GPMC_A21, (M1 | PIN_INPUT_PULLUP)},    /* J5 gpmc_a21.mmc2_dat6 */
   {GPMC_A22, (M1 | PIN_INPUT_PULLUP)},    /* K6 gpmc_a22.mmc2_dat7 */
   {GPMC_A23, (M1 | PIN_INPUT_PULLUP)},    /* J7 gpmc_a23.mmc2_clk */
   {GPMC_A24, (M1 | PIN_INPUT_PULLUP)},    /* J4 gpmc_a24.mmc2_dat0 */
   {GPMC_A25, (M1 | PIN_INPUT_PULLUP)},    /* J6 gpmc_a25.mmc2_dat1 */
   {GPMC_A26, (M1 | PIN_INPUT_PULLUP)},    /* H4 gpmc_a26.mmc2_dat2 */
   {GPMC_A27, (M1 | PIN_INPUT_PULLUP)},    /* H5 gpmc_a27.mmc2_dat3 */
   {GPMC_CS1, (M1 | PIN_INPUT_PULLUP)},    /* H6 gpmc_cs1.mmc2_cmd */

RE: eMMC not enabling on Docker based image buiding - Added by Sandeep Sivadas 2 months ago

Hi,

Which kernel are you using? - 4.19.94-yocto-standard

Can you please share whole boot logs for working and non-working cases. - I am attaching the log files here

Also the pinmux you sent me doesn't make sense
- Sorry, its a copy mistake.Pinmux i am using are

{GPMC_A19, (M1 | PIN_INPUT_PULLUP)},    /* K7 gpmc_a19.mmc2_dat4 J5.24 */
{GPMC_A20, (M1 | PIN_INPUT_PULLUP)},    /* M7 gpmc_a20.mmc2_dat5 J5.26 */
{GPMC_A21, (M1 | PIN_INPUT_PULLUP)},    /* J5 gpmc_a21.mmc2_dat6 J11.23 */
{GPMC_A22, (M1 | PIN_INPUT_PULLUP)},    /* K6 gpmc_a22.mmc2_dat7 J11.25 */
{GPMC_A23, (M1 | PIN_INPUT_PULLUP)},    /* J7 gpmc_a23.mmc2_clk */
{GPMC_A24, (M1 | PIN_INPUT_PULLUP)},    /* J4 gpmc_a24.mmc2_dat0 */
{GPMC_A25, (M1 | PIN_INPUT_PULLUP)},    /* J6 gpmc_a25.mmc2_dat1 */
{GPMC_A26, (M1 | PIN_INPUT_PULLUP)},    /* H4 gpmc_a26.mmc2_dat2 */
{GPMC_A27, (M1 | PIN_INPUT_PULLUP)},    /* H5 gpmc_a27.mmc2_dat3 */
{GPMC_CS1, (M1 | PIN_INPUT_PULLUP)},    /* H6 gpmc_cs1.mmc2_cmd */
Boot_log_eMMC working.txt (39.8 KB) Boot_log_eMMC working.txt eMMC working boot log with native kernel build
Boot_log_eMMC Not Working.txt (38.8 KB) Boot_log_eMMC Not Working.txt eMMC not working boot log with docker build

RE: eMMC not enabling on Docker based image buiding - Added by Jonathan Cormier 2 months ago

Note your "non working" boot log seems to be truncating several lines, not sure how you captured it but that's pretty odd.

-[    0.000000] Linux version 4.19.94-yocto-standard (oe-user@oe-host) (gcc version 8.3.0 (GNU Toolchain for the A-profile Architectu4
+[    0.000000] Linux version 4.19.94-g7317dfbd4116-dirty (mitysom@mitysom-OptiPlex-5040) (gcc version 8.3.0 (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36))) #13 SMP PREEMPT Fri Mar 22 15:29:24 IST 2024

Looks like your comparing a "native" kernel build with a yocto kernel build. Thats likely the more relevant difference instead of docker vs no docker.

Your native kernel build is "-dirty" meaning it has changes that weren't committed. Are those changes relevant?

The two kernels and two device trees are not the same size so there are likely changes between them. Can you post the two dtbs for comparison?

-4461056 bytes read in 196 ms (21.7 MiB/s)
+4469248 bytes read in 196 ms (21.7 MiB/s)

-90099 bytes read in 5 ms (17.2 MiB/s)
+90157 bytes read in 5 ms (17.2 MiB/s)

$ diff -u not_working.txt working.txt
--- not_working.txt     2024-10-21 14:45:50.375394688 -0400
+++ working.txt 2024-10-21 14:45:21.747282737 -0400
@@ -6,13 +6,23 @@
 [] sdhci-omap 4809c000.mmc: Linked as a consumer to regulator.13
 [] sdhci-omap 4809c000.mmc: no pinctrl state for ddr_3_3v mode
 [] mmc0: SDHCI controller on 4809c000.mmc [4809c000.mmc] using ADMA
+[] sdhci-omap 480b4000.mmc: 480b4000.mmc supply vqmmc not found, using dummy regulator
+[] sdhci-omap 480b4000.mmc: Linked as a consumer to regulator.0
+[] sdhci-omap 480b4000.mmc: Dropping the link to regulator.0
 [] sdhci-omap 480b4000.mmc: Linked as a consumer to regulator.2
-[] sdhci-omap 480b4000.mmc: Dropping the link to regulator.2
-[] sdhci-omap 480b4000.mmc: Linked as a consumer to regulator.2
-[] sdhci-omap 480b4000.mmc: Cannot get pinctrl
+[] sdhci-omap 480b4000.mmc: no pinctrl state for ddr_1_8v mode
+[] sdhci-omap 480b4000.mmc: no pinctrl state for ddr_3_3v mode
+[] sdhci-omap 480b4000.mmc: no pinctrl state for hs mode
+[] sdhci-omap 480b4000.mmc: no pinctrl state for hs mode
+[] sdhci-omap 480b4000.mmc: no pinctrl state for hs200_1_8v mode
 [] mmc0: host does not support reading read-only switch, assuming write-enable
-[] mmc0: new high speed SDHC card at address 59b4
-[] mmcblk0: mmc0:59b4 EB2MW 29.8 GiB
+[] mmc1: SDHCI controller on 480b4000.mmc [480b4000.mmc] using ADMA
+[] mmc0: new high speed SDXC card at address 59b4
+[] mmcblk0: mmc0:59b4       58.9 GiB
 []  mmcblk0: p1 p2
-[] EXT4-fs (mmcblk0p2): recovery complete
-[] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
+[] mmc1: new MMC card at address 0001
+[] mmcblk1: mmc1:0001 S0J56X 14.8 GiB
+[] mmcblk1boot0: mmc1:0001 S0J56X partition 1 31.5 MiB
+[] mmcblk1boot1: mmc1:0001 S0J56X partition 2 31.5 MiB
+[] mmcblk1rpmb: mmc1:0001 S0J56X partition 3 4.00 MiB, chardev (244:0)
+[]  mmcblk1:

Unfortunately, the non working log is printing out something that is likely to be an error but it's cut off early. Would be helpful to know what its saying.

Cannot get pinctrl

RE: eMMC not enabling on Docker based image buiding - Added by Sandeep Sivadas 2 months ago

Hi,

Your native kernel build is "-dirty" meaning it has changes that weren't committed. Are those changes relevant?

Yes, i have modified kernel for our application.

dtb files in the boot folder of native build and docker build are attaching here

Thanks and regards
Sandeep S

RE: eMMC not enabling on Docker based image buiding - Added by Jonathan Cormier 2 months ago

It looks like the mmc2 config is different on your yocto build. It's missing the pinmux pinctrl entry, the max-frequency is different, etc. Do you need help getting your changes from the native Linux build into the yocto build?

We wrote a customizing yocto guide for the AM62x but it would apply to the am57x with few changes. Here's a link to the kernel section. https://support.criticallink.com/redmine/projects/mitysom_am62x/wiki/Customizing_the_yocto_build#Add-your-custom-kernel-device-tree-to-the-kernel-recipe

--- native...
+++ docker...
@@ -3588,21 +3587,20 @@
.
 >-->---mmc@480b4000 {
 >-->--->---bus-width = <0x08>;
->-->--->---cap-mmc-dual-data-rate;
 >-->--->---compatible = "ti,dra7-sdhci";
 >-->--->---interrupts = <0x00 0x51 0x04>;
->-->--->---max-frequency = <0xb71b000>;
+>-->--->---max-frequency = <0x5b8d800>;
 >-->--->---mmc-ddr-1_8v;
 >-->--->---mmc-ddr-3_3v;
 >-->--->---mmc-hs200-1_8v;
->-->--->---pinctrl-0 = <0xb2>;
->-->--->---pinctrl-names = "default";
+>-->--->---no-1-8-v;
+>-->--->---non-removable;
 >-->--->---reg = <0x480b4000 0x400>;
 >-->--->---sdhci-caps-mask = <0x07 0x00>;
 >-->--->---status = "okay";
 >-->--->---ti,hwmods = "mmc2";
->-->--->---ti,non-removable;
 >-->--->---vmmc-supply = <0xab>;
+>-->--->---vqmmc-supply = <0xab>;
 >-->---};
.
 >-->---mmc@480d1000 {
@@ -3810,7 +3808,7 @@
.
 >-->--->---usb@48890000 {
 >-->--->--->---compatible = "snps,dwc3";
->-->--->--->---dr_mode = "otg";
+>-->--->--->---dr_mode = "host";
 >-->--->--->---extcon = <&{/ocp/i2c@48070000/tps659038@58/tps659038_usb}>;
 >-->--->--->---interrupt-names = "peripheral", "host", "otg";
 >-->--->--->---interrupts = <0x00 0x47 0x04 0x00 0x47 0x04 0x00 0x48 0x04>;

RE: eMMC not enabling on Docker based image buiding - Added by Sandeep Sivadas about 2 months ago

Hi,

Do you need help getting your changes from the native Linux build into the yocto build?

-- Yes, need help for the same.

I didnt get the below modifications described in the previous reply. Do i need to modify kernel like this?

--- native...
+++ docker...
@@ -3588,21 +3587,20 @@
.
 >-->---mmc@480b4000 { ... etc

Thanks and regards
Sandeep S

    (1-7/7)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)