mbox series

[0/2] Apple T2 platform support

Message ID 20230214080034.3828-1-marcan@marcan.st
Headers show
Series Apple T2 platform support | expand

Message

Hector Martin Feb. 14, 2023, 8 a.m. UTC
Hi all,

This short series adds the missing bits to support Apple T2 platforms.

There are two quirks: these devices have firmware that requires the
host to provide a blob of randomness as a seed (presumably because the
chipsets lack a proper RNG), and the module/antenna information that
is used for Apple firmware selection and comes from the Device Tree
on ARM64 systems (already upstream) needs to come from ACPI on these
instead.

Changes since the megaseries from a ~year ago: made the ACPI code bail
if there is no module-instance, so we don't try to get the antenna
info at all in that case (as suggested by Arend). Made the randomness
conditional on an Apple OTP being present, since it's not known to be
needed on non-Apple firmware.

Hector Martin (2):
  brcmfmac: acpi: Add support for fetching Apple ACPI properties
  brcmfmac: pcie: Provide a buffer of random bytes to the device

 .../broadcom/brcm80211/brcmfmac/Makefile      |  2 +
 .../broadcom/brcm80211/brcmfmac/acpi.c        | 51 +++++++++++++++++++
 .../broadcom/brcm80211/brcmfmac/common.c      |  1 +
 .../broadcom/brcm80211/brcmfmac/common.h      |  9 ++++
 .../broadcom/brcm80211/brcmfmac/pcie.c        | 32 ++++++++++++
 5 files changed, 95 insertions(+)
 create mode 100644 drivers/net/wireless/broadcom/brcm80211/brcmfmac/acpi.c

Comments

Aditya Garg Feb. 23, 2023, 3:01 p.m. UTC | #1
Hi Hector

I’ve applied the following patchset (arranged in chronological order) to linux 6.2,
and wifi seems to have broken on MacBookPro16,1 (brcmfmac4364b3)

https://lore.kernel.org/asahi/20230212063813.27622-1-marcan@marcan.st/T/#t (BCM4355/4364/4377 support & identification fixes)

https://lore.kernel.org/asahi/20230214080034.3828-1-marcan@marcan.st/T/#t (Apple T2 platform support)

https://lore.kernel.org/asahi/20230214091651.10178-1-marcan@marcan.st/T/#t (BCM4387 / Apple M1 platform support)

https://lore.kernel.org/asahi/b4489e24-e226-4f99-1322-cab6c1269f09@broadcom.com/T/#t (brcmfmac: cfg80211: Use WSEC to set SAE password)


The logs show:

Feb 23 20:08:57 MacBook kernel: usbcore: registered new interface driver brcmfmac
Feb 23 20:08:57 MacBook kernel: brcmfmac 0000:05:00.0: enabling device (0000 -> 0002)
Feb 23 20:08:57 MacBook kernel: brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4364b3-pcie for chip BCM4364/4
Feb 23 20:08:57 MacBook kernel: brcmfmac 0000:05:00.0: Direct firmware load for brcm/brcmfmac4364b3-pcie.Apple Inc.-MacBookPro16,1.bin failed with error -2
Feb 23 20:08:57 MacBook kernel: brcmfmac 0000:05:00.0: Direct firmware load for brcm/brcmfmac4364b3-pcie.bin failed with error -2
Feb 23 20:08:57 MacBook kernel: brcmfmac 0000:05:00.0: brcmf_pcie_setup: Dongle setup failed

I also tested the patchiest in the following link, and wifi mostly worked there (occasionally it complained about some pic error, I’ll save the logs next time I encounter that) :

https://github.com/t2linux/linux-t2-patches/blob/main/8001-asahilinux-wifi-patchset.patch

Thanks
Aditya

