Configure default MMC

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Configure default MMC

ソリューションへジャンプ
4,217件の閲覧回数
danielbujak
Contributor III

How does one select which MMC the kernel checks for the rootfs? I have a wifi module connected to usdhc1 that is disabled on boot but configured in the dts. When the kernel boots it keeps waiting for this device to become available which it wont be until the rootfs on usdhc2 is mounted and the i2c driver can run to initialize the PMIC controlling the wifi module.

Is it possible to have the kernel boot from MMC1 (usdhc2) by default? Here's the output of my log (note: eventually it gives up on mmc0 and boots from mmc1 but this takes 5 minutes)

...

8021q: 802.1Q VLAN Support v1.8
lib80211: common routines for IEEE802.11 drivers
Key type dns_resolver registered
input: gpio_keys as /devices/platform/gpio_keys/input/input1
snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01 00:00:01 UTC (1)
can-3v3: disabling
ALSA device list:
  No soundcards found.
Waiting for root device /dev/mmcblk1p2...
mmc0: Timeout waiting for hardware interrupt.
mmc0: Timeout waiting for hardware interrupt.
mmc0: Timeout waiting for hardware interrupt.
...
mmc0: Timeout waiting for hardware interrupt.
mmc0: Timeout waiting for hardware interrupt.
mmc0: Timeout waiting for hardware interrupt.
mmc1: host does not support reading read-only switch, assuming write-enable
mmc1: new SD card at address a153
mmcblk1: mmc1:a153 SU02G 1.84 GiB
 mmcblk1: p1 p2
EXT3-fs (mmcblk1p2): error: couldn't mount because of unsupported optional features (240)
EXT2-fs (mmcblk1p2): error: couldn't mount because of unsupported optional features (240)
EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 179:2.
devtmpfs: mounted
Freeing unused kernel memory: 428K (80a4d000 - 80ab8000)
EXT4-fs (mmcblk1p2): re-mounted. Opts: data=ordered
devpts: called with bogus options
Starting logging: OK
Starting PMIC VLDO3: usage: /bin/pf3001 <option>
options: read, write
usage: /bin/pf3001 <option>
options: read, write
OK
Initializing random number generator... done.
Starting system message bus: done
Starting network: OK
Starting connman ... done.
Starting dropbear sshd: OK

Welcome to Buildroot
buildroot login:

ラベル(1)
0 件の賞賛
返信
1 解決策
3,392件の閲覧回数
danielbujak
Contributor III

The solution was to add the "wifi-host" property to the wifi module in the dts:

/*wilink module on mmc0*/
&usdhc1 {
  status = "okay";
  vmmc-supply = <&wlan_en_reg>;
  bus-width = <4>;
  pinctrl-names = "default", "sleep";
  pinctrl-0 = <&usdhc1_pins_default &wlan_pins_default>;
  pinctrl-1 = <&usdhc1_pins_sleep &wlan_pins_sleep>;
  ti,non-removable;
  wifi-host;
  ti,needs-special-hs-handling;
  cap-power-off-card;
  keep-power-in-suspend;

  #address-cells = <1>;
  #size-cells = <0>;
  wlcore: wlcore@0 {
    compatible = "ti,wl1837";
    reg = <2>;
    interrupt-parent = <&gpio2>;
    interrupts = <4 0x1>;
  };
};

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
3,393件の閲覧回数
danielbujak
Contributor III

The solution was to add the "wifi-host" property to the wifi module in the dts:

/*wilink module on mmc0*/
&usdhc1 {
  status = "okay";
  vmmc-supply = <&wlan_en_reg>;
  bus-width = <4>;
  pinctrl-names = "default", "sleep";
  pinctrl-0 = <&usdhc1_pins_default &wlan_pins_default>;
  pinctrl-1 = <&usdhc1_pins_sleep &wlan_pins_sleep>;
  ti,non-removable;
  wifi-host;
  ti,needs-special-hs-handling;
  cap-power-off-card;
  keep-power-in-suspend;

  #address-cells = <1>;
  #size-cells = <0>;
  wlcore: wlcore@0 {
    compatible = "ti,wl1837";
    reg = <2>;
    interrupt-parent = <&gpio2>;
    interrupts = <4 0x1>;
  };
};

0 件の賞賛
返信
3,392件の閲覧回数
danielbujak
Contributor III

I'm thinking this should be resolved in the device tree but I'm not clear on what the difference is between the usdhc configurations in the .dtsi and the .dts. For example

DTSI:
            usdhc1: usdhc@02190000 {
                compatible = "fsl,imx6ul-usdhc", "fsl,imx6sx-usdhc";
                reg = <0x02190000 0x4000>;
                interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&clks IMX6UL_CLK_USDHC1>,
                     <&clks IMX6UL_CLK_USDHC1>,
                     <&clks IMX6UL_CLK_USDHC1>;
                clock-names = "ipg", "ahb", "per";
                bus-width = <4>;
                status = "disabled";
            };

            usdhc2: usdhc@02194000 {
                compatible = "fsl,imx6ul-usdhc", "fsl,imx6sx-usdhc";
                reg = <0x02194000 0x4000>;
                interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&clks IMX6UL_CLK_USDHC2>,
                     <&clks IMX6UL_CLK_USDHC2>,
                     <&clks IMX6UL_CLK_USDHC2>;
                clock-names = "ipg", "ahb", "per";
                bus-width = <4>;
                status = "disabled";
            };

DTS

/*sdcard on mmc1*/
&usdhc2 {
  status = "okay";
  pinctrl-names = "default";
  pinctrl-0 = <&pinctrl_usdhc2>;
};  

/*wilink module on mmc0*/
&usdhc1 {
  status = "okay";
  vmmc-supply = <&wlan_en_reg>;
  bus-width = <4>;
  pinctrl-names = "default", "sleep";
  pinctrl-0 = <&usdhc1_pins_default &wlan_pins_default>;
  pinctrl-1 = <&usdhc1_pins_sleep &wlan_pins_sleep>;
  ti,non-removable;
  ti,needs-special-hs-handling;
  cap-power-off-card;
  keep-power-in-suspend;

  #address-cells = <1>;
  #size-cells = <0>;
  wlcore: wlcore@0 {
    compatible = "ti,wl1837";
    reg = <2>;
    interrupt-parent = <&gpio2>;
    interrupts = <4 0x1>;
  };
};

0 件の賞賛
返信
3,392件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi danielbujak

it may be useful to look at  Table 31. Linux uSDHC relationships

attached Linux Guide.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信
3,392件の閲覧回数
danielbujak
Contributor III

Hi Igor,

Thanks, but I don't think this helps me with my issue. My problem is that linux indexes all uSDHC controllers starting with the wifi module on uSDCH1 which is not available until the rootfs is mounted from uSDCH2 and therefore it hangs waiting for uSDCH1 to become available. Can I get the kernel to load the rootfs from uSDCH2 without ever looking at uSDCH1?

If not, what's the solution?

0 件の賞賛
返信