mikeeq / mbp-fedora-kernel

65 stars 12 forks source link

WiFi issues #3

Open mikeeq opened 4 years ago

mikeeq commented 4 years ago

Hello everyone,

As many of us have problems with running WiFi under Linux on new Macs, I want to make a list of already compatible models/wifi chips here and track all issues in one thread. Sorry for closing other ones.

Compatible models:

How correct Broadcom fw load should look like in dmesg:

➜ dmesg | grep brcmfmac
[   13.351387] usbcore: registered new interface driver brcmfmac
[   13.351570] brcmfmac 0000:01:00.0: enabling device (0000 -> 0002)
[   13.454664] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4364-pcie for chip BCM4364/3
[   14.545924] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4364-pcie for chip BCM4364/3
[   14.578324] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4364/3 wl0: Mar 28 2019 19:17:52 version 9.137.9.0.32.6.34 FWID 01-36f56c94
[   14.658688] brcmfmac 0000:01:00.0 wlp1s0: renamed from wlan0
modprobe -r brcmfmac; modprobe brcmfmac rambase_addr=0x160000
#/etc/default/grub
GRUB_CMDLINE_LINUX="rhgb quiet efi=noruntime pcie_ports=compat modprobe.blacklist=thunderbolt systemd.unified_cgroup_hierarchy=0 brcmfmac.rambase_addr=0x160000"

Please post here all WiFi related issues.

Related issues in other projects:

Historic issues:

zhewang95 commented 4 years ago

Imcompatible models:

Wrong Broadcom fw load message:

[    7.140063] usbcore: registered new interface driver brcmfmac  
[    7.140311] brcmfmac 0000:01:00.0: enabling device (0000 -> 0002)  
[    7.245941] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4364-pcie for chip BCM4364/3  
[    9.624439] brcmfmac 0000:01:00.0: brcmf_pcie_download_fw_nvram: FW failed to initialize  
mikeeq commented 4 years ago

