Trouble

[SOLVED] Banana Pro 3.19.0 & AP6210/bcrmfmac not working

9 5885
Edited by Mr_Blonde at Wed Feb 11, 2015 09:04

Hey,

I need a recent kernel including WLAN support on the Banana Pro board. Since Igor's wheezy image has no AP6210 support at the moment, I took his images as a base and compiled the current kernel (3.19.0) on my own.

In order to add WLAN support, I selected brcmfmac support as a module. As stated here, the AP6210 is part of the bcrmfmac driver since kernel 3.14.

The kernel compiled and booted fine. Even the module loads without any error messages. There is, however, no wlan0 interface, once the module is loaded. :-(

Here ist the output:
  1. root@bananapi:~# uname -r
  2. 3.19.0
  3. root@bananapi:~# lsmod
  4. Module                  Size  Used by
  5. brcmfmac              150763  -2
  6. brcmutil                4680  -2
  7. mac80211              338714  -2
  8. bnep                    9169  -2
  9. cpufreq_userspace       1075  -2
  10. hidp                   11926  -2
  11. rfcomm                 30244  -2
  12. hci_uart               13962  -2
  13. bluetooth             282486  -2
  14. root@bananapi:~# iwconfig
  15. lo        no wireless extensions.

  16. eth0      no wireless extensions.

  17. bond0     no wireless extensions.

  18. tunl0     no wireless extensions.

  19. root@bananapi:~#
Copy the Code
Am I missing something? Is there something special which needs to be done with the bcrmfmac driver?

Thanks in advance for any hints!
Is it possible that the device tree file that you used is still missing the relevant nodes for the wifi interface? Just a guess... (as I don't have a Banana Pro)

tkaiser  
silentcreek replied at Wed Feb 11, 2015 02:36
Is it possible that the device tree file that you used is still missing the relevant nodes for the w ...

You're right. I just compared the cubietruck's dts file with the BananaPro's. In the cubie's there's written:
  1.                         mmc3_pins_a: mmc3@0 {
  2.                                 /* AP6210 requires pull-up */
  3.                                 allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  4.                         };
Copy the Code

silentcreek replied at Wed Feb 11, 2015 02:36
Is it possible that the device tree file that you used is still missing the relevant nodes for the w ...

You were right. I was still using the Banana Pi device tree. IS there already a proper one for the Pro? I tried to modify the existing sun7i-a20-bananapi.dts. Attached is my result. Booting with the new sun7i-a20-bananapro.dtb, however, didn't solve my problem. :-(
  1. /dts-v1/;
  2. /include/ "sun7i-a20.dtsi"
  3. /include/ "sunxi-common-regulators.dtsi"

  4. / {
  5.         model = "LeMaker Banana Pro";
  6.         compatible = "lemaker,bananapro", "allwinner,sun7i-a20";

  7.         aliases {
  8.                 serial0 = &uart0;
  9.                 serial1 = &uart3;
  10.                 serial2 = &uart7;
  11.         };

  12.         soc@01c00000 {
  13.                 spi0: spi@01c05000 {
  14.                         pinctrl-names = "default";
  15.                         pinctrl-0 = <&spi0_pins_a>;
  16.                         status = "okay";
  17.                 };

  18.                 mmc0: mmc@01c0f000 {
  19.                         pinctrl-names = "default";
  20.                         pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bananapro>;
  21.                         vmmc-supply = <&reg_vcc3v3>;
  22.                         bus-width = <4>;
  23.                         cd-gpios = <&pio 7 10 0>; /* PH10 */
  24.                         cd-inverted;
  25.                         status = "okay";
  26.                 };

  27.         mmc3 {
  28.             pinctrl-names = "default";
  29.             pinctrl-0 = <&mmc3_pins_a>;
  30.             vmmc-supply = <&reg_vmmc3>;
  31.             bus-width = <4>;
  32.             non-removable;
  33.             status = "okay";
  34.         };

  35.                 usbphy: phy@01c13400 {
  36.                         usb1_vbus-supply = <&reg_usb1_vbus>;
  37.                         usb2_vbus-supply = <&reg_usb2_vbus>;
  38.                         status = "okay";
  39.                 };

  40.                 ehci0: usb@01c14000 {
  41.                         status = "okay";
  42.                 };

  43.                 ohci0: usb@01c14400 {
  44.                         status = "okay";
  45.                 };

  46.                 ahci: sata@01c18000 {
  47.                         status = "okay";
  48.                 };

  49.                 ehci1: usb@01c1c000 {
  50.                         status = "okay";
  51.                 };

  52.                 ohci1: usb@01c1c400 {
  53.                         status = "okay";
  54.                 };

  55.                 pinctrl@01c20800 {
  56.                         mmc0_cd_pin_bananapro: mmc0_cd_pin@0 {
  57.                                 allwinner,pins = "PH10";
  58.                                 allwinner,function = "gpio_in";
  59.                                 allwinner,drive = <0>;
  60.                                 allwinner,pull = <1>;
  61.                         };

  62.             vmmc3_pin_bananapro: vmmc3_pin@0 {
  63.                 allwinner,pins = "PH22";
  64.                 allwinner,function = "gpio_out";
  65.                 allwinner,drive = <0>;
  66.                 allwinner,pull = <1>;
  67.             };



  68.                         gmac_power_pin_bananapro: gmac_power_pin@0 {
  69.                                 allwinner,pins = "PH23";
  70.                                 allwinner,function = "gpio_out";
  71.                                 allwinner,drive = <0>;
  72.                                 allwinner,pull = <0>;
  73.                         };

  74.                         led_pins_bananapro: led_pins@0 {
  75.                                 allwinner,pins = "PH24";
  76.                                 allwinner,function = "gpio_out";
  77.                                 allwinner,drive = <0>;
  78.                                 allwinner,pull = <0>;
  79.                         };
  80.                 };

  81.                 ir0: ir@01c21800 {
  82.                         pinctrl-names = "default";
  83.                         pinctrl-0 = <&ir0_pins_a>;
  84.                         status = "okay";
  85.                 };

  86.                 uart0: serial@01c28000 {
  87.                         pinctrl-names = "default";
  88.                         pinctrl-0 = <&uart0_pins_a>;
  89.                         status = "okay";
  90.                 };

  91.                 uart3: serial@01c28c00 {
  92.                         pinctrl-names = "default";
  93.                         pinctrl-0 = <&uart3_pins_b>;
  94.                         status = "okay";
  95.                 };

  96.                 uart7: serial@01c29c00 {
  97.                         pinctrl-names = "default";
  98.                         pinctrl-0 = <&uart7_pins_a>;
  99.                         status = "okay";
  100.                 };

  101.                 i2c0: i2c@01c2ac00 {
  102.                         pinctrl-names = "default";
  103.                         pinctrl-0 = <&i2c0_pins_a>;
  104.                         status = "okay";

  105.                         axp209: pmic@34 {
  106.                                 compatible = "x-powers,axp209";
  107.                                 reg = <0x34>;
  108.                                 interrupt-parent = <&nmi_intc>;
  109.                                 interrupts = <0 8>;

  110.                                 interrupt-controller;
  111.                                 #interrupt-cells = <1>;
  112.                         };
  113.                 };

  114.                 i2c2: i2c@01c2b400 {
  115.                         pinctrl-names = "default";
  116.                         pinctrl-0 = <&i2c2_pins_a>;
  117.                         status = "okay";
  118.                 };

  119.                 gmac: ethernet@01c50000 {
  120.                         pinctrl-names = "default";
  121.                         pinctrl-0 = <&gmac_pins_rgmii_a>;
  122.                         phy = <&phy1>;
  123.                         phy-mode = "rgmii";
  124.                         phy-supply = <&reg_gmac_3v3>;
  125.                         status = "okay";

  126.                         phy1: ethernet-phy@1 {
  127.                                 reg = <1>;
  128.                         };
  129.                 };
  130.         };

  131.         leds {
  132.                 compatible = "gpio-leds";
  133.                 pinctrl-names = "default";
  134.                 pinctrl-0 = <&led_pins_bananapro>;

  135.                 green {
  136.                         label = "bananapro:green:usr";
  137.                         gpios = <&pio 7 24 0>;
  138.                 };
  139.         };

  140.         reg_usb1_vbus: usb1-vbus {
  141.                 status = "okay";
  142.         };

  143.         reg_usb2_vbus: usb2-vbus {
  144.                 status = "okay";
  145.         };

  146.         reg_gmac_3v3: gmac-3v3 {
  147.                 compatible = "regulator-fixed";
  148.                 pinctrl-names = "default";
  149.                 pinctrl-0 = <&gmac_power_pin_bananapro>;
  150.                 regulator-name = "gmac-3v3";
  151.                 regulator-min-microvolt = <3300000>;
  152.                 regulator-max-microvolt = <3300000>;
  153.                 startup-delay-us = <100000>;
  154.                 enable-active-high;
  155.                 gpio = <&pio 7 23 0>;
  156.         };

  157.     reg_vmmc3: vmmc3 {
  158.         compatible = "regulator-fixed";
  159.         pinctrl-names = "default";
  160.         pinctrl-0 = <&vmmc3_pin_bananapro>;
  161.         regulator-name = "vmmc3";
  162.         regulator-min-microvolt = <3300000>;
  163.         regulator-max-microvolt = <3300000>;
  164.         enable-active-high;
  165.         gpio = <&pio 7 22 0>;
  166.     };
  167. };
Copy the Code

tkaiser  
Edited by tkaiser at Wed Feb 11, 2015 07:22
Mr_Blonde replied at Wed Feb 11, 2015 06:46
IS there already a proper one for the Pro?


Have a look at both sun7i-a20-bananapro.dts and sun7i-a20-cubietruck.dts: https://github.com/mripard/linux ... t/arch/arm/boot/dts

Can you please upload the output (reverse-banana-pro.dts) of
  1. $path-to-mainline-kernel-source/scripts/dtc/dtc -I fs -O dts -o reverse-banana-pro.dts /proc/device-tree
Copy the Code
to pastebin.com and post a link to it here?

Edited by Mr_Blonde at Wed Feb 11, 2015 07:59
tkaiser replied at Wed Feb 11, 2015 07:22
Can you please upload the output (reverse-banana-pro.dts) of
$path-to-mainline-kernel-source/scripts/dtc/dtc -I fs -O dts -o reverse-banana-pro.dts /proc/device-tree
Copy the Code
to pastebin.com and post a link to it here?


It's actually not telling me much.
  1. root@bananapi:~/linux-3.19# scripts/dtc/dtc -I fs -O dts -o reverse-banana-pro.dts /proc/device-tree
  2. root@bananapi:~/linux-3.19#
Copy the Code
EDIT:

Using the correct dtb file, it worked! Thank you very much. Here is the link to the modified sun7i-a20-bananapro.dts file:
http://pastebin.com/eq6ETmyR

tkaiser  
Edited by tkaiser at Wed Feb 11, 2015 08:52
Mr_Blonde replied at Wed Feb 11, 2015 07:47
It's actually not telling me much.EDIT:

Using the correct dtb file, it worked! Thank you very much ...


Glad to hear that it worked. Regarding the output of dtc: you've to open the file reverse-banana-pro.dts that has been created in the current working directory. Please post its contents via pastebin.com.

Regarding the changes you made to the .dts file: I saw that you replaced all 6 allwinner,drive/allwinner,pull entries in the &pio section that read
  1.                 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  2.                 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
Copy the Code
before with 0/0 (and 0/1 in case of mmc0_cd_pin). And everything's still working? USB? Network?

According to LeMaker's fex file for the Banana Pro the pin for the Wi-Fi chip is PH22.

tkaiser replied at Wed Feb 11, 2015 08:52
Glad to hear that it worked. Regarding the output of dtc: you've to open the file reverse-banana-p ...

Here it is: reverse-banana-pro.dts

So far everything is working (USB keyboard, Ethernet & WLAN). I did not test any other functionality (SPI, ...) yet. I replaced the <SUN4I_PINCTRL_NO_PULL> tags as they gave me compilation errors. There were two PULL tags which I changed two <1>. I replaced all others (NO_PULL) with <0>.

hnsncxy  
Edited by hnsncxy at Thu Feb 12, 2015 08:45
Mr_Blonde replied at Wed Feb 11, 2015 08:58
Here it is: reverse-banana-pro.dts

So far everything is working (USB keyboard, Ethernet & WLAN).  ...


Hi, Mr_Blonde
Can the USB Keyboard and Mouse work after you boot the X window (Eg: LXDE) ?

hnsncxy replied at Thu Feb 12, 2015 08:45
Hi, Mr_Blonde
Can the USB Keyboard and Mouse work after you boot the X window (Eg: LXDE) ?

I do not have any xwindow installed. Therefore, I can't tell.

You have to log in before you can reply Login | Sign Up

Points Rules