Skip to contentSkip to conversation

Bluetooth: hci_nokia: select BT_BCM for btbcm_set_bdaddr()

PATCH Applied Marcel Holtmann 4 participants 12 messages Jul 22, 2017 – Jul 24, 2017 Bluetooth drivers

lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/1 Bluetooth: hci_nokia: select BT_BCM for btbcm_set_bdaddr()

The Nokia devices require the setup of its Public Bluetooth Device Address and for that it is required to depend on vendor specific commands. For Broadcom based Nokia devices, that is part of btbcm module and can be selected via BT_BCM config option.

---
 drivers/bluetooth/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/bluetooth/Kconfig +1 -0
index 35952a94875e..3a6ead603e49 100644
@@ -98,6 +98,7 @@ config BT_HCIUART_NOKIA
 	depends on BT_HCIUART_SERDEV
 	depends on PM
 	select BT_HCIUART_H4
+	select BT_BCM
 	help
 	  Nokia H4+ is serial protocol for communication between Bluetooth
 	  device and host. This protocol is required for Bluetooth devices
Signature · 1 line
2.13.3
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 6 lines · Marcel Holtmann

The Nokia devices require the setup of its Public Bluetooth Device Address and for that it is required to depend on vendor specific commands. For Broadcom based Nokia devices, that is part of btbcm module and can be selected via BT_BCM config option.

-- Sebastian

Quoted 23 lines
---
 drivers/bluetooth/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/bluetooth/Kconfig +1 -0
index 35952a94875e..3a6ead603e49 100644
@@ -98,6 +98,7 @@ config BT_HCIUART_NOKIA
 	depends on BT_HCIUART_SERDEV
 	depends on PM
 	select BT_HCIUART_H4
+	select BT_BCM
 	help
 	  Nokia H4+ is serial protocol for communication between Bluetooth
 	  device and host. This protocol is required for Bluetooth devices
Signature · 6 lines
2.13.3

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author maintainer
#2 lore raw

Hi Sebastian,

Quoted 8 lines
Quoted 6 lines

The Nokia devices require the setup of its Public Bluetooth Device Address and for that it is required to depend on vendor specific commands. For Broadcom based Nokia devices, that is part of btbcm module and can be selected via BT_BCM config option.

btw. we need to also provide the set_bdaddr for TI chips.

Regards

Marcel

#3 lore raw

Hi,

Quoted 10 lines · Marcel Holtmann
Quoted 8 lines
Quoted 6 lines

The Nokia devices require the setup of its Public Bluetooth Device Address and for that it is required to depend on vendor specific commands. For Broadcom based Nokia devices, that is part of btbcm module and can be selected via BT_BCM config option.

btw. we need to also provide the set_bdaddr for TI chips.

The TI based chip in Nokia N950 has a proper address configured, so it works without set_bdaddr (it would still be nice of course). It also seems to be missing for hci_ll, though. So the required command is completly unknown?

-- Sebastian

author maintainer
#4 lore raw

Hi Sebastian,

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

The Nokia devices require the setup of its Public Bluetooth Device Address and for that it is required to depend on vendor specific commands. For Broadcom based Nokia devices, that is part of btbcm module and can be selected via BT_BCM config option.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

btw. we need to also provide the set_bdaddr for TI chips.

The TI based chip in Nokia N950 has a proper address configured, so it works without set_bdaddr (it would still be nice of course). It also seems to be missing for hci_ll, though. So the required command is completly unknown?

are these a TI address or a Nokia address? I doubt Nokia would have actually shipped any hardware using an IEEE assigned address to TI.

Where do we have the firmware files for the Nokia devices? Don't they contain a command for setting the BD_ADDR. Also the original Nokia driver had code to re-write that command inline while loading the firmware.

Regards

Marcel

author maintainer
#10 lore raw
In reply to Sebastian Reichel

Hi Sebastian,

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

The Nokia devices require the setup of its Public Bluetooth Device Address and for that it is required to depend on vendor specific commands. For Broadcom based Nokia devices, that is part of btbcm module and can be selected via BT_BCM config option.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

btw. we need to also provide the set_bdaddr for TI chips.

The TI based chip in Nokia N950 has a proper address configured, so it works without set_bdaddr (it would still be nice of course). It also seems to be missing for hci_ll, though. So the required command is completly unknown?

actually a bunch of the TI HCI vendor command documents are public. We just need to figure out which one does the job. For the WiLink it is HCI_VS_Write_BD_Addr (0xFC06) which just takes the BD_ADDR as parameter.

Regards

Marcel