> On 14-Feb-2023, at 1:30 PM, Hector Martin <marcan@marcan.st> wrote:
> 
> Hi all,
> 
> This short series adds the missing bits to support Apple T2 platforms.
> 
> There are two quirks: these devices have firmware that requires the
> host to provide a blob of randomness as a seed (presumably because the
> chipsets lack a proper RNG), and the module/antenna information that
> is used for Apple firmware selection and comes from the Device Tree
> on ARM64 systems (already upstream) needs to come from ACPI on these
> instead.
> 
> Changes since the megaseries from a ~year ago: made the ACPI code bail
> if there is no module-instance, so we don't try to get the antenna
> info at all in that case (as suggested by Arend). Made the randomness
> conditional on an Apple OTP being present, since it's not known to be
> needed on non-Apple firmware.
> 
> Hector Martin (2):
>  brcmfmac: acpi: Add support for fetching Apple ACPI properties
>  brcmfmac: pcie: Provide a buffer of random bytes to the device
> 
> .../broadcom/brcm80211/brcmfmac/Makefile      |  2 +
> .../broadcom/brcm80211/brcmfmac/acpi.c        | 51 +++++++++++++++++++
> .../broadcom/brcm80211/brcmfmac/common.c      |  1 +
> .../broadcom/brcm80211/brcmfmac/common.h      |  9 ++++
> .../broadcom/brcm80211/brcmfmac/pcie.c        | 32 ++++++++++++
> 5 files changed, 95 insertions(+)
> create mode 100644 drivers/net/wireless/broadcom/brcm80211/brcmfmac/acpi.c
> 
> -- 
> 2.35.1
> 
>
Aditya Garg Feb. 23, 2023, 3:04 p.m. UTC | #2
> On 23-Feb-2023, at 8:31 PM, Aditya Garg <gargaditya08@live.com> wrote:
> 
> Hi Hector
> 
> I’ve applied the following patchset (arranged in chronological order) to linux 6.2,
> and wifi seems to have broken on MacBookPro16,1 (brcmfmac4364b3)
> 
> https://lore.kernel.org/asahi/20230212063813.27622-1-marcan@marcan.st/T/#t (BCM4355/4364/4377 support & identification fixes)
> 
> https://lore.kernel.org/asahi/20230214080034.3828-1-marcan@marcan.st/T/#t (Apple T2 platform support)
> 
> https://lore.kernel.org/asahi/20230214091651.10178-1-marcan@marcan.st/T/#t (BCM4387 / Apple M1 platform support)
> 
> https://lore.kernel.org/asahi/b4489e24-e226-4f99-1322-cab6c1269f09@broadcom.com/T/#t (brcmfmac: cfg80211: Use WSEC to set SAE password)
> 
> 
> The logs show:
> 
> Feb 23 20:08:57 MacBook kernel: usbcore: registered new interface driver brcmfmac
> Feb 23 20:08:57 MacBook kernel: brcmfmac 0000:05:00.0: enabling device (0000 -> 0002)
> Feb 23 20:08:57 MacBook kernel: brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4364b3-pcie for chip BCM4364/4
> Feb 23 20:08:57 MacBook kernel: brcmfmac 0000:05:00.0: Direct firmware load for brcm/brcmfmac4364b3-pcie.Apple Inc.-MacBookPro16,1.bin failed with error -2
> Feb 23 20:08:57 MacBook kernel: brcmfmac 0000:05:00.0: Direct firmware load for brcm/brcmfmac4364b3-pcie.bin failed with error -2
> Feb 23 20:08:57 MacBook kernel: brcmfmac 0000:05:00.0: brcmf_pcie_setup: Dongle setup failed
> 
> I also tested the patchiest in the following link, and wifi mostly worked there (occasionally it complained about some pic error, I’ll save the logs next time I encounter that) :
> 

Sorry for the typos here (thanks to autocorrect)

It says

