diff mbox series

[v2,2/5] dt-bindings: net: Add Broadcom BCM4377 family PCIe Bluetooth

Message ID 20220907170935.11757-3-sven@svenpeter.dev (mailing list archive)
State Superseded
Headers show
Series Broadcom/Apple Bluetooth driver for Apple Silicon | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/checkpatch success Checkpatch PASS
tedd_an/gitlint fail [v2,2/5] dt-bindings: net: Add Broadcom BCM4377 family PCIe Bluetooth 18: B1 Line exceeds max length (85>80): " create mode 100644 Documentation/devicetree/bindings/net/brcm,bcm4377-bluetooth.yaml"
tedd_an/subjectprefix fail "Bluetooth: " is not specified in the subject

Commit Message

Sven Peter Sept. 7, 2022, 5:09 p.m. UTC
These chips are combined Wi-Fi/Bluetooth radios which expose a
PCI subfunction for the Bluetooth part.
They are found in Apple machines such as the x86 models with the T2
chip or the arm64 models with the M1 or M2 chips.

Signed-off-by: Sven Peter <sven@svenpeter.dev>
---
changes from v1:
  - added apple,* pattern to brcm,board-type
  - s/PCI/PCIe/
  - fixed 1st reg cell inside the example to not contain the bus number

.../bindings/net/brcm,bcm4377-bluetooth.yaml  | 78 +++++++++++++++++++
 MAINTAINERS                                   |  1 +
 2 files changed, 79 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/brcm,bcm4377-bluetooth.yaml

Comments

Krzysztof Kozlowski Sept. 8, 2022, 11:19 a.m. UTC | #1
On 07/09/2022 19:09, Sven Peter wrote:
> These chips are combined Wi-Fi/Bluetooth radios which expose a
> PCI subfunction for the Bluetooth part.
> They are found in Apple machines such as the x86 models with the T2
> chip or the arm64 models with the M1 or M2 chips.
> 
> Signed-off-by: Sven Peter <sven@svenpeter.dev>
> ---
> changes from v1:
>   - added apple,* pattern to brcm,board-type
>   - s/PCI/PCIe/
>   - fixed 1st reg cell inside the example to not contain the bus number
> 
> .../bindings/net/brcm,bcm4377-bluetooth.yaml  | 78 +++++++++++++++++++
>  MAINTAINERS                                   |  1 +
>  2 files changed, 79 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/brcm,bcm4377-bluetooth.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/brcm,bcm4377-bluetooth.yaml b/Documentation/devicetree/bindings/net/brcm,bcm4377-bluetooth.yaml
> new file mode 100644
> index 000000000000..fb851f8e6bcb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/brcm,bcm4377-bluetooth.yaml
> @@ -0,0 +1,78 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/brcm,bcm4377-bluetooth.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Broadcom BCM4377 family PCIe Bluetooth Chips
> +
> +allOf:
> +  - $ref: bluetooth-controller.yaml#

Put it before properties (so after description).

> +
> +maintainers:
> +  - Sven Peter <sven@svenpeter.dev>
> +
> +description:
> +  This binding describes Broadcom BCM4377 family PCIe-attached bluetooth chips
> +  usually found in Apple machines. The Wi-Fi part of the chip is described in
> +  bindings/net/wireless/brcm,bcm4329-fmac.yaml.
> +
> +properties:
> +  compatible:
> +    enum:
> +      - pci14e4,5fa0 # BCM4377
> +      - pci14e4,5f69 # BCM4378
> +      - pci14e4,5f71 # BCM4387
> +
> +  reg:
> +    description: PCI device identifier.

maxItems: X

> +
> +  brcm,board-type:
> +    $ref: /schemas/types.yaml#/definitions/string
> +    description: Board type of the Bluetooth chip. This is used to decouple
> +      the overall system board from the Bluetooth module and used to construct
> +      firmware and calibration data filenames.
> +      On Apple platforms, this should be the Apple module-instance codename
> +      prefixed by "apple,", e.g. "apple,atlantisb".
> +    pattern: '^apple,.*'
> +
> +  brcm,taurus-cal-blob:
> +    $ref: /schemas/types.yaml#/definitions/uint8-array
> +    description: A per-device calibration blob for the Bluetooth radio. This
> +      should be filled in by the bootloader from platform configuration
> +      data, if necessary, and will be uploaded to the device.
> +      This blob is used if the chip stepping of the Bluetooth module does not
> +      support beamforming.

Isn't it:
s/beamforming/beam forming/
?