@zhewang95 Your revision of WiFi chip probably uses different rambase address (https://github.com/Dunedan/mbp-2016-linux/issues/112#issuecomment-570008233) than my one. Are you able to recompile the kernel by yourself and check if removing that line fixes the issue for you?

https://github.com/mikeeq/mbp-fedora-kernel/blob/v5.4-f31/patches/wifi.patch#L21

Also you can check if it will be printed in dmesg after adding brcmfmac.debug=2097150 to kernel arguments, like here:

[    4.170427] brcmfmac: brcmf_chip_get_raminfo RAM: base=0x160000 size=1310720 (0x140000) sr=0 (0x0)
zhewang95 commented 4 years ago

@mikeeq OK I will have a try

ktb92677 commented 4 years ago

Imcompatible models:

MacbookAir 8,2 i5 BCM4355/12 (P-hawaii-X0_M-YSBC_V-u__m-4.3.txt) Wrong Broadcom fw load message:

[    7.140063] usbcore: registered new interface driver brcmfmac  
[    7.140311] brcmfmac 0000:02:00.0: enabling device (0000 -> 0002)  
[    7.245941] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4355-pcie for chip BCM4355/12  
[    7.778035] bluetooth hci0: Direct firmware load for brcm/BCM.hcd failed with error -2  
[    7.778037] Bluetooth: hci0: BCM: Patch brcm/BCM.hcd not found  
[    9.624439] brcmfmac 0000:02:00.0: brcmf_pcie_download_fw_nvram: FW failed to initialize

A couple of notes... Here is what I named each file (MacOSX -> Fedora)

C-4355s-C1/hawaii.trx -> /lib/firmware/brcm/brcmfmac4355-pcie.bin C-4355s-C1/hawaii-X0.clmb -> /lib/firmware/brcm/brcmfmac4355-pcie.clm_blob C-4355s-C1/P-hawaii-X0_M-YSBC_V-um-4.3.txt -> "/lib/firmware/brcm/brcmfmac4355-pcie.Apple Inc.-MacBookAir8,2.txt"

I have used the latest ISO listed here: https://github.com/mikeeq/mbp-fedora

Per these comments: https://github.com/Dunedan/mbp-2016-linux/issues/112#issuecomment-523730513 and https://github.com/Dunedan/mbp-2016-linux/issues/112#issuecomment-523483504 People have been successful in loading wifi on the MacBookAir8,2 and the BCM4355 driver. The particular kernel patch they are referencing was this: https://github.com/ppaulweber/linux-mba/commit/80f9698fad2b0e7e7de1bca1076085bb715f5968. Unfortunately I am not quite skilled enough to recompile the linux kernel myself and apply this patch to see if it works. But I looked through the patches posted on this repository and saw that the wifi kernel patches seem pretty similar.

The only conclusion I can reach is that I am doing something wrong but I cannot for the life of me figure out what I am doing wrong. Any help would be greatly appreciated!

mikeeq commented 4 years ago

@ktb92677 Please check brcmf_chip_get_raminfo size in dmesg after adding brcmfmac.debug=2097150 to kernel args (in grub).

ktb92677 commented 4 years ago

@mikeeq Hey, I am having trouble getting the CRTL+SHIFT+F10 trick to work on my mac... any other way to edit kernel args?

EDIT: okay I got to the screen with CTRL_SHIFT+F10. I edited the kernel parameters but now I can't hit CTRL+X to save it!

FURTHER EDIT: Doesn't hitting F10 boot with the modifications made in the grub interface? If so I hit F10 after making the modification and when it booted there was no reference to brcmf_chip_get_raminfo inside of dmesg.... I assume F10 means "disregard the changes and boot"

LAST EDIT (I promise... read from here): Okay so you hit CTRL+SHIFT+F10 to get grub to take the kernel parameter. Got it. I can confirm via dmesg that the kernel parameter "brcmfmac.debug=2097150" was taken. However there is still no reference to "brcmf_chip_get_raminfo" inside of dmesg... what do I do from here?

geovie commented 4 years ago

@mikeeq Thanks a lot for this project :+1:

Incompatible model:

dmesg | grep brcmfmac:

[    5.500453] usbcore: registered new interface driver brcmfmac
[    5.500664] brcmfmac 0000:01:00.0: enabling device (0000 -> 0002)
[    5.607914] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4364-pcie for chip BCM4364/3
[    7.987068] brcmfmac 0000:01:00.0: brcmf_pcie_download_fw_nvram: FW failed to initialize

I also tried adding brcmfmac.debug=2097150 as kernel argument, but there was no change in the dmesg output...

BTW: modprobe -r brcmfmac; modprobe brcmfmac debug=2097150 should also work without the need to edit kernel arguments...

ktb92677 commented 4 years ago

Thanks @geovie on the suggestion. I tried adding "debug=2097150" after modprobe like you suggested with no changes for me as well.

Xinkai commented 4 years ago

Same FW failed to initialize problem here with a 4364 on a 15,3. I have tried every possible baseaddr in that file: 0x160000, 0x180000, 0x198000, 0x200000. None of them works.

mikeeq commented 4 years ago

We need to find a solution to load brcmfmac module with debug parameter to find out baseaddr for most wifi chips revisions, so I can make several versions of kernel so everyone will be able to download kernel with his wifi.patch backed into the kernel.

geovie commented 4 years ago

@mikeeq Is modprobe -r brcmfmac; modprobe brcmfmac debug=2097150working for you?

mikeeq commented 4 years ago

I tried it on my current setup (when FW is loading correctly) and I don't have any additional logs in dmesg, i don't have time to test it further at the moment.

ppaulweber commented 4 years ago

Same FW failed to initialize problem here with a 4364 on a 15,3. I have tried every possible baseaddr in that file: 0x160000, 0x180000, 0x198000, 0x200000. None of them works.

@Xinkai @ktb92677 accordingly to one of the first issues the firmware loading address 0x160000 should be fine for BRCM 4355 and 4364 chips.

At the beginning I had a similar problem as reported above:

[    5.607914] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4364-pcie for chip BCM4364/3
[    7.987068] brcmfmac 0000:01:00.0: brcmf_pcie_download_fw_nvram: FW failed to initialize

I recommend to check the following locations in the patch of the brcmfmac driver if you have correctly patched those location as well: https://github.com/ppaulweber/linux-mba/blob/master/patch-linux-brcmfmac.diff Check especially the mapping at the end of the patch because the device id and hw id differs from the chip name!

Just to check, here is my firmware listing:

-rw-r--r-- 1 root root  655611 2019-08-17 19:53  /lib/firmware/brcm/brcmfmac4355-pcie.bin
-rw-r--r-- 1 root root 3039828 2019-08-17 21:22  /lib/firmware/brcm/brcmfmac4355-pcie.hexdump
-rw-r--r-- 1 root root     607 2019-08-17 19:53  /lib/firmware/brcm/brcmfmac4355-pcie.txcb
-rw-r--r-- 1 root root    5093 2019-08-21 16:18 '/lib/firmware/brcm/brcmfmac4355-pcie.Apple Inc.-MacBookAir8,1.txt'
-rw-r--r-- 1 root root   14241 2019-08-17 19:54  /lib/firmware/brcm/brcmfmac4355-pcie.clm_blob

And my dmesg output (I'm reloading the brcmfmac and iwd at every system start-up):

[   43.124844] usbcore: deregistering interface driver brcmfmac
[   43.346802] usbcore: registered new interface driver brcmfmac
[   43.457090] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4355-pcie for chip BCM4355/12
[   43.904065] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4355-pcie for chip BCM4355/12
[   43.928037] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4355/12 wl0: Mar 28 2019 19:57:32 version 9.137.9.0.32.6.33 FWID 01-c5e1774f
ktb92677 commented 4 years ago

@ppaulweber so here's the wifi patch that @mikeeq was using: https://github.com/mikeeq/mbp-fedora-kernel/blob/d8f5578d4fd9c9ee01c2a125dae30237aefcf391/patches/wifi.patch. I've taken a look at that and compared it to the wifi patch you posted (also carefully looking at those lines that you specified) and the patch seems pretty okay to me.

One difference I did immediately notice though was that on my system I only copied over the .txt, clm_blob, and bin. Are the hexdump and txcb files required as well for this to work?

ppaulweber commented 4 years ago

@ktb92677 but accordingly to this patch from @mikeeq the BRCM_CC_4355_CHIP_ID redirects (switch case fall-through) to tcm_rambase value 0x180000 and not 0x160000.

https://github.com/mikeeq/mbp-fedora-kernel/blob/d8f5578d4fd9c9ee01c2a125dae30237aefcf391/patches/wifi.patch#L7-L24

One difference I did immediately notice though was that on my system I only copied over the .txt, clm_blob, and bin. Are the hexdump and txcb files required as well for this to work?

no, I forgot to strip them, sry about that

ktb92677 commented 4 years ago

@ppaulweber Okay, with my very limited knowledge of this I am trying to recompile the kernel with that patch included... If you have any suggestions on how I might test to see if this is what is causing my problems short of rebuilding the kernel that would be appreciated.

@mikeeq any chance you could include this fix into your repository sometime soon? Also instructions on how to build this from home. (e.g. do I just run the build.sh script on a Fedora machine?)

mikeeq commented 4 years ago

Will do it in a minute ;)

ktb92677 commented 4 years ago

okay great! @mikeeq I am currently running a "sh build.sh" over here. As soon as the new kernel-5.4.8-200.mbp.fc31.x86_64.rpm file pops out I'll go ahead and install it to my mba8,2 and I'll let you know what happens

ktb92677 commented 4 years ago

@mikeeq okay well I just finally built it all and installed everything... for some reason my system doesn't get past the following screen:

BCMDHD_ExitBootService: ENTER dhd_os_wifi_platofrm_set_power: Setting wl_reg_on to 0 succeeded dhd_os_wifi_platform_set_power: Setting wl_reg_on to 1 succeeded

What have I done wrong..

EDIT: SO hitting return a bunch of times makes the thing boot at that screen. Anyways I got the same exact error after the kernel update (I verified that the new kernel is running via uname -a). The error is "FW failed to initialize". Not exactly sure what else to check here.. Did I also mention my mouse and keyboard don't work after the kernel upgrade?

ktkd commented 4 years ago

Hello, i have tested this update with mbp 15,2 i5 maui-x3. have same issue as in previous kernel

brcmf_pcie_download_fw_nvram: FW failed to initialize

trying to set debug options but without any good results.

ppaulweber commented 4 years ago

@ktkd the fix mentioned above addresses only the MBA8,2 issues from @ktb92677

@ktb92677 seems that UEFI has an incorrect firmware setting, just reboot to your system into Mac OS X, ignore the system error report dialog, and reboot back to your bootloader (grub etc.) and boot your Linux again.

ktb92677 commented 4 years ago

@ppaulweber reboot to MacOSX? I over wrote MacOSX already though. Do I need to re-install it?

ppaulweber commented 4 years ago

@ktb92677 I hope you didn't erased the EFI partition of your internal storage, otherwise you have no proper Apple firmware installed and the Apple UEFI uses this to setup etc. the device.

ktb92677 commented 4 years ago

@ppaulweber I do not believe that I erased the EFI partition. I used the following repo to install linux on my Mac: https://github.com/mikeeq/mbp-fedora.

So what are you suggesting? Should I go through the Apple recovery process and re-install MacOSX right now and then try to install Fedora again ontop of it?

EDIT: And just as I was trying to use the new mbp-fedora image posted on https://github.com/mikeeq/mbp-fedora with the new kernel patch and it doesn't get past the spinning wheel screen on Fedora... https://github.com/mikeeq/mbp-fedora/issues/13

mikeeq commented 4 years ago

@ktb92677 but README doesn't mention that you should remove all partitions :D

You can always split your main macOS partition and then use left free space for other partitions ;)