I also tested the *patchset* in the following link, and wifi mostly worked there (occasionally it complained about some *pci* error, I’ll save the logs next time I encounter that) :
> 
> https://github.com/t2linux/linux-t2-patches/blob/main/8001-asahilinux-wifi-patchset.patch
> 
> Thanks
> Aditya
> 
>> On 14-Feb-2023, at 1:30 PM, Hector Martin <marcan@marcan.st> wrote:
>> 
>> Hi all,
>> 
>> This short series adds the missing bits to support Apple T2 platforms.
>> 
>> There are two quirks: these devices have firmware that requires the
>> host to provide a blob of randomness as a seed (presumably because the
>> chipsets lack a proper RNG), and the module/antenna information that
>> is used for Apple firmware selection and comes from the Device Tree
>> on ARM64 systems (already upstream) needs to come from ACPI on these
>> instead.
>> 
>> Changes since the megaseries from a ~year ago: made the ACPI code bail
>> if there is no module-instance, so we don't try to get the antenna
>> info at all in that case (as suggested by Arend). Made the randomness
>> conditional on an Apple OTP being present, since it's not known to be
>> needed on non-Apple firmware.
>> 
>> Hector Martin (2):
>> brcmfmac: acpi: Add support for fetching Apple ACPI properties
>> brcmfmac: pcie: Provide a buffer of random bytes to the device
>> 
>> .../broadcom/brcm80211/brcmfmac/Makefile      |  2 +
>> .../broadcom/brcm80211/brcmfmac/acpi.c        | 51 +++++++++++++++++++
>> .../broadcom/brcm80211/brcmfmac/common.c      |  1 +
>> .../broadcom/brcm80211/brcmfmac/common.h      |  9 ++++
>> .../broadcom/brcm80211/brcmfmac/pcie.c        | 32 ++++++++++++
>> 5 files changed, 95 insertions(+)
>> create mode 100644 drivers/net/wireless/broadcom/brcm80211/brcmfmac/acpi.c
>> 
>> -- 
>> 2.35.1
>> 
>> 
>
Kalle Valo Feb. 24, 2023, 1:11 p.m. UTC | #3
Aditya Garg <gargaditya08@live.com> writes:

>  On 23-Feb-2023, at 8:31 PM, Aditya Garg <gargaditya08@live.com> wrote:
>
>  Hi Hector
>
>  I’ve applied the following patchset (arranged in chronological order) to linux 6.2,
>  and wifi seems to have broken on MacBookPro16,1 (brcmfmac4364b3)
>
>  https://lore.kernel.org/asahi/20230212063813.27622-1-marcan@marcan.st/T/#t
>  (BCM4355/4364/4377 support & identification fixes)
>
>  https://lore.kernel.org/asahi/20230214080034.3828-1-marcan@marcan.st/T/#t (Apple T2
>  platform support)
>
>  https://lore.kernel.org/asahi/20230214091651.10178-1-marcan@marcan.st/T/#t (BCM4387
>  / Apple M1 platform support)
>
>  https://lore.kernel.org/asahi/b4489e24-e226-4f99-1322-cab6c1269f09@broadcom.com/T/#t
>  (brcmfmac: cfg80211: Use WSEC to set SAE password)
>
>  The logs show:
>
>  Feb 23 20:08:57 MacBook kernel: usbcore: registered new interface driver brcmfmac
>  Feb 23 20:08:57 MacBook kernel: brcmfmac 0000:05:00.0: enabling device (0000 -> 0002)
>  Feb 23 20:08:57 MacBook kernel: brcmfmac: brcmf_fw_alloc_request: using
>  brcm/brcmfmac4364b3-pcie for chip BCM4364/4
>  Feb 23 20:08:57 MacBook kernel: brcmfmac 0000:05:00.0: Direct firmware load for
>  brcm/brcmfmac4364b3-pcie.Apple Inc.-MacBookPro16,1.bin failed with error -2
>  Feb 23 20:08:57 MacBook kernel: brcmfmac 0000:05:00.0: Direct firmware load for
>  brcm/brcmfmac4364b3-pcie.bin failed with error -2
>  Feb 23 20:08:57 MacBook kernel: brcmfmac 0000:05:00.0: brcmf_pcie_setup: Dongle setup
>  failed
>
>  I also tested the patchiest in the following link, and wifi mostly worked there (occasionally it
>  complained about some pic error, I’ll save the logs next time I encounter that) :
>
>  https://github.com/t2linux/linux-t2-patches/blob/main/8001-asahilinux-wifi-patchset.patch
>
>  Thanks
>  Aditya
>
> I just noticed that the patch to ACPI was missing. Adding that fixed the issue.
>
> https://github.com/t2linux/linux-t2-patches/blob/main/8005-ACPI-property-Support-strings-in-Apple-_DSM-props.patch