> +
> +  brcm,taurus-bf-cal-blob:
> +    $ref: /schemas/types.yaml#/definitions/uint8-array
> +    description: A per-device calibration blob for the Bluetooth radio. This
> +      should be filled in by the bootloader from platform configuration
> +      data, if necessary, and will be uploaded to the device.
> +      This blob is used if the chip stepping of the Bluetooth module supports
> +      beamforming.

Same here.

> +
> +  local-bd-address: true
> +
> +required:
> +  - compatible
> +  - reg
> +  - local-bd-address
> +  - brcm,board-type
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    pcie {
> +      #address-cells = <3>;
> +      #size-cells = <2>;
> +
> +      bluetooth@0,1 {

The unit address seems to be different than reg.

> +        compatible = "pci14e4,5f69";
> +        reg = <0x100 0x0 0x0 0x0 0x0>;
> +        brcm,board-type = "apple,honshu";
> +        /* To be filled by the bootloader */
> +        local-bd-address = [00 00 00 00 00 00];
> +      };
> +    };

Best regards,
Krzysztof
Martin Povišer Sept. 8, 2022, 11:29 a.m. UTC | #2
> On 8. 9. 2022, at 13:19, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> 
> On 07/09/2022 19:09, Sven Peter wrote:
>> These chips are combined Wi-Fi/Bluetooth radios which expose a
>> PCI subfunction for the Bluetooth part.
>> They are found in Apple machines such as the x86 models with the T2
>> chip or the arm64 models with the M1 or M2 chips.
>> 
>> Signed-off-by: Sven Peter <sven@svenpeter.dev>
>> ---
>> changes from v1:
>> - added apple,* pattern to brcm,board-type
>> - s/PCI/PCIe/
>> - fixed 1st reg cell inside the example to not contain the bus number
>> 
>> .../bindings/net/brcm,bcm4377-bluetooth.yaml | 78 +++++++++++++++++++
>> MAINTAINERS | 1 +
>> 2 files changed, 79 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/net/brcm,bcm4377-bluetooth.yaml
>> 
>> diff --git a/Documentation/devicetree/bindings/net/brcm,bcm4377-bluetooth.yaml b/Documentation/devicetree/bindings/net/brcm,bcm4377-bluetooth.yaml
>> new file mode 100644
>> index 000000000000..fb851f8e6bcb
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/brcm,bcm4377-bluetooth.yaml
>> @@ -0,0 +1,78 @@
>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/net/brcm,bcm4377-bluetooth.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Broadcom BCM4377 family PCIe Bluetooth Chips
>> +
>> +allOf:
>> + - $ref: bluetooth-controller.yaml#
> 
> Put it before properties (so after description).
> 
>> +
>> +maintainers:
>> + - Sven Peter <sven@svenpeter.dev>
>> +
>> +description:
>> + This binding describes Broadcom BCM4377 family PCIe-attached bluetooth chips
>> + usually found in Apple machines. The Wi-Fi part of the chip is described in
>> + bindings/net/wireless/brcm,bcm4329-fmac.yaml.
>> +
>> +properties:
>> + compatible:
>> + enum:
>> + - pci14e4,5fa0 # BCM4377
>> + - pci14e4,5f69 # BCM4378
>> + - pci14e4,5f71 # BCM4387
>> +
>> + reg:
>> + description: PCI device identifier.
> 
> maxItems: X
> 
>> +
>> + brcm,board-type:
>> + $ref: /schemas/types.yaml#/definitions/string
>> + description: Board type of the Bluetooth chip. This is used to decouple
>> + the overall system board from the Bluetooth module and used to construct
>> + firmware and calibration data filenames.
>> + On Apple platforms, this should be the Apple module-instance codename
>> + prefixed by "apple,", e.g. "apple,atlantisb".
>> + pattern: '^apple,.*'
>> +
>> + brcm,taurus-cal-blob:
>> + $ref: /schemas/types.yaml#/definitions/uint8-array
>> + description: A per-device calibration blob for the Bluetooth radio. This
>> + should be filled in by the bootloader from platform configuration
>> + data, if necessary, and will be uploaded to the device.
>> + This blob is used if the chip stepping of the Bluetooth module does not
>> + support beamforming.
> 
> Isn't it:
> s/beamforming/beam forming/
> ?

Doesn’t seem like it:
https://www.google.com/search?hl=en&q=beam%20forming

Best,
Martin