And yes I recommend to install macOS, i.e. for EFI/iBridge updates.

Cheers

ktb92677 commented 4 years ago

@mikeeq Okay cool, well I am re-installing MacOSX right now. Looks like the recovery portion of MacOSX stayed in tact through all this hacking.

Still not sure why the ISO wasn't booting though. Also how do you know that the ISO will boot after I re-install MacOSX?

mikeeq commented 4 years ago

I don't know if ISO will boot after you reinstall macOS (it shouldn't be related), I was testing it only on a VM. I will test it in a minute on my Macbook Pro 15,2 ;)

EDIT: It's booting correctly for me.

JamesCCN commented 4 years ago

Imcompatible models:

MACOS 10.15

ioreg -l | grep C-4364
images" = {"C-4364__s-B2/P-kauai-X0_M-HRPN_V-m__m-7.7.txt"={"imagetype"="NVRAM","required"=Yes,"imagename"="C-4364__s-B2/P-kauai-X0_M-HRPN_V-m__m-7.7.txt"},"C-4364__s-B2/kauai-X0.txcb"={"imagetype"="TxCap","required"=No,"imagename"="C-4364__
s-B2/kauai-X0.txcb"},"C-4364__s-B2/kauai-X0.clmb"={"imagetype"="Regulatory","required"=Yes,"imagename"="C-4364__s-B2/kauai-X0.clmb"},"C-4364__s-B2/kauai.trx"={"imagetype"="Firmware","required"=Yes,"imagename"="C-4364__s-B2/kauai.trx"}}

