0

我有一个基于 SDIO 的 Wi-Fi 模块,我在 Zynq Petalinux 上使用它。所以设备树有SDIO1接口,加上它有fixedregulator。但我不知道如何让 Linux 将这个 SDIO1 接口用于 Wi-Fi。

我记得我必须对 Linux 使用一个 I2C 设备进行 RTC 做出回应。那么这里是不是很相似呢?

这是我的设备树:

  wlcore {
        compatible = "wlcore";
        interrupt-parent = <&intc>;
        irq = <0x0>;
        platform-quirks = <0x1>;
        board-ref-clock = <0x4>;
    };
  fixedregulator@1 {
        compatible = "regulator-fixed";
        regulator-name = "wlan-en-regulator";
        regulator-min-microvolt = <0x325aa0>;
        regulator-max-microvolt = <0x325aa0>;
        /* WLAN_EN GPIO for this board - Bank1, pin9, what does 4 mean? */
        gpio = <&gpio0 0x9 0x4>;
        startup-delay-us = <0x11170>;
        enable-active-high;
        linux,phandle = <0x6>;
        phandle = <0x6>;
    };
};
&sdhci1{
        xlnx,has-cd = <0x1>;
        xlnx,has-power = <0x0>;
        xlnx,has-wp = <0x0>;
        vmmc-supply = <0x6>;
        cap-power-off-card;
            status = "okay";
            compatible = "arasan,sdhci-8.9a";
            clock-names = "clk_xin", "clk_ahb";
            clocks = <&clkc 22>, <&clkc 33>;
            interrupt-parent = <&intc>;
            interrupts = <0 47 4>;
            reg = <0xe0101000 0x1000>;
    };

问题

如何告诉 Linux 将此 SDIO1 用于 Wi-Fi?

4

1 回答 1

1

我最近刚刚让我的 PicoZed 开发板运行 Petalinux 2014.4 与 TI 的 WiLink 8 Wi-Fi 模块一起使用,该模块也使用 SDIO 接口。

这是我的设备树 (system-top.dts) 的副本,它描述了固定稳压器和 SDIO1 接口。我用'<<<'来表示评论。这些应该为最终的设备树删除:

/dts-v1/;
/include/ "system-conf.dtsi"
/ {
    wlan_en: fixedregulator@2 {
    compatible = "regulator-fixed";
    regulator-name = "wlan-en-regulator";
    regulator-min-microvolt = <0x325aa0>;
    regulator-max-microvolt = <0x325aa0>;
    gpio = <&gpio0 0x9 0x4>; <<<< GPIO 9 for the WLAN_EN; 0x4 flag is controller-specific.
                             <<<<  see include/dt-bindings/gpio/gpio.h
    startup-delay-us = <0x11170>;
    enable-active-high;
    };
};

&gem0 {
    phy-handle = <&phy0>;
    phy-mode = "rgmii-id";

    mdio {
        #address-cells = <1>;
        #size-cells = <0>;
        phy0: phy@0 {
            compatible = "marvell,88e1510";
            device_type = "ethernet-phy";
            reg = <0x0>;
            marvell,reg-init = <3 16 0xff00 0x1e 3 17 0xfff0 0x00>;
        };
    };
};

&qspi {
    flash0: flash@0 {
        compatible = "micron,n25q128a13";
    };
};

&gpio0 {  <<<<< make GPIO0 an interrupt controller for GPIO interrupts
    interrupt-controller;
    #interrupt-cells = <2>;
};

&sdhci1{ <<<<<<< SDIO 1
    vmmc-supply = <&wlan_en>;
    bus-width = <4>;
    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";
            interrupt-parent = <&gpio0>;  <<< NOTE: GPIO use as interrupt parent
            interrupts = <0 4>;  <<<<<<<< using GPIO 0 for IRQ; 4 = input sense high
            reg = <2>;
            platform-quirks = <0x1>;
            board-ref-clock = <0x4>;
    };
};

您只需要更改用于启用的 GPIO 引脚和用于硬件设置的中断的引脚,但这些是推荐的引脚。

正确设置设备树只是让 Wi-Fi 模块与电路板一起工作的一步。如果您想参考我的完整设置过程,请访问: http: //picozed.org/content/steps-get-wlink8-working-using-petalinux-picozed

在那里,您还可以找到另一个贡献者提供的与 MicroZed 板一起工作的链接。

于 2016-01-29T20:28:33.340 回答