>> +
>> + brcm,taurus-bf-cal-blob:
>> + $ref: /schemas/types.yaml#/definitions/uint8-array
>> + description: A per-device calibration blob for the Bluetooth radio. This
>> + should be filled in by the bootloader from platform configuration
>> + data, if necessary, and will be uploaded to the device.
>> + This blob is used if the chip stepping of the Bluetooth module supports
>> + beamforming.
> 
> Same here.


> Best regards,
> Krzysztof
Hector Martin Sept. 8, 2022, 11:30 a.m. UTC | #3
On 08/09/2022 20.19, Krzysztof Kozlowski wrote:
> On 07/09/2022 19:09, Sven Peter wrote:
>> +
>> +  brcm,board-type:
>> +    $ref: /schemas/types.yaml#/definitions/string
>> +    description: Board type of the Bluetooth chip. This is used to decouple
>> +      the overall system board from the Bluetooth module and used to construct
>> +      firmware and calibration data filenames.
>> +      On Apple platforms, this should be the Apple module-instance codename
>> +      prefixed by "apple,", e.g. "apple,atlantisb".
>> +    pattern: '^apple,.*'
>> +
>> +  brcm,taurus-cal-blob:
>> +    $ref: /schemas/types.yaml#/definitions/uint8-array
>> +    description: A per-device calibration blob for the Bluetooth radio. This
>> +      should be filled in by the bootloader from platform configuration
>> +      data, if necessary, and will be uploaded to the device.
>> +      This blob is used if the chip stepping of the Bluetooth module does not
>> +      support beamforming.
> 
> Isn't it:
> s/beamforming/beam forming/
> ?

Nope, it's one word: https://en.wikipedia.org/wiki/Beamforming

- Hector
Krzysztof Kozlowski Sept. 8, 2022, 11:34 a.m. UTC | #4
On 08/09/2022 13:29, Martin Povišer wrote:
>>> + brcm,taurus-cal-blob:
>>> + $ref: /schemas/types.yaml#/definitions/uint8-array
>>> + description: A per-device calibration blob for the Bluetooth radio. This
>>> + should be filled in by the bootloader from platform configuration
>>> + data, if necessary, and will be uploaded to the device.
>>> + This blob is used if the chip stepping of the Bluetooth module does not
>>> + support beamforming.
>>
>> Isn't it:
>> s/beamforming/beam forming/
>> ?
> 
> Doesn’t seem like it:
> https://www.google.com/search?hl=en&q=beam%20forming

OK, thanks :)


Best regards,
Krzysztof
Rob Herring (Arm) Sept. 12, 2022, 9:12 p.m. UTC | #5
On Thu, Sep 08, 2022 at 01:19:17PM +0200, Krzysztof Kozlowski wrote:
> On 07/09/2022 19:09, Sven Peter wrote:
> > These chips are combined Wi-Fi/Bluetooth radios which expose a
> > PCI subfunction for the Bluetooth part.
> > They are found in Apple machines such as the x86 models with the T2
> > chip or the arm64 models with the M1 or M2 chips.
> > 
> > Signed-off-by: Sven Peter <sven@svenpeter.dev>
> > ---
> > changes from v1:
> >   - added apple,* pattern to brcm,board-type
> >   - s/PCI/PCIe/
> >   - fixed 1st reg cell inside the example to not contain the bus number
> > 
> > .../bindings/net/brcm,bcm4377-bluetooth.yaml  | 78 +++++++++++++++++++
> >  MAINTAINERS                                   |  1 +
> >  2 files changed, 79 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/net/brcm,bcm4377-bluetooth.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/net/brcm,bcm4377-bluetooth.yaml b/Documentation/devicetree/bindings/net/brcm,bcm4377-bluetooth.yaml
> > new file mode 100644
> > index 000000000000..fb851f8e6bcb
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/net/brcm,bcm4377-bluetooth.yaml
> > @@ -0,0 +1,78 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/net/brcm,bcm4377-bluetooth.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Broadcom BCM4377 family PCIe Bluetooth Chips
> > +
> > +allOf:
> > +  - $ref: bluetooth-controller.yaml#
> 
> Put it before properties (so after description).
> 
> > +
> > +maintainers:
> > +  - Sven Peter <sven@svenpeter.dev>
> > +
> > +description:
> > +  This binding describes Broadcom BCM4377 family PCIe-attached bluetooth chips
> > +  usually found in Apple machines. The Wi-Fi part of the chip is described in
> > +  bindings/net/wireless/brcm,bcm4329-fmac.yaml.
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - pci14e4,5fa0 # BCM4377
> > +      - pci14e4,5f69 # BCM4378
> > +      - pci14e4,5f71 # BCM4387
> > +
> > +  reg:
> > +    description: PCI device identifier.
> 
> maxItems: X