Kernel Version

uname -a
Linux localhost.localdomain 5.4.8-200.mbp.fc31.x86_64 #1 SMP Wed Jan 8 11:08:06 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

No kernel driver in use.

lspci -vnn -d 14e4:
03:00.0 Network controller [0280]: Broadcom Inc. and subsidiaries BCM4364 802.11ac Wireless Network Adapter [14e4:4464] (rev 03)
        Subsystem: Apple Inc. Device [106b:07bf]
        Flags: fast devsel, IRQ 16
        Memory at 81400000 (64-bit, non-prefetchable) [size=32K]
        Memory at 81000000 (64-bit, non-prefetchable) [size=4M]
        Capabilities: [48] Power Management version 3
        Capabilities: [58] MSI: Enable- Count=1/16 Maskable- 64bit+
        Capabilities: [68] Vendor Specific Information: Len=44 <?>
        Capabilities: [ac] Express Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [13c] Device Serial Number a2-ed-98-ff-ff-34-f0-18
        Capabilities: [150] Power Budgeting <?>
        Capabilities: [160] Virtual Channel
        Capabilities: [1b0] Latency Tolerance Reporting
        Capabilities: [220] Resizable BAR <?>
        Capabilities: [240] L1 PM Substates
        Kernel modules: brcmfmac

brcmf_pcie_download_fw_nvram: Invalid shared RAM address 0x00081001

