Skip to content

Commit 2efb07b

Browse files
committed
Merge tag 'for-net-next-2023-04-23' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
bluetooth-next pull request for net-next: - Introduce devcoredump support - Add support for Realtek RTL8821CS, RTL8851B, RTL8852BS - Add support for Mediatek MT7663, MT7922 - Add support for NXP w8997 - Add support for Actions Semi ATS2851 - Add support for QTI WCN6855 - Add support for Marvell 88W8997
2 parents fd84c56 + d883a46 commit 2efb07b

50 files changed

Lines changed: 4122 additions & 516 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/net/bluetooth/nxp,88w8987-bt.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: NXP Bluetooth chips
8+
9+
description:
10+
This binding describes UART-attached NXP bluetooth chips. These chips
11+
are dual-radio chips supporting WiFi and Bluetooth. The bluetooth
12+
works on standard H4 protocol over 4-wire UART. The RTS and CTS lines
13+
are used during FW download. To enable power save mode, the host
14+
asserts break signal over UART-TX line to put the chip into power save
15+
state. De-asserting break wakes up the BT chip.
16+
17+
maintainers:
18+
- Neeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
19+
20+
properties:
21+
compatible:
22+
enum:
23+
- nxp,88w8987-bt
24+
- nxp,88w8997-bt
25+
26+
fw-init-baudrate:
27+
description:
28+
Chip baudrate after FW is downloaded and initialized.
29+
This property depends on the module vendor's
30+
configuration. If this property is not specified,
31+
115200 is set as default.
32+
33+
required:
34+
- compatible
35+
36+
additionalProperties: false
37+
38+
examples:
39+
- |
40+
serial {
41+
bluetooth {
42+
compatible = "nxp,88w8987-bt";
43+
fw-init-baudrate = <3000000>;
44+
};
45+
};

Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ properties:
2323
- qcom,wcn3998-bt
2424
- qcom,qca6390-bt
2525
- qcom,wcn6750-bt
26+
- qcom,wcn6855-bt
2627

2728
enable-gpios:
2829
maxItems: 1
@@ -133,6 +134,22 @@ allOf:
133134
- vddrfa1p7-supply
134135
- vddrfa1p2-supply
135136
- vddasd-supply
137+
- if:
138+
properties:
139+
compatible:
140+
contains:
141+
enum:
142+
- qcom,wcn6855-bt
143+
then:
144+
required:
145+
- enable-gpios
146+
- swctrl-gpios
147+
- vddio-supply
148+
- vddbtcxmx-supply
149+
- vddrfacmn-supply
150+
- vddrfa0p8-supply
151+
- vddrfa1p2-supply
152+
- vddrfa1p7-supply
136153

137154
examples:
138155
- |

Documentation/devicetree/bindings/net/marvell-bluetooth.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,29 @@ maintainers:
1515

1616
properties:
1717
compatible:
18-
const: mrvl,88w8897
18+
enum:
19+
- mrvl,88w8897
20+
- mrvl,88w8997
21+
22+
max-speed:
23+
description: see Documentation/devicetree/bindings/serial/serial.yaml
1924

2025
required:
2126
- compatible
2227

28+
allOf:
29+
- if:
30+
properties:
31+
compatible:
32+
contains:
33+
const: mrvl,88w8997
34+
then:
35+
properties:
36+
max-speed: true
37+
else:
38+
properties:
39+
max-speed: false
40+
2341
additionalProperties: false
2442

2543
examples:

Documentation/devicetree/bindings/net/realtek-bluetooth.yaml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,30 @@
44
$id: http://devicetree.org/schemas/net/realtek-bluetooth.yaml#
55
$schema: http://devicetree.org/meta-schemas/core.yaml#
66

7-
title: RTL8723BS/RTL8723CS/RTL8822CS Bluetooth
7+
title: RTL8723BS/RTL8723CS/RTL8821CS/RTL8822CS Bluetooth
88

99
maintainers:
1010
- Vasily Khoruzhick <anarsoul@gmail.com>
1111
- Alistair Francis <alistair@alistair23.me>
1212

1313
description:
14-
RTL8723CS/RTL8723CS/RTL8822CS is WiFi + BT chip. WiFi part is connected over
15-
SDIO, while BT is connected over serial. It speaks H5 protocol with few
16-
extra commands to upload firmware and change module speed.
14+
RTL8723CS/RTL8723CS/RTL8821CS/RTL8822CS is a WiFi + BT chip. WiFi part
15+
is connected over SDIO, while BT is connected over serial. It speaks
16+
H5 protocol with few extra commands to upload firmware and change
17+
module speed.
1718

1819
properties:
1920
compatible:
20-
enum:
21-
- realtek,rtl8723bs-bt
22-
- realtek,rtl8723cs-bt
23-
- realtek,rtl8723ds-bt
24-
- realtek,rtl8822cs-bt
21+
oneOf:
22+
- enum:
23+
- realtek,rtl8723bs-bt
24+
- realtek,rtl8723cs-bt
25+
- realtek,rtl8723ds-bt
26+
- realtek,rtl8822cs-bt
27+
- items:
28+
- enum:
29+
- realtek,rtl8821cs-bt
30+
- const: realtek,rtl8822cs-bt
2531

2632
device-wake-gpios:
2733
maxItems: 1

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23237,6 +23237,13 @@ L: linux-mm@kvack.org
2323723237
S: Maintained
2323823238
F: mm/zswap.c
2323923239

