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.

Device tree blob and SD-card on omap4

Hallo everybody!!!

I got some problems with SD-card on omap4 booting with device tree (LK 3.10.x and 3.12.x).

Has somebody some hint for me?

Thanks a lot.

Sergej.

  • Hi Sergej,

    First let me clarify that SW releases for OMAP4 devices use board-files instead of dtb. 

    However, I have some questions:

    1. What OS are you trying to port? 

    2. Could you attach your boot script (maybe it is missing the loading of the dtb file) ?

    Best Regards,
    Yordan

  • Hi Yordan!

    Thanks.

    1. OS is Linux. I compiled a linux kernel 3.10.46 for my board. Some devices I got working I2C, HSUSB (not OTG USB and FSUSB). I need SD card and wlan...

    2. My hardware is very similar to the pandaboard. I have seen many things presented in linux kernel  that make it possible using of dtb's for the pandaboard .

    3. Boot script is simple on u-boot: "bootm $loadaddr - $fdtaddr"

    where $loadaddr is the ram addr for linux kernel image and the $fdtaddr is the ram addr for dtb, of cause the loading I did before...

    My dts uses the "omap4.dtsi" include file with

    &mmc1 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc1_pins>;
        vmmc-supply = <&vmmc>;
        bus-width = <4>;
        ti,non-removable;
    };
    but I see in kernel log "mmc0: clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 31 width 0 timing 0"

    It seems that ios for mmc are not correctly set... "width=?0?", CMD52 gets no answer.... and so on....

    May be I need more recent linux kernel?

    Regards.

    Sergej.

  • Hi Sergej,

    Kernel 3.10 should work, because latest officially released kernels for OMAP4 devices are based on kernel 3.4

    Here is what it is done in kernel 3.12 in that regard

      &mmc1 { 

                 vmmc-supply = <&vmmc>;   

    	  bus-width = <8>;
    };

    Can you check which pinmux registers are configured when calling pinctrl-0 = <&mmc1_pins> ?

    It should be:
    CONTROL_CORE_PAD0_USBC1_ICUSB_DM_PAD1_SDMMC1_CLK[18:16]SDMMC1_CLK_MUXMODE = 0x0

    CONTROL_CORE_PAD0_SDMMC1_CMD_PAD1_SDMMC1_DAT0[2:0]SDMMC1_CMD_MUXMODE = 0x0

    CONTROL_CORE_PAD0_SDMMC1_CMD_PAD1_SDMMC1_DAT0[18:16]SDMMC1_DAT0_MUXMODE = 0x0

    CONTROL_CORE_PAD0_SDMMC1_DAT1_PAD1_SDMMC1_DAT2[18:16]SDMMC1_DAT2_MUXMODE =0x0

    CONTROL_CORE_PAD0_SDMMC1_DAT1_PAD1_SDMMC1_DAT2[2:0]SDMMC1_DAT1_MUXMODE = 0x0

    CONTROL_CORE_PAD0_SDMMC1_DAT3_PAD1_SDMMC1_DAT4[18:16]SDMMC1_DAT4_MUXMODE = 0x0

    CONTROL_CORE_PAD0_SDMMC1_DAT3_PAD1_SDMMC1_DAT4[2:0]SDMMC1_DAT3_MUXMODE = 0x0

    CONTROL_CORE_PAD0_SDMMC1_DAT5_PAD1_SDMMC1_DAT6[18:16]SDMMC1_DAT6_MUXMODE = 0x0

    CONTROL_CORE_PAD0_SDMMC1_DAT5_PAD1_SDMMC1_DAT6[2:0]SDMMC1_DAT5_MUXMODE = 0x0

    CONTROL_CORE_PAD0_SDMMC1_DAT7_PAD1_ABE_MCBSP2_CLKX[2:0]SDMMC1_DAT7_MUXMODE = 0x0

    Best Regards,
    Yordan

  • Thanks Yordan, but I checked it, no success.

    I suppose it is some other cause... Whatever is in dtb, the ios looks like this:

    cat /sys/kernel/debug/mmc0/ios
    clock:        0 Hz
    vdd:        0 (invalid)
    bus mode:    1 (open drain)
    chip select:    0 (don't care)
    power mode:    0 (off)
    bus width:    0 (1 bits)           <------- !!!
    timing spec:    0 (legacy)
    signal voltage:    0 (3.30 V)

    I will check 3.12.x version.

  • Hi Sergej,

    It seems that your kernel does not read the hw data from dtb.

    Have you checked if after issuing make <omap defconfig> command for your build the .config file has all parameters set:
    CONFIG_USE_OF

    CONFIG_ATAGS

    CONFIG_ATAGS_PROC

    CONFIG_KEXEC

    (CONFIG_DTC & CONFIG_PROC_DEVICETREE may also be needed).

    Best Regards,
    Yordan

  • is KEXEC mandatory? It depends on not_SMP. Is it right? I used xconfig...

    ATAGS and DTC are presented.

    The only diff are calls before_set_reg / after_set_reg calls...

    And I get the "gpmc_l3_clk not enabled"...  on 3.12.27 lk

  • CONFIG_KEXEC is set in official OMAP4 kernels.

    Can you try setting CONFIG_ARM_APPENDED_DTB=y in the defconfig file you're using (for pandaboard it should be omap2plus_defconfig) ? 

    Best Regards,
    Yordan

  • ok.

    I made some traces and think that the problem is not with dtb.

    The of_get_hsmmc_pdata(..) from omap_hsmmc.c-file was called and this function fills all fields of omap_mmc_platform_data-structure correctly...

    but I could not found where the "ios->bus_width" will be set from mmc_ios-structure. or with other words where will be the caps-field interpreted into mmc_ios-structure....

    Regards

    Sergej.