dmesg -T |grep brcmf
[Sat Jan 11 15:51:28 2020] Command line: BOOT_IMAGE=(hd1,gpt2)/vmlinuz-5.4.8-200.mbp.fc31.x86_64 root=UUID=eb984862-4b96-4949-aeef-d387c25d8a7f ro rhgb quiet efi=noruntime pcie_ports=compat modprobe.blacklist=thunderbolt brcmfmac.debug=2097150
[Sat Jan 11 15:51:28 2020] Kernel command line: BOOT_IMAGE=(hd1,gpt2)/vmlinuz-5.4.8-200.mbp.fc31.x86_64 root=UUID=eb984862-4b96-4949-aeef-d387c25d8a7f ro rhgb quiet efi=noruntime pcie_ports=compat modprobe.blacklist=thunderbolt brcmfmac.debug=2097150
[Sat Jan 11 15:51:31 2020] usbcore: registered new interface driver brcmfmac
[Sat Jan 11 15:51:31 2020] brcmfmac 0000:03:00.0: enabling device (0000 -> 0002)
[Sat Jan 11 15:51:31 2020] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4364-pcie for chip BCM4364/3
[Sat Jan 11 15:51:32 2020] brcmfmac 0000:03:00.0: brcmf_pcie_download_fw_nvram: Invalid shared RAM address 0x00081001
[Sat Jan 11 15:51:32 2020] Modules linked in: intel_rapl_msr intel_rapl_common x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul snd_hda_codec_hdmi ghash_clmulni_intel brcmfmac iTCO_wdt mei_hdcp iTCO_vendor_support hci_uart btqca applesmc intel_cstate input_polldev brcmutil snd_hda_intel ses enclosure btrtl snd_intel_dspcfg btbcm snd_hda_codec scsi_transport_sas btintel intel_uncore cfg80211 bluetooth intel_rapl_perf snd_hda_core mei_me snd_hwdep mmc_core pcspkr ecdh_generic snd_pcm idma64 i2c_i801 mei rfkill sbs ecc joydev apple_gmux sbshc acpi_tad intel_pch_thermal apple_bl ip_tables amdgpu amd_iommu_v2 gpu_sched i2c_algo_bit ttm drm_kms_helper drm nvme crc32c_intel nvme_core video rndis_host uas cdc_ether usb_storage usbnet mii pkcs8_key_parser fuse snd_seq snd_timer snd_seq_device snd soundcore bcm5974 hid_apple apple_ib_als(OE) apple_ib_tb(OE) apple_ibridge(OE) industrialio_triggered_buffer kfifo_buf industrialio
[Sat Jan 11 15:51:32 2020]  brcmf_fweh_detach+0x15/0x60 [brcmfmac]
[Sat Jan 11 15:51:32 2020]  brcmf_detach+0x5d/0xe0 [brcmfmac]
[Sat Jan 11 15:51:32 2020]  brcmf_pcie_remove+0x58/0xf0 [brcmfmac]
[Sat Jan 11 15:51:32 2020]  brcmf_pcie_setup+0x38/0xb80 [brcmfmac]
[Sat Jan 11 15:51:32 2020]  brcmf_fw_request_done+0x65/0xe0 [brcmfmac]
[Sat Jan 11 15:51:32 2020] WARNING: CPU: 4 PID: 193 at drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c:309 brcmf_fweh_detach+0x5b/0x60 [brcmfmac]
[Sat Jan 11 15:51:32 2020] Modules linked in: intel_rapl_msr intel_rapl_common x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul snd_hda_codec_hdmi ghash_clmulni_intel brcmfmac iTCO_wdt mei_hdcp iTCO_vendor_support hci_uart btqca applesmc intel_cstate input_polldev brcmutil snd_hda_intel ses enclosure btrtl snd_intel_dspcfg btbcm snd_hda_codec scsi_transport_sas btintel intel_uncore cfg80211 bluetooth intel_rapl_perf snd_hda_core mei_me snd_hwdep mmc_core pcspkr ecdh_generic snd_pcm idma64 i2c_i801 mei rfkill sbs ecc joydev apple_gmux sbshc acpi_tad intel_pch_thermal apple_bl ip_tables amdgpu amd_iommu_v2 gpu_sched i2c_algo_bit ttm drm_kms_helper drm nvme crc32c_intel nvme_core video rndis_host uas cdc_ether usb_storage usbnet mii pkcs8_key_parser fuse snd_seq snd_timer snd_seq_device snd soundcore bcm5974 hid_apple apple_ib_als(OE) apple_ib_tb(OE) apple_ibridge(OE) industrialio_triggered_buffer kfifo_buf industrialio
[Sat Jan 11 15:51:32 2020] RIP: 0010:brcmf_fweh_detach+0x5b/0x60 [brcmfmac]
[Sat Jan 11 15:51:32 2020]  brcmf_detach+0x5d/0xe0 [brcmfmac]
[Sat Jan 11 15:51:32 2020]  brcmf_pcie_remove+0x58/0xf0 [brcmfmac]
[Sat Jan 11 15:51:32 2020]  brcmf_pcie_setup+0x38/0xb80 [brcmfmac]
[Sat Jan 11 15:51:32 2020]  brcmf_fw_request_done+0x65/0xe0 [brcmfmac]