#5 lore raw
In reply to Marcel Holtmann

Hi,

Quoted 11 lines · Marcel Holtmann
Quoted 11 lines
Quoted 10 lines
Quoted 8 lines
Quoted 6 lines

The Nokia devices require the setup of its Public Bluetooth Device Address and for that it is required to depend on vendor specific commands. For Broadcom based Nokia devices, that is part of btbcm module and can be selected via BT_BCM config option.

btw. we need to also provide the set_bdaddr for TI chips.

Quoted 8 lines
Quoted 4 lines

The TI based chip in Nokia N950 has a proper address configured, so it works without set_bdaddr (it would still be nice of course). It also seems to be missing for hci_ll, though. So the required command is completly unknown?

are these a TI address or a Nokia address? I doubt Nokia would have actually shipped any hardware using an IEEE assigned address to TI.

I can check this later.

Quoted 1 line

Where do we have the firmware files for the Nokia devices?

For N950 I extracted it out of the following rpm:

http://repo.merproject.org/obs/nemo:/devel:/hw:/ti:/omap3:/n950-n9/latest_armv7hl/src/ti-wl1273-bt-firmware-0.23-1.2.Nemo.Adaptation.N950.N9.src.rpm

Quoted 1 line

Don't they contain a command for setting the BD_ADDR.

I did not check, since the firmware file is not device specific as far as I know.

Quoted 2 lines

Also the original Nokia driver had code to re-write that command inline while loading the firmware.

The address injection happens in hardware specific code (stock driver supports TI, Broadcom & CSR). In opposit to Broadcom and CSR the TI specific one does not change the address:

https://github.com/nemomobile/kernel-adaptation-n950-n9/blob/master/drivers/bluetooth/hci_h4p/fw-ti1273.c

-- Sebastian

#6 lore raw

Hi,

Quoted 17 lines · Sebastian Reichel
Quoted 16 lines · Marcel Holtmann
Quoted 15 lines
Quoted 10 lines
Quoted 8 lines
Quoted 6 lines

The Nokia devices require the setup of its Public Bluetooth Device Address and for that it is required to depend on vendor specific commands. For Broadcom based Nokia devices, that is part of btbcm module and can be selected via BT_BCM config option.

btw. we need to also provide the set_bdaddr for TI chips.

The TI based chip in Nokia N950 has a proper address configured, so it works without set_bdaddr (it would still be nice of course). It also seems to be missing for hci_ll, though. So the required command is completly unknown?

Quoted 5 lines
Quoted 3 lines

are these a TI address or a Nokia address? I doubt Nokia would have actually shipped any hardware using an IEEE assigned address to TI.

I can check this later.

The BD address on my N950 starts with B4:EE:D4, which belongs to TI as far as I can see. Note, that N950 is a developer only device.

-- Sebastian

author maintainer
#8 lore raw
In reply to Sebastian Reichel

Hi Sebastian,

Quoted 24 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
Quoted 8 lines
Quoted 6 lines

The Nokia devices require the setup of its Public Bluetooth Device Address and for that it is required to depend on vendor specific commands. For Broadcom based Nokia devices, that is part of btbcm module and can be selected via BT_BCM config option.

btw. we need to also provide the set_bdaddr for TI chips.

Quoted 8 lines
Quoted 4 lines

The TI based chip in Nokia N950 has a proper address configured, so it works without set_bdaddr (it would still be nice of course). It also seems to be missing for hci_ll, though. So the required command is completly unknown?

are these a TI address or a Nokia address? I doubt Nokia would have actually shipped any hardware using an IEEE assigned address to TI.

I can check this later.

Quoted 1 line

Where do we have the firmware files for the Nokia devices?

Quoted 8 lines

For N950 I extracted it out of the following rpm:

http://repo.merproject.org/obs/nemo:/devel:/hw:/ti:/omap3:/n950-n9/latest_armv7hl/src/ti-wl1273-bt-firmware-0.23-1.2.Nemo.Adaptation.N950.N9.src.rpm

Quoted 1 line

Don't they contain a command for setting the BD_ADDR.

I did not check, since the firmware file is not device specific as far as I know.

doen't matter since the old Nokia written driver hacked it from a sysfs file and the address came from the secure flash area.

Quoted 8 lines
Quoted 2 lines

Also the original Nokia driver had code to re-write that command inline while loading the firmware.

The address injection happens in hardware specific code (stock driver supports TI, Broadcom & CSR). In opposit to Broadcom and CSR the TI specific one does not change the address:

