Jump to content
headkaze

BrcmPatchRAM2 for 10.15 Catalina (Broadcom bluetooth firmware upload)

64 posts in this topic

Recommended Posts

Posted (edited)

I'm just going to run through some of the changes I made to RehabMan's BrcmPatchRAM project for it to function in macOS Catalina. I don't really have time to go any further with it but hopefully my research and testing can help get an official working version out.

 

I'm using BrcmFirmwareData.kext, BrcmPatchRAM2.kext and BrcmBluetoothInjector.kext and place them inside EFI/CLOVER/kexts/Other

 

BrcmBluetoothInjector.kext was not required on previous macOS releases but is on Catalina because of the following missing IOCatalogue methods:

 

kxld[com.no-one.BrcmPatchRAM2]: The following symbols are unresolved for this kext:
kxld[com.no-one.BrcmPatchRAM2]: IOCatalogue::addDrivers(OSArray*, bool)
kxld[com.no-one.BrcmPatchRAM2]: IOCatalogue::removeDrivers(OSDictionary*, bool)
kxld[com.no-one.BrcmPatchRAM2]: IOCatalogue::startMatching(OSDictionary*)

 

Since these methods are no longer available they must be removed from the project. The easiest way to do this is to comment out publishPersonality() and publishResourcePersonality() methods from BrcmPatchRAM.cpp / BrcmPatchRAM.h. Also remove all calls to these methods in BrcmPatchRAM.cpp.

 

The next issue is dealing with the 0xe00002c2 error when reading and writing to the BRCM hardware. Starting with BrcmPatchRAM::continuousRead() and BrcmPatchRAM::readCompletion() we need to add an kIODirectionIn option.

 

ie.

mReadBuffer = IOBufferMemoryDescriptor::inTaskWithOptions(kernel_task, kIODirectionIn, 0x200);
IOReturn result = mReadBuffer->prepare(kIODirectionIn);
IOReturn result = me->mReadBuffer->complete(kIODirectionIn);

Next in BrcmPatchRAM::bulkWrite we need to add kIODirectionOut options.

if (IOMemoryDescriptor* buffer = IOMemoryDescriptor::withAddress((void*)data, length, kIODirectionOut))
if ((result = buffer->prepare(kIODirectionOut)) == kIOReturnSuccess)
if ((result = buffer->complete(kIODirectionOut)) != kIOReturnSuccess)

 

Now that we don't have IOCatalogue::addDrivers, IOCatalogue::removeDrivers and IOCatalogue::startMatching methods to switch from using the uploader driver to native macOS driver we have to use BrcmBluetoothInjector.kext instead.

 

So my Bluetooth device is a BCM20702A0 with VendorID 0x0A5C and ProductID 0x216F (Dell DW1560 4352+20702 M.2) located in internal USB port HS14. So I'll use it as an example for the following modifications.

 

In BrcmPatchRAM2-Info.plist we need the following entry. Note the addition of the IOProbeScore. When the kext is loaded it will call BrcmPatchRAM::probe which will update the firmware and return NULL and then the BrcmBluetoothInjector.kext should load instead.

        <key>0a5c_216f</key>
        <dict>
            <key>CFBundleIdentifier</key>
            <string>com.no-one.$(PRODUCT_NAME:rfc1034identifier)</string>
            <key>DisplayName</key>
            <string>DW1560 Bluetooth 4.0 LE</string>
            <key>FirmwareKey</key>
            <string>BCM20702A1_001.002.014.1443.1572_v5668</string>
            <key>IOClass</key>
            <string>BrcmPatchRAM2</string>
            <key>IOMatchCategory</key>
            <string>BrcmPatchRAM2</string>
            <key>IOProviderClass</key>
            <string>IOUSBHostDevice</string>
            <key>IOProbeScore</key>
            <integer>4000</integer>
            <key>idProduct</key>
            <integer>8559</integer>
            <key>idVendor</key>
            <integer>2652</integer>
        </dict>

 

In BrcmBluetoothInjector-Info.plist we need the following entry. Note again the addition of the IOProbeScore. We want the BrcmBluetoothInjector.kext to load the macOS kext after the firmware has been uploaded to the hardware. Since BrcmBluetoothInjector.kext has not been updated in a long time you may need to add your hardware manually to the plist. Note that your Bluetooth device VendorID / ProductID is not the same as your WiFi hardware and will not show up in your PCI list. You will need to look at the USB ports to get this info.

        <key>0a5c_216f</key>
        <dict>
            <key>CFBundleIdentifier</key>
            <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string>
            <key>IOClass</key>
            <string>BroadcomBluetoothHostControllerUSBTransport</string>
            <key>IOProviderClass</key>
            <string>IOUSBHostDevice</string>
            <key>IOProbeScore</key>
            <integer>3000</integer>
            <key>idProduct</key>
            <integer>8559</integer>
            <key>idVendor</key>
            <integer>2652</integer>
        </dict>

 