Any idea ?

ktb92677 commented 4 years ago

@mikeeq okay so I did manage to get the latest fedora ISO you posted to boot. I installed it fully. It included the patch from @ppaulweber.

Unfortunately... I am STILL getting the "FW failed to initialize" error.

What else could I look for?

ktb92677 commented 4 years ago

So I was looking at @jhohisel comment (who so far is the only person I can find with a MacBookAir8,2 who has gotten wifi to work) https://github.com/Dunedan/mbp-2016-linux/issues/112#issuecomment-522253748 and he made a mention of removing the txt file and seeing the difference in dmesg. Well I tried removing the .txt file and dmesg did indeed reflect that that file was missing! Don't know if that's good news at all.

I still have a feeling that the wifi patch that @mikeeq is using isn't quite up to date with @ppaulweber kernel patch.

ktb92677 commented 4 years ago

Hey @mikeeq just wanted to confirm that this is the wifi patch that you are currently using in the latest release of mbp-fedora (v5.4.10-f31): https://github.com/mikeeq/mbp-fedora-kernel/blob/v5.4-f31/patches/wifi.patch

If that is the case I have hyper analyzed both @mikeeq and @ppaulweber wifi kernel patches. Here they both are: https://github.com/mikeeq/mbp-fedora-kernel/blob/v5.4-f31/patches/wifi.patch, https://github.com/ppaulweber/linux-mba/blob/master/patch-linux-brcmfmac.diff

The only difference I can find between them is as follows:

-
 /* brcmsmac IDs */
 #define BCM4313_D11N2G_ID  0x4727  /* 4313 802.11n 2.4G device */
 #define BCM43224_D11N_ID   0x4353  /* 43224 802.11n dualband device */

This exist's in @ppaulweber kernel patch but not in @mikeeq . @ppaulweber is this required for wifi to work correctly?

ktb92677 commented 4 years ago

@ppaulweber I am so sorry about all of these comments. But out of curiosity is there any chance you could try out @mikeeq mpb-fedora on your mba8,1. mba8,1 should be fairly similar to the mba8,2 that I have. Here's a link to the ISO: https://github.com/mikeeq/mbp-fedora/releases.

aunali1 commented 4 years ago

@JamesCCN I had the same MacBookPro15,1 a few months ago, worked flawlessly for me. It might be possible that the FW files you are using are faulty. I have a mirror of wifi firmware available here: https://packages.aunali1.com/apple/wifi-fw/18G2022.

ktkd commented 4 years ago

@JamesCCN I had the same MacBookPro15,1 a few months ago, worked flawlessly for me. It might be possible that the FW files you are using are faulty. I have a mirror of wifi firmware available here: https://packages.aunali1.com/apple/wifi-fw/18G2022.

hah! with your firmware brcmfmac module works correctly.

files from my macOS have this checksum: 0f813c1e7d68d8b0509daec39693fd43 P-maui_M-HRPN_V-u__m-7.5.txt 4d1eec3feaf7a7eced9cff4f5a25d53c maui.trx c8e94fd6601cc001c61eb3c7d6958547 maui-X3.clmb

files from your archive: eb89962f449525b4962b7f35bd62df2f P-maui_M-HRPN_V-u__m-7.5.txt fc2ddd8ee51f6a3b7840d3849888d77f maui-X3.clmb de3b661a6159d35bdb80a8119aec7edd maui.trx

so, it looks like fresh firmware from macos catalina are not working with my configuration.

ktb92677 commented 4 years ago

Okay Wifi is working!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

After I saw @ktkd post above I decided to try out @aunali1 driver files. Just like with @ktkd my firmware files taken right from a fresh install of macos catalina had different md5 hash then the files hosted on @aunali1 server. So after installing it and rebooting, boom, wifi pops up.

Thank you all for dealing with all my posts. I am curious though why my driver files didn't work...