https://github.com/nemomobile/kernel-adaptation-n950-n9/blob/master/drivers/bluetooth/hci_h4p/fw-ti1273.c

As far as I know they rewrite the Write BD_ADDR command of each vendor at the time before they send to the hardware.

Regards

Marcel

author maintainer
#7 lore raw
In reply to Sebastian Reichel

Hi Sebastian,

Quoted 20 lines
Quoted 20 lines
Quoted 19 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

The Nokia devices require the setup of its Public Bluetooth Device Address and for that it is required to depend on vendor specific commands. For Broadcom based Nokia devices, that is part of btbcm module and can be selected via BT_BCM config option.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

btw. we need to also provide the set_bdaddr for TI chips.

The TI based chip in Nokia N950 has a proper address configured, so it works without set_bdaddr (it would still be nice of course). It also seems to be missing for hci_ll, though. So the required command is completly unknown?

are these a TI address or a Nokia address? I doubt Nokia would have actually shipped any hardware using an IEEE assigned address to TI.

Quoted 5 lines
Quoted 1 line

I can check this later.

The BD address on my N950 starts with B4:EE:D4, which belongs to TI as far as I can see. Note, that N950 is a developer only device.

as long as not every N950 now has the same address. But I think if Nokia would have shipped the device then it would have had to be a Nokia address.

Regards

Marcel

#9 lore raw
In reply to Marcel Holtmann

Hi,

Quoted 28 lines · Marcel Holtmann
Quoted 28 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
Quoted 8 lines
Quoted 6 lines

The Nokia devices require the setup of its Public Bluetooth Device Address and for that it is required to depend on vendor specific commands. For Broadcom based Nokia devices, that is part of btbcm module and can be selected via BT_BCM config option.

btw. we need to also provide the set_bdaddr for TI chips.

Quoted 8 lines
Quoted 4 lines

The TI based chip in Nokia N950 has a proper address configured, so it works without set_bdaddr (it would still be nice of course). It also seems to be missing for hci_ll, though. So the required command is completly unknown?

are these a TI address or a Nokia address? I doubt Nokia would have actually shipped any hardware using an IEEE assigned address to TI.

I can check this later.

Quoted 1 line

Where do we have the firmware files for the Nokia devices?

For N950 I extracted it out of the following rpm:

http://repo.merproject.org/obs/nemo:/devel:/hw:/ti:/omap3:/n950-n9/latest_armv7hl/src/ti-wl1273-bt-firmware-0.23-1.2.Nemo.Adaptation.N950.N9.src.rpm

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Don't they contain a command for setting the BD_ADDR.

I did not check, since the firmware file is not device specific as far as I know.

doen't matter since the old Nokia written driver hacked it from a sysfs file and the address came from the secure flash area.

The sysfs "just" puts the address into platform_data for their h4p driver. It does not take care of applying it to the hardware. That is the job of their h4p driver. Here is the code for the sysfs file:

https://github.com/nemomobile/kernel-adaptation-n950-n9/blob/master/arch/arm/mach-omap2/board-omap-bt.c

Quoted 11 lines
Quoted 8 lines
Quoted 2 lines

Also the original Nokia driver had code to re-write that command inline while loading the firmware.

The address injection happens in hardware specific code (stock driver supports TI, Broadcom & CSR). In opposit to Broadcom and CSR the TI specific one does not change the address:

https://github.com/nemomobile/kernel-adaptation-n950-n9/blob/master/drivers/bluetooth/hci_h4p/fw-ti1273.c

As far as I know they rewrite the Write BD_ADDR command of each vendor at the time before they send to the hardware.

You can clearly see that they modify the address in the hardware specific firmware files for Broadcom and CSR:

https://github.com/nemomobile/kernel-adaptation-n950-n9/blob/master/drivers/bluetooth/hci_h4p/fw-bcm.c
https://github.com/nemomobile/kernel-adaptation-n950-n9/blob/master/drivers/bluetooth/hci_h4p/fw-csr.c

But there is no such code for TI (except for a comment):

/* Check if this is bd_address packet */

I think they just forgot to implement it and since the comment has no XXX/TODO/FIXME prefix nobody noticed it.

-- Sebastian

#11 lore raw
In reply to Marcel Holtmann

Hi Marcel,

Quoted 9 lines · Marcel Holtmann

The Nokia devices require the setup of its Public Bluetooth Device Address and for that it is required to depend on vendor specific commands. For Broadcom based Nokia devices, that is part of btbcm module and can be selected via BT_BCM config option.

---
 drivers/bluetooth/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Applied to bluetooth-next. Thanks.

Johan