And drop the description.

> 
> > +
> > +  brcm,board-type:
> > +    $ref: /schemas/types.yaml#/definitions/string
> > +    description: Board type of the Bluetooth chip. This is used to decouple
> > +      the overall system board from the Bluetooth module and used to construct
> > +      firmware and calibration data filenames.
> > +      On Apple platforms, this should be the Apple module-instance codename
> > +      prefixed by "apple,", e.g. "apple,atlantisb".
> > +    pattern: '^apple,.*'
> > +
> > +  brcm,taurus-cal-blob:
> > +    $ref: /schemas/types.yaml#/definitions/uint8-array
> > +    description: A per-device calibration blob for the Bluetooth radio. This
> > +      should be filled in by the bootloader from platform configuration
> > +      data, if necessary, and will be uploaded to the device.
> > +      This blob is used if the chip stepping of the Bluetooth module does not
> > +      support beamforming.
> 
> Isn't it:
> s/beamforming/beam forming/
> ?
> 
> > +
> > +  brcm,taurus-bf-cal-blob:
> > +    $ref: /schemas/types.yaml#/definitions/uint8-array
> > +    description: A per-device calibration blob for the Bluetooth radio. This
> > +      should be filled in by the bootloader from platform configuration
> > +      data, if necessary, and will be uploaded to the device.
> > +      This blob is used if the chip stepping of the Bluetooth module supports
> > +      beamforming.
> 
> Same here.
> 
> > +
> > +  local-bd-address: true
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - local-bd-address
> > +  - brcm,board-type
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    pcie {
> > +      #address-cells = <3>;
> > +      #size-cells = <2>;
> > +
> > +      bluetooth@0,1 {
> 
> The unit address seems to be different than reg.

Right, this says dev 0, func 1.

dtc can check this, but IIRC it would need 'device_type = "pci";' 
in the parent. So please add that, and verify you get a warning.

Rob
Rob Herring (Arm) Sept. 15, 2022, 1:09 p.m. UTC | #6
On Mon, Sep 12, 2022 at 4:12 PM Rob Herring <robh@kernel.org> wrote:
>
> On Thu, Sep 08, 2022 at 01:19:17PM +0200, Krzysztof Kozlowski wrote:
> > On 07/09/2022 19:09, Sven Peter wrote:
> > > These chips are combined Wi-Fi/Bluetooth radios which expose a
> > > PCI subfunction for the Bluetooth part.
> > > They are found in Apple machines such as the x86 models with the T2
> > > chip or the arm64 models with the M1 or M2 chips.
> > >
> > > Signed-off-by: Sven Peter <sven@svenpeter.dev>
> > > ---

> > > +examples:
> > > +  - |
> > > +    pcie {
> > > +      #address-cells = <3>;
> > > +      #size-cells = <2>;
> > > +
> > > +      bluetooth@0,1 {
> >
> > The unit address seems to be different than reg.
>
> Right, this says dev 0, func 1.

Actually, the reg value of 0x100 is correct. func is bits 8-10. dev
starts in bit 11.

Rob
Sven Peter Sept. 19, 2022, 3:15 p.m. UTC | #7
On Thu, Sep 15, 2022, at 15:09, Rob Herring wrote:
> On Mon, Sep 12, 2022 at 4:12 PM Rob Herring <robh@kernel.org> wrote:
>>
>> On Thu, Sep 08, 2022 at 01:19:17PM +0200, Krzysztof Kozlowski wrote:
>> > On 07/09/2022 19:09, Sven Peter wrote:
>> > > These chips are combined Wi-Fi/Bluetooth radios which expose a
>> > > PCI subfunction for the Bluetooth part.
>> > > They are found in Apple machines such as the x86 models with the T2
>> > > chip or the arm64 models with the M1 or M2 chips.
>> > >
>> > > Signed-off-by: Sven Peter <sven@svenpeter.dev>
>> > > ---
>
>> > > +examples:
>> > > +  - |
>> > > +    pcie {
>> > > +      #address-cells = <3>;
>> > > +      #size-cells = <2>;
>> > > +
>> > > +      bluetooth@0,1 {
>> >
>> > The unit address seems to be different than reg.
>>
>> Right, this says dev 0, func 1.
>
> Actually, the reg value of 0x100 is correct. func is bits 8-10. dev
> starts in bit 11.

Yup, if I write the example as

  - |
    pcie@a0000000 {
      #address-cells = <3>;
      #size-cells = <2>;
      reg = <0xa0000000 0x1000000>;
      device_type = "pci";
      ranges = <0x43000000 0x6 0xa0000000 0xa0000000 0x0 0x20000000>;

      bluetooth@0,1 {
        compatible = "pci14e4,5f69";
        reg = <0x100 0x0 0x0 0x0 0x0>;
        brcm,board-type = "apple,honshu";
        /* To be filled by the bootloader */
        local-bd-address = [00 00 00 00 00 00];
      };
    };


then no warnings appear. If I instead use "bluetooth@0,2" I get the following
warning:

Warning (pci_device_reg): /example-0/pcie@a0000000/bluetooth@0,2: PCI unit address format error, expected "0,1"



Sven
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/brcm,bcm4377-bluetooth.yaml b/Documentation/devicetree/bindings/net/brcm,bcm4377-bluetooth.yaml
new file mode 100644
index 000000000000..fb851f8e6bcb
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/brcm,bcm4377-bluetooth.yaml
@@ -0,0 +1,78 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/brcm,bcm4377-bluetooth.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Broadcom BCM4377 family PCIe Bluetooth Chips
+
+allOf:
+  - $ref: bluetooth-controller.yaml#
+
+maintainers:
+  - Sven Peter <sven@svenpeter.dev>
+
+description:
+  This binding describes Broadcom BCM4377 family PCIe-attached bluetooth chips
+  usually found in Apple machines. The Wi-Fi part of the chip is described in
+  bindings/net/wireless/brcm,bcm4329-fmac.yaml.
+
+properties:
+  compatible:
+    enum:
+      - pci14e4,5fa0 # BCM4377
+      - pci14e4,5f69 # BCM4378
+      - pci14e4,5f71 # BCM4387
+
+  reg:
+    description: PCI device identifier.
+
+  brcm,board-type:
+    $ref: /schemas/types.yaml#/definitions/string
+    description: Board type of the Bluetooth chip. This is used to decouple
+      the overall system board from the Bluetooth module and used to construct
+      firmware and calibration data filenames.
+      On Apple platforms, this should be the Apple module-instance codename
+      prefixed by "apple,", e.g. "apple,atlantisb".
+    pattern: '^apple,.*'
+
+  brcm,taurus-cal-blob:
+    $ref: /schemas/types.yaml#/definitions/uint8-array
+    description: A per-device calibration blob for the Bluetooth radio. This
+      should be filled in by the bootloader from platform configuration
+      data, if necessary, and will be uploaded to the device.
+      This blob is used if the chip stepping of the Bluetooth module does not
+      support beamforming.
+
+  brcm,taurus-bf-cal-blob:
+    $ref: /schemas/types.yaml#/definitions/uint8-array
+    description: A per-device calibration blob for the Bluetooth radio. This
+      should be filled in by the bootloader from platform configuration
+      data, if necessary, and will be uploaded to the device.
+      This blob is used if the chip stepping of the Bluetooth module supports
+      beamforming.
+
+  local-bd-address: true
+
+required:
+  - compatible
+  - reg
+  - local-bd-address
+  - brcm,board-type
+
+additionalProperties: false
+
+examples:
+  - |
+    pcie {
+      #address-cells = <3>;
+      #size-cells = <2>;
+
+      bluetooth@0,1 {
+        compatible = "pci14e4,5f69";
+        reg = <0x100 0x0 0x0 0x0 0x0>;
+        brcm,board-type = "apple,honshu";
+        /* To be filled by the bootloader */
+        local-bd-address = [00 00 00 00 00 00];
+      };
+    };
diff --git a/MAINTAINERS b/MAINTAINERS
index 8a5012ba6ff9..5cc9c2da1140 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1875,6 +1875,7 @@  F:	Documentation/devicetree/bindings/interrupt-controller/apple,*
 F:	Documentation/devicetree/bindings/iommu/apple,dart.yaml
 F:	Documentation/devicetree/bindings/iommu/apple,sart.yaml
 F:	Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml
+F:	Documentation/devicetree/bindings/net/brcm,bcm4377-bluetooth.yaml
 F:	Documentation/devicetree/bindings/nvme/apple,nvme-ans.yaml
 F:	Documentation/devicetree/bindings/nvmem/apple,efuses.yaml
 F:	Documentation/devicetree/bindings/pci/apple,pcie.yaml