build-wl18xx: add support for imx6 solo lite board
[wilink8-wlan/build-utilites.git] / patches / kernel_patches / imx-3.10.53 / 0008-imx6sl-evk-add-support-for-wilink8-wlan-and-bluetoot.patch
1 From 92adbbd7e6082277eb1865a7b8b3c24a8cab8fe3 Mon Sep 17 00:00:00 2001
2 From: Eyal Reizer <eyalr@ti.com>
3 Date: Mon, 23 Mar 2015 13:14:06 +0200
4 Subject: [PATCH] imx6sl-evk: add support for wilink8 wlan and bluetooth
6 * enable uart4 used for bluetooth with wilink8 with flow control
7 * configure SD3 to be used for sdio communication to wilink8 wlan
8 * configure gpios used for wlan/bt enables and wlan_irq
9 * setup voltage regulator used for wl8 wlan power control
10 * disable SD1 as it pins are used for BT/WLAN EN, IRQ, BT UART
12 Signed-off-by: Alexey Berd <alexeyb@ti.com>
13 ---
14  arch/arm/boot/dts/imx6sl-evk-common.dtsi |   59 +++++++++++++++++++++---------
15  arch/arm/boot/dts/imx6sl.dtsi            |   43 ++++------------------
16  2 files changed, 49 insertions(+), 53 deletions(-)
18 diff --git a/arch/arm/boot/dts/imx6sl-evk-common.dtsi b/arch/arm/boot/dts/imx6sl-evk-common.dtsi
19 index 7e0088f..1e7f7ce 100644
20 --- a/arch/arm/boot/dts/imx6sl-evk-common.dtsi
21 +++ b/arch/arm/boot/dts/imx6sl-evk-common.dtsi
22 @@ -11,6 +11,28 @@
23                 reg = <0x80000000 0x40000000>;
24         };
25  
26 +       wlan_en_reg: fixedregulator@2 {
27 +               compatible = "regulator-fixed";
28 +               regulator-name = "wlan-en-regulator";
29 +               regulator-min-microvolt = <1800000>;
30 +               regulator-max-microvolt = <1800000>;
31 +               /* WLAN_EN GPIO for this board - Bank5, pin13 */
32 +               gpio = <&gpio5 13 0>;
33 +               enable-active-high;
34 +       };
35 +
36 +       kim {
37 +               compatible = "kim";
38 +               nshutdown_gpio = <134>;  // GPIO5_6 The wl8 driver expects gpio to be an integer, so gpio5_6 is (5-1)*32+6=134
39 +               dev_name = "/dev/ttymxc3";
40 +               flow_cntrl = <1>;
41 +               baud_rate = <3000000>;
42 +       };
43 +
44 +       btwilink {
45 +               compatible = "btwilink";
46 +       };
47 +
48         battery: max8903@0 {
49                 compatible = "fsl,max8903-charger";
50                 pinctrl-names = "default";
51 @@ -452,6 +474,13 @@
52         status = "okay";
53  };
54  
55 +&uart4 {
56 +       pinctrl-names = "default";
57 +       pinctrl-0 = <&pinctrl_uart4_1>;
58 +       status = "okay";
59 +       fsl,uart-has-rtscts;      // enable rts/cts usage on uart4
60 +};
61 +
62  &usbotg1 {
63         vbus-supply = <&reg_usb_otg1_vbus>;
64         pinctrl-names = "default";
65 @@ -468,19 +497,6 @@
66         status = "okay";
67  };
68  
69 -&usdhc1 {
70 -       pinctrl-names = "default", "state_100mhz", "state_200mhz";
71 -       pinctrl-0 = <&pinctrl_usdhc1_1>;
72 -       pinctrl-1 = <&pinctrl_usdhc1_1_100mhz>;
73 -       pinctrl-2 = <&pinctrl_usdhc1_1_200mhz>;
74 -       bus-width = <8>;
75 -       cd-gpios = <&gpio4 7 0>;
76 -       wp-gpios = <&gpio4 6 0>;
77 -       keep-power-in-suspend;
78 -       enable-sdio-wakeup;
79 -       status = "okay";
80 -};
81 -
82  &usdhc2 {
83         pinctrl-names = "default", "state_100mhz", "state_200mhz";
84         pinctrl-0 = <&pinctrl_usdhc2_1>;
85 @@ -494,12 +510,21 @@
86  };
87  
88  &usdhc3 {
89 -       pinctrl-names = "default", "state_100mhz", "state_200mhz";
90 +       pinctrl-names = "default";
91         pinctrl-0 = <&pinctrl_usdhc3_1>;
92 -       pinctrl-1 = <&pinctrl_usdhc3_1_100mhz>;
93 -       pinctrl-2 = <&pinctrl_usdhc3_1_200mhz>;
94 -       cd-gpios = <&gpio3 22 0>;
95         keep-power-in-suspend;
96         enable-sdio-wakeup;
97 +       vmmc-supply = <&wlan_en_reg>;
98 +       non-removable;    // non-removable is not a variable, the fact it is listed is all that is used by driver
99 +       cap-power-off-card;
100         status = "okay";
101 +       #address-cells = <1>;
102 +       #size-cells = <0>;
103 +       wlcore: wlcore@0 {
104 +               compatible = "ti,wlcore";
105 +               reg = <2>;
106 +               interrupt-parent = <&gpio5>;
107 +               interrupts = <8 0>;
108 +               platform-quirks = <1>;
109 +       };
110  };
111 diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi
112 index 92ca6c5..260d431 100644
113 --- a/arch/arm/boot/dts/imx6sl.dtsi
114 +++ b/arch/arm/boot/dts/imx6sl.dtsi
115 @@ -1158,19 +1158,11 @@
116         uart4 {
117                 pinctrl_uart4_1: uart4grp-1 {
118                         fsl,pins = <
119 -                               MX6SL_PAD_SD1_DAT4__UART4_RX_DATA 0x1b0b1
120 -                               MX6SL_PAD_SD1_DAT5__UART4_TX_DATA 0x1b0b1
121 -                               MX6SL_PAD_SD1_DAT7__UART4_CTS_B   0x1b0b1
122 -                               MX6SL_PAD_SD1_DAT6__UART4_RTS_B   0x1b0b1
123 -                       >;
124 -               };
126 -               pinctrl_uart4dte_1: uart4dtegrp-1 {
127 -                       fsl,pins = <
128 -                               MX6SL_PAD_SD1_DAT5__UART4_RX_DATA 0x1b0b1
129 -                               MX6SL_PAD_SD1_DAT4__UART4_TX_DATA 0x1b0b1
130 -                               MX6SL_PAD_SD1_DAT6__UART4_CTS_B   0x1b0b1
131 -                               MX6SL_PAD_SD1_DAT7__UART4_RTS_B   0x1b0b1
132 +                               MX6SL_PAD_SD1_DAT4__UART4_RX_DATA 0x13059 // used for HOST_HCI_RX
133 +                               MX6SL_PAD_SD1_DAT5__UART4_TX_DATA 0x13059 // used for HOST_HCI_TX
134 +                               MX6SL_PAD_SD1_DAT7__UART4_CTS_B 0x13059   // used for HOST_HCI_RTS, note reversed to TI nomenclature
135 +                               MX6SL_PAD_SD1_DAT6__UART4_RTS_B 0x13059   // used for HOST_HCI_CTS
136 +                               MX6SL_PAD_SD1_DAT3__GPIO5_IO06  0x13059   // used for BT_EN
137                         >;
138                 };
139         };
140 @@ -1325,30 +1317,9 @@
141                                 MX6SL_PAD_SD3_DAT1__SD3_DATA1 0x17059
142                                 MX6SL_PAD_SD3_DAT2__SD3_DATA2 0x17059
143                                 MX6SL_PAD_SD3_DAT3__SD3_DATA3 0x17059
144 +                               MX6SL_PAD_SD1_DAT2__GPIO5_IO13  0x13059   // reserve two pins from sd1 for wl8 gpio, this is pulled low at reset for WL_EN
145 +                               MX6SL_PAD_SD1_DAT1__GPIO5_IO08  0x13059   // this is for wl_irq which driver will configure as an input with a pull down
146                         >;
147                 };
149 -               pinctrl_usdhc3_1_100mhz: usdhc3grp-1-100mhz {
150 -                       fsl,pins = <
151 -                               MX6SL_PAD_SD3_CMD__SD3_CMD    0x170b9
152 -                               MX6SL_PAD_SD3_CLK__SD3_CLK    0x100b9
153 -                               MX6SL_PAD_SD3_DAT0__SD3_DATA0 0x170b9
154 -                               MX6SL_PAD_SD3_DAT1__SD3_DATA1 0x170b9
155 -                               MX6SL_PAD_SD3_DAT2__SD3_DATA2 0x170b9
156 -                               MX6SL_PAD_SD3_DAT3__SD3_DATA3 0x170b9
157 -                       >;
158 -               };
160 -               pinctrl_usdhc3_1_200mhz: usdhc3grp-1-200mhz {
161 -                       fsl,pins = <
162 -                               MX6SL_PAD_SD3_CMD__SD3_CMD    0x170f9
163 -                               MX6SL_PAD_SD3_CLK__SD3_CLK    0x100f9
164 -                               MX6SL_PAD_SD3_DAT0__SD3_DATA0 0x170f9
165 -                               MX6SL_PAD_SD3_DAT1__SD3_DATA1 0x170f9
166 -                               MX6SL_PAD_SD3_DAT2__SD3_DATA2 0x170f9
167 -                               MX6SL_PAD_SD3_DAT3__SD3_DATA3 0x170f9
168 -                       >;
169 -               };
171         };
172  };
173 -- 
174 1.7.9.5