Message ID | 20250212-wilc3000_bt-v1-1-9609b784874e@bootlin.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Johannes Berg |
Headers | show |
Series | bluetooth: hci_wilc: add new bluetooth driver | expand |
On Wed, Feb 12, 2025 at 04:46:20PM +0100, Alexis Lothoré wrote: > WILC3000 is a combo chip providing 802.11b/g/n and Bluetooth 5. The wlan > part is exposed either through SDIO or SPI interface, and the bluetooth > part is exposed through uart. The notable peculiarity of this chip is > that the bluetooth part is not fully autonomous: its firmware is not > loaded through UART interface but through SDIO/SPI interface, so the > bluetooth description needs a reference to the wlan part to get access > to the corresponding bus. > > Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> > --- > .../net/bluetooth/microchip,wilc3000-bt.yaml | 41 ++++++++++++++++++++++ > 1 file changed, 41 insertions(+) > > diff --git a/Documentation/devicetree/bindings/net/bluetooth/microchip,wilc3000-bt.yaml b/Documentation/devicetree/bindings/net/bluetooth/microchip,wilc3000-bt.yaml > new file mode 100644 > index 0000000000000000000000000000000000000000..2a83ca3ad90b26fd619b574bc343bee9654a1e43 > --- /dev/null > +++ b/Documentation/devicetree/bindings/net/bluetooth/microchip,wilc3000-bt.yaml > @@ -0,0 +1,41 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/net/bluetooth/microchip,wilc3000-bt.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Microchip Bluetooth chips > + > +description: > + This binding describes UART-attached Microchip bluetooth chips. These > + chips are dual-radio chips supporting WiFi and Bluetooth. The bluetooth > + side works with standard HCI commands over 4-wires UART (with flow > + control) > + > +maintainers: > + - Alexis Lothoré <alexis.lothore@bootlin.com> > + > +properties: > + compatible: > + enum: > + - microchip,wilc3000-bt > + > + wlan: > + $ref: /schemas/types.yaml#/definitions/phandle > + description: > + Phandle to the wlan part of the combo chip No resources here and judging by the driver everything is part of wifi. Either you wrote it to match driver or indeed hardware is like that. In the first case, why this cannot be part of WiFi with phandle to serial bus? In the second case, this needs to be proper hardware description. Best regards, Krzysztof
Hi Krzysztof, On 2/13/25 10:25, Krzysztof Kozlowski wrote: >> + wlan: >> + $ref: /schemas/types.yaml#/definitions/phandle >> + description: >> + Phandle to the wlan part of the combo chip > > No resources here and judging by the driver everything is part of wifi. > Either you wrote it to match driver or indeed hardware is like that. In > the first case, why this cannot be part of WiFi with phandle to serial > bus? In the second case, this needs to be proper hardware description First, I'd like to reclarify what the chip exactly is, to make sure that we are talking about the same thing. The wilc3000 ([1]) is a single physical device packaging two different discrete modules inside (one for 802.11, one for bluetooth). The WLAN part has its own binding integrated in upstream kernel ([2]) and is based on a similar chip in the same family (wilc1000, which only have 802.11, and so only SPI/SDIO, no UART). Now that it is said, no, I did not write this binding only aiming to match the new driver. I tried to base this description on how similar WLAN/BT combo chips are usually described (based on those which have existing bindings), and they seem to describe distinctly the two internal parts of those chips as well. For those who use HCI commands over uart for the bluetooth part, they expose a dedicated child node of a serial controller (distinct from the wlan part, described as another node on PCI/SDIO/SPI/etc). The hardware architecture for wilc3000 is similar to those, so since the serial bus is the primary interface to operate the bluetooth part inside the chip, doesn't it makes sense to have it under a serial controller node (and then to refer to wlan for the additional operations needed on sdio/spi), than the other way around ? About the lack of other resources in the new node: there are indeed additional resources that affect bluetooth, but I am not sure how it should be handled: there are for example a reset input and a chip enable input exposed by this chip, which in fact do not only affect the WLAN part but the two parts inside the chip. But those are currently described and handled by the WLAN part. I guess that an improvement regarding this point could then be to move those out of the wlan binding, and find a way to describe it as shared resources between those two parts of the chip, but how should it be handled ? Is it ok to remove those from an existing binding (and if so, where to put those ? It is not bluetooth specific neither) ? Is the issue rather about current WILC3000 binding kind of mixing overall chip description and internal wlan part description ? Thanks, Alexis [1] https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/IEEE-802.11-b-g-n-Link-Controller-Module-with-Integrated-Bluetooth-5.0-DS70005327B.pdf [2] https://elixir.bootlin.com/linux/v6.12.6/source/Documentation/devicetree/bindings/net/wireless/microchip,wilc1000.yaml > Best regards, > Krzysztof >
On 13/02/2025 16:25, Alexis Lothoré wrote: > Hi Krzysztof, > > On 2/13/25 10:25, Krzysztof Kozlowski wrote: >>> + wlan: >>> + $ref: /schemas/types.yaml#/definitions/phandle >>> + description: >>> + Phandle to the wlan part of the combo chip >> >> No resources here and judging by the driver everything is part of wifi. >> Either you wrote it to match driver or indeed hardware is like that. In >> the first case, why this cannot be part of WiFi with phandle to serial >> bus? In the second case, this needs to be proper hardware description > > First, I'd like to reclarify what the chip exactly is, to make sure that we are > talking about the same thing. The wilc3000 ([1]) is a single physical device > packaging two different discrete modules inside (one for 802.11, one for > bluetooth). The WLAN part has its own binding integrated in upstream kernel > ([2]) and is based on a similar chip in the same family (wilc1000, which only > have 802.11, and so only SPI/SDIO, no UART). > > Now that it is said, no, I did not write this binding only aiming to match the > new driver. I tried to base this description on how similar WLAN/BT combo chips > are usually described (based on those which have existing bindings), and they > seem to describe distinctly the two internal parts of those chips as well. For Yes, because BT part is isolated enough that you datasheet tells which resources belong to it and DT describes these resources. You do not have any resources here. > those who use HCI commands over uart for the bluetooth part, they expose a > dedicated child node of a serial controller (distinct from the wlan part, > described as another node on PCI/SDIO/SPI/etc). The hardware architecture for > wilc3000 is similar to those, so since the serial bus is the primary interface > to operate the bluetooth part inside the chip, doesn't it makes sense to have it > under a serial controller node (and then to refer to wlan for the additional > operations needed on sdio/spi), than the other way around ? There is little benefit in describing one device in two places. This even lead to probe ordering issues and power sequencing problems, for example being explicitly addressed by recent power sequencing work from Bartosz by creating *third* node... You have no resources here, so I cannot even imagine inventing something in that third (PMU) node. But anyway in case of WCN devices, the reason of power sequencing patches, BT and WiFi are separate, can be enabled separately, can be even shipped one without another (I think). Not your case. Your BT needs WiFi to load firmware. > > About the lack of other resources in the new node: there are indeed additional > resources that affect bluetooth, but I am not sure how it should be handled: You sent us then incomplete hardware description. So you got review like this. > there are for example a reset input and a chip enable input exposed by this > chip, which in fact do not only affect the WLAN part but the two parts inside > the chip. But those are currently described and handled by the WLAN part. I So everything is already defined in WiFi part and this node is not really necessary. > guess that an improvement regarding this point could then be to move those out > of the wlan binding, and find a way to describe it as shared resources between > those two parts of the chip, but how should it be handled ? Is it ok to remove > those from an existing binding (and if so, where to put those ? It is not > bluetooth specific neither) ? Is the issue rather about current WILC3000 binding > kind of mixing overall chip description and internal wlan part description ? Datasheet shows this as one device, not two, not three. Reset and chip enable, based on datasheet, are not specific to BT. They reset/enable entire chip, I assume, so it is even better proof that your HW description is not correct. How this device is supposed to work if you do not enable WiFi - do not deassert reset from Wifi driver? BT will stay in reset. Really, and that's correct hardware representation? This is exactly the power sequencing problem one more time and you keep asking exactly the same questions and repeating exactly the same mistakes. This is incomplete and, IMO, incorrect hardware description. Read all previous discussions, read/listen/watch the talks about power sequencing (there were two on LPCs - one with Abel to describe the problem, year later to solve it). Best regards, Krzysztof
diff --git a/Documentation/devicetree/bindings/net/bluetooth/microchip,wilc3000-bt.yaml b/Documentation/devicetree/bindings/net/bluetooth/microchip,wilc3000-bt.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2a83ca3ad90b26fd619b574bc343bee9654a1e43 --- /dev/null +++ b/Documentation/devicetree/bindings/net/bluetooth/microchip,wilc3000-bt.yaml @@ -0,0 +1,41 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/bluetooth/microchip,wilc3000-bt.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip Bluetooth chips + +description: + This binding describes UART-attached Microchip bluetooth chips. These + chips are dual-radio chips supporting WiFi and Bluetooth. The bluetooth + side works with standard HCI commands over 4-wires UART (with flow + control) + +maintainers: + - Alexis Lothoré <alexis.lothore@bootlin.com> + +properties: + compatible: + enum: + - microchip,wilc3000-bt + + wlan: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to the wlan part of the combo chip + +required: + - compatible + - wlan + +additionalProperties: false + +examples: + - | + serial { + bluetooth { + compatible = "microchip,wilc3000-bt"; + wlan = <&wifi>; + }; + };
WILC3000 is a combo chip providing 802.11b/g/n and Bluetooth 5. The wlan part is exposed either through SDIO or SPI interface, and the bluetooth part is exposed through uart. The notable peculiarity of this chip is that the bluetooth part is not fully autonomous: its firmware is not loaded through UART interface but through SDIO/SPI interface, so the bluetooth description needs a reference to the wlan part to get access to the corresponding bus. Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> --- .../net/bluetooth/microchip,wilc3000-bt.yaml | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+)