0

I have an SDIO based Wi-Fi module and I play to use it on Zynq Petalinux. So the device tree has SDIO1 interface, and plus it has fixedregulator. But I couldn't figure out how to let Linux use this SDIO1 interface for the Wi-Fi.

I remember I have to echo something for Linux to use one I2C device for RTC. So is it similar here?

Here is my device tree:

  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>;
    };

Question

How to tell Linux to use this SDIO1 for the Wi-Fi?

Splash
  • 1,288
  • 2
  • 18
  • 36

1 Answers1

1

I just recently got my PicoZed board running Petalinux 2014.4 working with TI's WiLink 8 Wi-Fi module, which also uses the SDIO interface.

Here is a copy of my device tree (system-top.dts) that describes the fixed regulator and the SDIO1 interface. I used '<<<' to signify a comment. These should be removed for the final device tree:

/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>;
    };
};

You should only need to change which GPIO pin is used for enable and which is used for the interrupt for your hardware setup, but these are the recommended pins.

Setting the device tree correctly is just one step in getting the Wi-Fi module working with the board. If you'd like to refer to my complete setup procedure, visit: http://picozed.org/content/steps-get-wlink8-working-using-petalinux-picozed

There you'll also find a link from another contributor for working with the MicroZed board as well.

thelummox
  • 336
  • 2
  • 8