JamesCCN commented 4 years ago

@JamesCCN I had the same MacBookPro15,1 a few months ago, worked flawlessly for me. It might be possible that the FW files you are using are faulty. I have a mirror of wifi firmware available here: https://packages.aunali1.com/apple/wifi-fw/18G2022.

It works !!!!!!!!
After 2 weeks trying all this WiFi issues. As @ktkd said, the firmware which copy from macOS is not same as @aunali1 offer. Now I'm curious about how to extract the firmware file from macOS . It seems not only "copy" to the other device where Fedora can read and copy to the firmware directory.

Thank you for all this great works.

Xinkai commented 4 years ago

The firmware extracted by @aunali1 solves for me as well. Thanks a lot.

Xinkai commented 4 years ago

Well, the firmware checksums will change the moment you do an OSX update. So it's hard to say it's caused by corruption. My guess is an incompatibility issue. What you may find useful is: I tried the firmware from 10.15.1 and 10.15.2, both of them do not work. (Doing the upgrade I noticed the checksums changed). The machine came with 10.15.1 so I didn't try versions earlier than that. I am curious that from which version of OSX did you extract the working firmware?

aunali1 commented 4 years ago

@ktkd, @ktb92677, @JamesCCN, @Xinkai Nice to see that wifi is working. The firmware is from an up-to-date macOS Mojave install. It seems that macOS Catalina has some key differences in the way it loads firmware, resulting in the firmware init failure.

zhewang95 commented 4 years ago

It also worked for me!!

geovie commented 4 years ago

Worked for me too! @mikeeq Maybe you could add the link to the firmware files in the Readme, thanks

atodorov commented 4 years ago

2019 MacBookPro15,4 here with BCM4377 wifi. I basically did what issue https://github.com/mikeeq/mbp-fedora/issues/12 says and had no luck.

https://github.com/Dunedan/mbp-2016-linux/issues/112 says firmware from macOS Catalina is known to fail to initialize with bcrmfmac so I've got a few questions.

FYI I've been trying both this Fedora spin and the newer Rawhide with kernel 5.5.

1) Is the naming of firmware files from #12 correct? If yes, should we take steps to distribute them with linux-firmware.rpm ?

2) Is the patch mentioned at https://github.com/mikeeq/mbp-fedora-kernel/blob/v5.4-f31/patches/wifi.patch#L21 already available in Rawhide/upstream kernel or not, so I can keep using only the kernel which has the most chances of working

3) Did anyone have success with using firmware from macOS Catalina or should I look into older macOS versions ?

If anyone is willing to look at this, my hardware info is here: https://github.com/Dunedan/mbp-2016-linux/tree/master/MacBookPro15%2C4

berrfred commented 4 years ago

Greetings for your excellent job, finally able to use the office MBP with the same Linux environment I am used to since years on any other HW. Everything I need works pretty well.

I just wanted to report some minor issues I had with WiFi... using Macbook Pro 15,2 i5 BCM4364/3 (P-maui-X3_M-HRPN_V-u__m-7.5.txt)

EDITED: Tried to create manually with iwctl the hidden profiles but that does not solve... reverted back to wpa_supplicant until the hidden network bug is solved... anyway this seems to be a NetworkManager / iwd issue since it does not work either on my other Lenovo T480 laptop.

FabriceColin commented 4 years ago