23240+
NXP BLUETOOTH WIRELESS DRIVERS
23241+
M: Amitkumar Karwar <amitkumar.karwar@nxp.com>
23242+
M: Neeraj Kale <neeraj.sanjaykale@nxp.com>
23243+
S: Maintained
23244+
F: Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml
23245+
F: drivers/bluetooth/btnxpuart.c
23246+
2324023247
THE REST
2324123248
M: Linus Torvalds <torvalds@linux-foundation.org>
2324223249
L: linux-kernel@vger.kernel.org

arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@
716716
status = "okay";
717717

718718
bluetooth {
719-
compatible = "realtek,rtl8821cs-bt";
719+
compatible = "realtek,rtl8821cs-bt", "realtek,rtl8822cs-bt";
720720
device-wake-gpios = <&gpio4 4 GPIO_ACTIVE_HIGH>;
721721
enable-gpios = <&gpio4 3 GPIO_ACTIVE_HIGH>;
722722
host-wake-gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>;

drivers/bluetooth/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ config BT_HCIBLUECARD
363363

364364
config BT_HCIVHCI
365365
tristate "HCI VHCI (Virtual HCI device) driver"
366+
select WANT_DEV_COREDUMP
366367
help
367368
Bluetooth Virtual HCI device driver.
368369
This driver is required if you want to use HCI Emulation software.
@@ -465,4 +466,17 @@ config BT_VIRTIO
465466
Say Y here to compile support for HCI over Virtio into the
466467
kernel or say M to compile as a module.
467468

469+
config BT_NXPUART
470+
tristate "NXP protocol support"
471+
depends on SERIAL_DEV_BUS
472+
select CRC32
473+
select CRC8
474+
help
475+
NXP is serial driver required for NXP Bluetooth
476+
devices with UART interface.
477+
478+
Say Y here to compile support for NXP Bluetooth UART device into
479+
the kernel, or say M here to compile as a module (btnxpuart).
480+
481+
468482
endmenu

drivers/bluetooth/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ obj-$(CONFIG_BT_QCA) += btqca.o
2929
obj-$(CONFIG_BT_MTK) += btmtk.o
3030

3131
obj-$(CONFIG_BT_VIRTIO) += virtio_bt.o
32+
obj-$(CONFIG_BT_NXPUART) += btnxpuart.o
3233

3334
obj-$(CONFIG_BT_HCIUART_NOKIA) += hci_nokia.o
3435

drivers/bluetooth/btbcm.c

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Copyright (C) 2015 Intel Corporation
77
*/
88

9+
#include <linux/efi.h>
910
#include <linux/module.h>
1011
#include <linux/firmware.h>
1112
#include <linux/dmi.h>
@@ -34,6 +35,43 @@
3435
/* For kmalloc-ing the fw-name array instead of putting it on the stack */
3536
typedef char bcm_fw_name[BCM_FW_NAME_LEN];
3637

38+
#ifdef CONFIG_EFI
39+
static int btbcm_set_bdaddr_from_efi(struct hci_dev *hdev)
40+
{
41+
efi_guid_t guid = EFI_GUID(0x74b00bd9, 0x805a, 0x4d61, 0xb5, 0x1f,
42+
0x43, 0x26, 0x81, 0x23, 0xd1, 0x13);
43+
bdaddr_t efi_bdaddr, bdaddr;
44+
efi_status_t status;
45+
unsigned long len;
46+
int ret;
47+
48+
if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE))
49+
return -EOPNOTSUPP;
50+
51+
len = sizeof(efi_bdaddr);
52+
status = efi.get_variable(L"BDADDR", &guid, NULL, &len, &efi_bdaddr);
53+
if (status != EFI_SUCCESS)
54+
return -ENXIO;
55+
56+
if (len != sizeof(efi_bdaddr))
57+
return -EIO;
58+
59+
baswap(&bdaddr, &efi_bdaddr);
60+
61+
ret = btbcm_set_bdaddr(hdev, &bdaddr);
62+
if (ret)
63+
return ret;
64+
65+
bt_dev_info(hdev, "BCM: Using EFI device address (%pMR)", &bdaddr);
66+
return 0;
67+
}
68+
#else
69+
static int btbcm_set_bdaddr_from_efi(struct hci_dev *hdev)
70+
{
71+
return -EOPNOTSUPP;
72+
}
73+
#endif
74+
3775
int btbcm_check_bdaddr(struct hci_dev *hdev)
3876
{
3977
struct hci_rp_read_bd_addr *bda;
@@ -87,9 +125,12 @@ int btbcm_check_bdaddr(struct hci_dev *hdev)
87125
!bacmp(&bda->bdaddr, BDADDR_BCM4345C5) ||
88126
!bacmp(&bda->bdaddr, BDADDR_BCM43430A0) ||
89127
!bacmp(&bda->bdaddr, BDADDR_BCM43341B)) {
90-
bt_dev_info(hdev, "BCM: Using default device address (%pMR)",
91-
&bda->bdaddr);
92-
set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
128+
/* Try falling back to BDADDR EFI variable */
129+
if (btbcm_set_bdaddr_from_efi(hdev) != 0) {
130+
bt_dev_info(hdev, "BCM: Using default device address (%pMR)",
131+
&bda->bdaddr);
132+
set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
133+
}
93134
}
94135

95136
kfree_skb(skb);

0 commit comments

Comments
 (0)