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.

Linux/AM5728: MMC device tree bindings

Guru 20755 points
Part Number: AM5728
Other Parts Discussed in Thread: DRA72, WL1835,

Tool/software: Linux

Hello,

In 

I find the following:

Should be "ti,omap2-hsmmc", for OMAP2 controllers
Should be "ti,omap3-hsmmc", for OMAP3 controllers
Should be "ti,omap3-pre-es3-hsmmc" for OMAP3 controllers pre ES3.0
Should be "ti,omap4-hsmmc", for OMAP4 controllers
Should be "ti,am33xx-hsmmc", for AM335x controllers


What should be inserted with am57x controllers ?
I also can't find in mmc sections in device tree that it actuallu using any of the above in compatibility,

Is there any reason why it is missing in the examples ?

for example:

Best Regards,

Ran

  • Hi Ran,

    AM57x MMC use "dra7-hsmmc" or "omap4-hsmmc". This is described in the below dtsi file:

    {AM57x_PSDK}/board-support/linux-kernel/arch/arm/boot/dts/dra7.dtsi

    mmc2: mmc@480b4000 {

    compatible = "ti,dra7-hsmmc", "ti,omap4-hsmmc";

    reg = <0x480b4000 0x400>;

    interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;

    ti,hwmods = "mmc2";

    ti,needs-special-reset;

    dmas = <&sdma_xbar 47>, <&sdma_xbar 48>;

    dma-names = "tx", "rx";

    status = "disabled";

    max-frequency = <192000000>;

    sd-uhs-sdr25;

    sd-uhs-sdr12;

    mmc-hs200-1_8v;

    mmc-ddr-1_8v;

    };

     

    dra7-hsmmc and omap4-hsmmc are available in:

    {AM57x_PSDK}/board-support/linux-kernel/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt

    Required properties:
    - compatible:
     Should be "ti,omap2-hsmmc", for OMAP2 controllers
     Should be "ti,omap3-hsmmc", for OMAP3 controllers
     Should be "ti,omap3-pre-es3-hsmmc" for OMAP3 controllers pre ES3.0
     Should be "ti,omap4-hsmmc", for OMAP4 controllers
     Should be "ti,dra7-hsmmc", for dra7 and dra72 controllers
     Should be "ti,am33xx-hsmmc", for AM335x controllers
    - ti,hwmods: Must be "mmc<n>", n is controller instance starting 1

     

     

    dra7.dtsi file is used for AM572x TI EVM:

    dra7.dtsi -> dra74x.dtsi -> am57xx-beagle-x15-common.dtsi -> am57xx-beagle-x15.dts -> am57xx-evm-base.dts -> am57xx-evm.dts

     

    Regards,
    Pavel

     

  • Hi Pavel,

    Thank you very much.
    I've checked sdk files and I see that with am572x there is no usage of hsmmc for mmc in dts.
    See the following:
    &mmc2 {
    status = "okay";

    pinctrl-names = "default";
    pinctrl-0 = <&mmc2_pins_default>;

    vmmc-supply = <&vdd_3v3>;
    bus-width = <8>;
    ti,non-removable;
    cap-mmc-dual-data-rate;
    no-1-8-v;
    };

    and the following:

    &mmc3 {
    status = "okay";
    vmmc-supply = <&vmmcwl_fixed>;
    bus-width = <4>;
    pinctrl-names = "default";
    cap-power-off-card;
    keep-power-in-suspend;
    ti,non-removable;

    #address-cells = <1>;
    #size-cells = <0>;
    wlcore: wlcore@2 {
    compatible = "ti,wl1835";
    reg = <2>;
    interrupt-parent = <&gpio5>;
    interrupts = <7 IRQ_TYPE_LEVEL_HIGH>;
    };
    };


    I therefore ask:
    1. How is it that the appropriate hsmmc driver is called if it is not mentioned in device tree (or that I did not find it)?
    2. We wire wifi rsi9113 instead of mmc (using sdio). Should it look something similar to the above mmc3 node ?

    Thank you,
    Ran
  • Ran,

    ranchu said:
    1. How is it that the appropriate hsmmc driver is called if it is not mentioned in device tree (or that I did not find it)?

    It is mentioned in dra7.dtsi device tree file, as I already explained. The final AM57x device tree binary file (dtb) is composition of several dts/dtsi files: dra7.dtsi, dra74x.dtsi, am57xx-beagle-x15-common.dtsi, am57xx-beagle-x15.dts, am57xx-evm-common.dtsi, am57xx-evm-base.dts, am57xx-evm.dts

    ranchu said:
    2. We wire wifi rsi9113 instead of mmc (using sdio). Should it look something similar to the above mmc3 node ?

    Yes.

    Regards,
    Pavel

  • Hi Pavel,

    Thank a lot , I understand now.

    I see that interrupt is already configured in dra.dtsi :
    mmc3: mmc@480ad000 {
    compatible = "ti,dra7-hsmmc", "ti,omap4-hsmmc";
    reg = <0x480ad000 0x400>;
    interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
    ....

    So, I don't understand why is it also configured in the child node of wlcore (am57xx-evm-common.dtsi):
    &mmc3 {
    status = "okay";
    ....
    wlcore: wlcore@2 {
    compatible = "ti,wl1835";
    reg = <2>;
    interrupt-parent = <&gpio5>;
    interrupts = <7 IRQ_TYPE_LEVEL_HIGH>;
    };
    };

    I assume that if we other wifi controller connected to sdio (redpine rs 9113) , we don't need to reconfigure interrupt.
    I mean that I don't understand why wlcore need to reconfigure interrupt (actually <7 IRQ_TYPE_LEVEL_HIGH> seems to me like a different interrupt source than <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH> )

    Thank you a lot,
    Ran

  • These are two different interrupts.

    ranchu said:
    mmc3: mmc@480ad000 {

    ranchu said:
    interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;

    This is MMC3 internal interrupt (MMC3_IRQ, IRQ_CROSSBAR_89).

    ranchu said:
    &mmc3 {

    ranchu said:
    interrupt-parent = <&gpio5>;
    interrupts = <7 IRQ_TYPE_LEVEL_HIGH>;

    This is external interrupt (WLAN_IRQ), provided through the gpio5_7 pin.

    Regards,
    Pavel

  • Hi Pavel,

    Thank you for the comments,

    I am not sure about the following, can you please tell me what you think ?
    I am trying to understand how interrupt shall be given to our wifi module (redpine rs9113) which is connected instead the MMC using SDIO pins.
    Is it using the same MMC internal interrupt ( <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;) or required additional gpio like wl1835 (< &gpio5 7 IRQ_TYPE_LEVEL_HIGH>).
    I also checked in am5728 datasheet and I see that gpio5_7 is not using sdio lines (page 103 in am5728 datasheet), it seems like a separate gpio interrupt (additional to the sdio pin interrupt ?)  used with wl1835 (I wander why wl1835 requires 2 interrupt pins ?? )

    Unfortunately, there isn't any example/document (from redpine) as to how to configure redpine rs9113 in device tree.

    Is there a way to know which pin is connected to MMC3_IRQ ? I tried to fins it in datasheet and TRM but did not find.

    Thank you again, it is very much appreciated,

    Ran

  • ranchu said:
    Is it using the same MMC internal interrupt ( <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;)

    Yes. As you attach your wifi module on MMC3, you will use MMC3_IRQ. You can also use polling mode or DMA mode instead of interrupt.

    ranchu said:
    or required additional gpio like wl1835 (< &gpio5 7 IRQ_TYPE_LEVEL_HIGH>).

    This is specific for the wifi module, I can not comment regarding redpine rs9113.

    ranchu said:
    I also checked in am5728 datasheet and I see that gpio5_7 is not using sdio lines (page 103 in am5728 datasheet), it seems like a separate gpio interrupt (additional to the sdio pin interrupt ?)  used with wl1835 (I wander why wl1835 requires 2 interrupt pins ?? )

    There is only one external pin, gpio5_7.

    MMC3_IRQ - internal interrupt, no special interrupt pin. This interrupt is generated from the AM572x MMC3 module internal events (end of operation or warn for exception/error). Several MMC3 internal module events can generate the MMC3_IRQ, for example: buffer read ready, buffer write ready, card error, etc. Refer to the AM572x TRM, section 25.4.4 Interrupt Requests. Focus your attention on Table 25-11. Events.

    WLAN_IRQ - external interrupt, pin gpio5_7. This interrupt is generated by WL1835 device and send to AM572x device. WLAN IRQ generate Interrupt from the WLAN chip (WL1835) toward the HOST (AM572x), it is used to signal the HOST (AM572x) on many events like received data from the WLAN media is ready at the firmware (WLAN Chip) queue, or that the last Tx frame was transmitted, all king of asynchronous messages (evens) and so on.  It can be used also as wake-up event. For more details check WL1835 documentation. You can check also the below wiki:

    Regards,
    Pavel