I am on the new MBP 16,1 and ioreg reports the firmware is the "bali" flavour (C-4364s-B3/bali.trx C-4364s-B3/bali-X3.clmb C-4364s-B3/P-bali-X3_M-HRPN_V-um-7.7.txt C-4364__s-B3/bali-X3.txcb). I have copied these files to the right location as per the instructions (https://github.com/mikeeq/mbp-fedora/issues/15#issuecomment-585880413), have no Wifi still. These files don't exist on @aunali1's site. Has anyone got Wifi working with "bali"?

cellsheet commented 4 years ago

I also have the new MBP 16,1 and decided to investigate after trying to no avail. Here is my ioreg report:

| | | | | "RequestedFiles" = ({"Firmware"="C-4364__s-B3/bali.trx","TxCap"="C-4364__s-B3/bali-X0.txcb","Regulatory"="C-4364__s-B3/bali-X0.clmb","NVRAM"="C-4364__s-B3/P-bali-X0_M-HRPN_V-m__m-7.9.txt"}) | | | | | "images" = {"C-4364__s-B3/P-bali-X0_M-HRPN_V-m__m-7.9.txt"={"imagetype"="NVRAM","required"=Yes,"imagename"="C-4364__s-B3/P-bali-X0_M-HRPN_V-m__m-7.9.txt"},"C-4364__s-B3/bali-X0.txcb"={"imagetype"="TxCap","required"=No,"imagename"="C-4364__s-B3/bali-X0.txcb"},"C-4364__s-B3/bali.trx"={"imagetype"="Firmware","required"=Yes,"imagename"="C-4364__s-B3/bali.trx"},"C-4364__s-B3/bali-X0.clmb"={"imagetype"="Regulatory","required"=Yes,"imagename"="C-4364__s-B3/bali-X0.clmb"}}

rieske commented 4 years ago

I am on MBP 16,1 as well - no luck with wifi so far - same dmesg output brcmf_pcie_download_fw_nvram: FW failed to initialize when trying to use bali firmware taken from Mac OS installation.

$ ioreg -l | grep C-4364
    | |   |       | |   "RequestedFiles" = ({"Firmware"="C-4364__s-B3/bali.trx","TxCap"="C-4364__s-B3/bali-X3.txcb","Regulatory"="C-4364__s-B3/bali-X3.clmb","NVRAM"="C-4364__s-B3/P-bali-X3_M-HRPN_V-m__m-7.9.txt"})
    | |   |       | |       "images" = {"C-4364__s-B3/P-bali-X3_M-HRPN_V-m__m-7.9.txt"={"imagetype"="NVRAM","required"=Yes,"imagename"="C-4364__s-B3/P-bali-X3_M-HRPN_V-m__m-7.9.txt"},"C-4364__s-B3/bali-X3.txcb"={"imagetype"="TxCap","required"=No,"imagename"="C-4364__s-B3/bali-X3.txcb"},"C-4364__s-B3/bali.trx"={"imagetype"="Firmware","required"=Yes,"imagename"="C-4364__s-B3/bali.trx"},"C-4364__s-B3/bali-X3.clmb"={"imagetype"="Regulatory","required"=Yes,"imagename"="C-4364__s-B3/bali-X3.clmb"}}
FabriceColin commented 4 years ago

Any news about bali support? I can help test any possible fix.

mikeeq commented 4 years ago

@FabriceColin you need to check dmesg for wifi module errors - dmesg | grep brcmfmac.

@rieske if you see brcmf_pcie_download_fw_nvram: FW failed to initialize error in dmesg, most likely your rambase address isn't correctly set. You need to find it on trial and error basis. You can manually override it via providing rambase_addr= parameter to brcmfmac module

modprobe -r brcmfmac; modprobe brcmfmac rambase_addr=0x160000

It could be one of these values:

0x160000, 0x180000, 0x198000, 0x200000

If the problem still persists, you need to check other FW files, i.e. from @aunali1 link - https://packages.aunali1.com/apple/wifi-fw/18G2022

If anyone has problems with connecting to WPA2 networks on startup - failing to find networks, etc. please execute systemctl enable iwd.service as root, reboot your mac and update fedora kernel - https://github.com/mikeeq/mbp-fedora-kernel#how-to-update-kernel-mbp

kevineinarsson commented 4 years ago

@mikeeq I'll chime in with @FabriceColin that I can help test things out... wifi is the final blocker for me, I even got built-in audio working with some remapping of channels in ALSA...

I used a shell script that modprobed with rambase_addr from 0x100000 to 0x200000 with steps of 1000 without success. I can share the script, perhaps I made some mistakes. It would sometimes give other error messages than FW failed to initialize, but when I tried those addresses again it would give me brcmf_pcie_download_fw_nvram: FW failed to initialize. Super confusing.

The thing is the chipset is detected as 4364/4 and not 4364/3 as the older ones. Therefore it seems implausible that firmware for other models would work. From what I understand there is nothing pre-catalina for this chipset.

I even tried binwalk & strings to see if I could extract any useful information from the binaries, but of course not. Any suggestions are welcome :)

mikeeq commented 4 years ago

I even got built-in audio working with some remapping of channels in ALSA

Could you please share more details? And no I don't have any other ideas about fixing your problem with wifi, unfortunately. Could you please share some logs though maybe some other people will be able to help ;)