You will know the firmware is uploaded when its version in About This Mac->System Report...->Bluetooth shows something like:

 Firmware Version:    v14 c5668

If it shows 4096 then the upload has failed.

 

I will attach my compiled versions for people to help test. I'm not 100% sure if this is method is going to work so I'd appreciate feedback on it.

BCM20702A0_01.png

BCM20702A0_02.png

 

Downloads (My Github Fork)

Edited by headkaze

Share this post


Link to post
Share on other sites
Advertisement
Posted (edited)

Worked fine for my HP 250 bcm943602baed. Thanks!

 

Edited by parma60
Worked fine for my HP 250 bcm943602baed. Thanks!

Share this post


Link to post
Share on other sites

Worked for my Lenovo-branded BCM94352Z. Thanks!64814309_2516393105038096_2998678150965100544_n.jpg.7f6c60aa09b3aac41e535a0acbe921cd.jpg

Share this post


Link to post
Share on other sites
1 hour ago, headkaze said:

What is the PID/VID of your hardware?

 

hello

 

3404_13d3

 

thanks

Share this post


Link to post
Share on other sites
Posted (edited)

It works very well, thanks for the great work you do and help us to the least we know how to continue to enjoy this great operating system.

Successfully modified BrcmBluetoothInjector-Info.plist and BrcmPatchRAM2-Info.plist for BCM943602BAED


 

 

 

1442205073_Capturadepantalla2019-06-20alas22_37_49.thumb.png.6a24be090fe139b9de49affcc5f50941.png

Edited by thetwoangels

Share this post


Link to post
Share on other sites

i'm sorry,but it just doesn't work properly on my laptop with 1820a(BL Id is 0a5c_6412),when I patched the kexts and reboot after rebuild kextcache,it got stucked with the picture below.Anyone can help me out?Glad for any advice,thanks!

Screenshot_20190620-114713.png

IMG_20190620_115257.jpg

Share this post


Link to post
Share on other sites

the BT module does not want to let the specified firmware load into it. try loading another OS and confirm the hardware works properly.

Share this post


Link to post
Share on other sites
On 6/20/2019 at 2:53 AM, mengls said:

I patched the kexts and reboot after rebuild kextcache

This method does not involve patching any kexts and you do not need to rebuild kextcache as you should be copying the kexts to EFI/CLOVER/kexts/Other.

Share this post


Link to post
Share on other sites

Hello @headkaze thanks for your work! I have an issue with my DW-1560 0x216f BCM20702A0. Basically this morning I booted up Catalina on a cold boot and the system took awhile to boot and when it did, I had no BT or WiFi. I had the latest Clover applied with your kexts applied to Clover/kexts/Other. I went back to just using the BrcmBluetoothInjector.kext from the one I found on the preRelease forum which didn't have this issue, but on a cold boot, I have to boot into Windows to get BT to detect any devices so it is a tradeoff.

 

Please let me know if you need anything else to help.

Share this post


Link to post
Share on other sites
Posted (edited)
1 hour ago, Andrw0380 said:

Please let me know if you need anything else to help.

I'm not the author of this driver (darkvoid and RehabMan are). All I did was make some modifications so they will compile and run on Catalina.

 

If these drivers worked on Mojave for you they will most likely work on Catalina. Other than adding any missing VID/PID's I am not likely to be much help.

 

The only other suggestion I can make is to compile the BrcmFirmwareRepo.kext and install them to /Library/Extensions. Apparently this is necessary for some people. Read the instructions on Github for more information.

Edited by headkaze

Share this post


Link to post
Share on other sites
17 hours ago, headkaze said:

I'm not the author of this driver (darkvoid and RehabMan are). All I did was make some modifications so they will compile and run on Catalina.

 

If these drivers worked on Mojave for you they will most likely work on Catalina. Other than adding any missing VID/PID's I am not likely to be much help.

 

The only other suggestion I can make is to compile the BrcmFirmwareRepo.kext and install them to /Library/Extensions. Apparently this is necessary for some people. Read the instructions on Github for more information.

Thanks for the suggestion. I realized you were not the author I was just mentioning as didn't have the issue with Rehabman's repo on Mojave. Also wanted to ask you if this commit is added to your source? https://github.com/RehabMan/OS-X-BrcmPatchRAM/pull/68 as this helped a few people when awake from sleep on Mojave including myself. Thanks again for your work on this and other projects!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×