robherring / generic_device

A generic android device repository
62 stars 29 forks source link

How to deploy flo wifi blobs to work with the kernel #14

Open montvid opened 6 years ago

montvid commented 6 years ago

@johnstultz-work you said you got wifi working on flo and currently I am trying to fix wifi in postmarketos. It seems a blob is needed as after compiling your kernel the wifi does not work. Do you have any instructions how to enable wifi on flo and could you put all the needed blobs in linux-firmware?

montvid commented 6 years ago

@johnstultz-work I see you implemented in your kernel the WCNSS core but you don't have the prima drivers in your kernel from here https://source.codeaurora.org/external/wlan/prima/tree/ So that is needed for wifi support? I get this error after kernel boot: [ 64.484844] remoteproc remoteproc0: powering up 3200800.riva-pil [ 64.486164] remoteproc remoteproc0: Direct firmware load for wcnss.mdt failed with error -2 [ 64.486174] remoteproc remoteproc0: Falling back to user helper

robherring commented 6 years ago

There are issues with redistribution of the blobs. That is why they are not included in the project or upstream. You have to get them from Google

montvid commented 6 years ago

Thank you for your reply @robherring I have the blobs from google in /lib/firmware and codeaurora /lib/firmware/wlan/prima. The kernel starts wifi and it crashes and then I start wifi with https://git.linaro.org/landing-teams/working/qualcomm/wcnss-config.git wcnss-start and I get an error again. That is in my port of postmarketos/linux as I can't load the Android build.

I think you don't understand me in full. I guess the title is misleading. The main problem is that there is no clear instruction what firmware is needed to load wifi and where/how should it be deployed and if it is working at all at the moment. That is why I ask @johnstultz-work because it has to do with his flo kernel.

@robherring if you know anything about this please write too. As I understand your flo Android build uses @johnstultz-work kernel? Does wifi work for you? Can you use your Android build on flo?

If it is not the right place to ask about @johnstultz-work kernel please guide me where should I inquire?

montvid commented 6 years ago

Okay, so finally after two days of work I found out how to load the wifi drivers for Nexus 7 2013 flo and want to share with you all so it may help with your devices:

  1. See if your kernel has this /drivers/net/wireless/ath/wcn36xx as new kernels have this driver and select it in menuconfig if you are compiling the kernel.
  2. Download the official or community ROM for your device.
  3. Find and convert system.img or system.new.dat file to a raw image so you can exctract firmware: simg2img system.img system.raw.img or sdat2img system.transfer.list system.new.dat system.img
  4. The files you need are in /vendor/firmware/ and /etc/wifi/. For Linux support overwrite /vendor/firmware/wlan/prima/ with /etc/wifi/ files. If you have a WCNSS_qcom_wlan_nv*.bin file - rename it to WCNSS_qcom_wlan_nv.bin and overwrite the old WCNSS_qcom_wlan_nv.bin as it is only a symlink.
  5. Put the created /firmware/ folder to your system /lib/firmware/ folder. Alternatively for wifi you only need WCNSS_cfg.dat, WCNSS_qcom_cfg.ini, WCNSS_qcom_wlan_nv.bin and all the wcnss* files.
  6. IMPORTANT! Check if the checksums of the files on your pc and device are the same with sha512sum *
  7. Download and copy just wcnss-start into /usr/sbin/ or you can use the whole package if needed. https://git.linaro.org/landing-teams/working/qualcomm/wcnss-config.git/tree/
  8. Reboot and after startup write dmesg and see if the wifi driver has loaded and ip link to see if you have a wlan0 device if not try to run wcnss-start manualy or reboot again. Try to build the kernel wifi driver as a module.
  9. Try to run wpa suplicant and dhcp to see if you can connect to the Internet.
montvid commented 6 years ago

The upstream https://source.codeaurora.org/external/wlan/prima/tree/firmware_bin/WCNSS_qcom_wlan_nv.bin does not work with flo. Maybe it is not a generic firmware. Updated instructions.