Please don't use HTML, our lists drop those. I'll reply in text/plain so
that is info is archived.
Aditya Garg Feb. 24, 2023, 1:22 p.m. UTC | #4
> On 24-Feb-2023, at 6:42 PM, Kalle Valo <kvalo@kernel.org> wrote:
> 
> Aditya Garg <gargaditya08@live.com> writes:
> 
>> On 23-Feb-2023, at 8:31 PM, Aditya Garg <gargaditya08@live.com> wrote:
>> 
>> Hi Hector
>> 
>> I’ve applied the following patchset (arranged in chronological order) to linux 6.2,
>> and wifi seems to have broken on MacBookPro16,1 (brcmfmac4364b3)
>> 
>> https://lore.kernel.org/asahi/20230212063813.27622-1-marcan@marcan.st/T/#t
>> (BCM4355/4364/4377 support & identification fixes)
>> 
>> https://lore.kernel.org/asahi/20230214080034.3828-1-marcan@marcan.st/T/#t (Apple T2
>> platform support)
>> 
>> https://lore.kernel.org/asahi/20230214091651.10178-1-marcan@marcan.st/T/#t (BCM4387
>> / Apple M1 platform support)
>> 
>> https://lore.kernel.org/asahi/b4489e24-e226-4f99-1322-cab6c1269f09@broadcom.com/T/#t
>> (brcmfmac: cfg80211: Use WSEC to set SAE password)
>> 
>> The logs show:
>> 
>> Feb 23 20:08:57 MacBook kernel: usbcore: registered new interface driver brcmfmac
>> Feb 23 20:08:57 MacBook kernel: brcmfmac 0000:05:00.0: enabling device (0000 -> 0002)
>> Feb 23 20:08:57 MacBook kernel: brcmfmac: brcmf_fw_alloc_request: using
>> brcm/brcmfmac4364b3-pcie for chip BCM4364/4
>> Feb 23 20:08:57 MacBook kernel: brcmfmac 0000:05:00.0: Direct firmware load for
>> brcm/brcmfmac4364b3-pcie.Apple Inc.-MacBookPro16,1.bin failed with error -2
>> Feb 23 20:08:57 MacBook kernel: brcmfmac 0000:05:00.0: Direct firmware load for
>> brcm/brcmfmac4364b3-pcie.bin failed with error -2
>> Feb 23 20:08:57 MacBook kernel: brcmfmac 0000:05:00.0: brcmf_pcie_setup: Dongle setup
>> failed
>> 
>> I also tested the patchiest in the following link, and wifi mostly worked there (occasionally it
>> complained about some pic error, I’ll save the logs next time I encounter that) :
>> 
>> https://github.com/t2linux/linux-t2-patches/blob/main/8001-asahilinux-wifi-patchset.patch
>> 
>> Thanks
>> Aditya
>> 
>> I just noticed that the patch to ACPI was missing. Adding that fixed the issue.
>> 
>> https://github.com/t2linux/linux-t2-patches/blob/main/8005-ACPI-property-Support-strings-in-Apple-_DSM-props.patch
> 
> Please don't use HTML, our lists drop those. I'll reply in text/plain so
> that is info is archived.
> 
Hi

Sorry for that. I actually forgot to format that email as plain text.
> -- 
> https://patchwork.kernel.org/project/linux-wireless/list/
> 
> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches