Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Driver: hci_nxp_setup: Support HCI baudrate update #82308

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lylezhu2012
Copy link
Contributor

Add hci-default-speed to set default HCI bandrate after the firmware download. And hci-operation-speed is used to set the running HCI bandrate.

Change running baudrate from 115200 from 3000000.

Implement the function bt_h4_vnd_setup to update the HCI bandrate.

Add Kconfig BT_H4_NXP_CTLR_WAIT_TIME_AFTER_BAUDRATE_UPDATE to set the waiting time after the controller bandrate HCI vendor specific command sent. It is used to ensure the controller is ready to update HCI bandrate.

Select BT_HCI_SETUP if BT_H4_NXP_CTLR is enabled.

Comment on lines 20 to 25
hci-operation-speed:
hci-default-speed:
type: int
description: |
HCI UART baudrate for feature operation. If not defined
HCI UART default baudrate after the FW download. If not defined
bus/current-speed will be used as default.

hci-operation-speed:
type: int
description: |
HCI UART running baudrate for feature operation. If not defined
hci-default-speed will be used as default.
When hci-operation-speed is different with hci-default-speed,
the HCI UART baudrate update process will be involved to change
the HCI UART baudrate from hci-default-speed to
hci-operation-speed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few questions about these.

  1. If these are specific to this driver, then shouldn't you prefix them with nxp, (or possibly with zephyr, as per https://docs.zephyrproject.org/latest/build/dts/bindings-upstream.html#the-zephyr-prefix)?
  2. Does there perhaps exist some existing properties elsewhere with the same semantics, if so, consider reusing those instead of defining new ones.
  3. Since the HCI node will be a child node of a UART device, could you derive some information of the baud rate from the UART node instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. If these are specific to this driver, then shouldn't you prefix them with nxp, (or possibly with zephyr, as per https://docs.zephyrproject.org/latest/build/dts/bindings-upstream.html#the-zephyr-prefix)?

It is a member of [nxp,bt-hci-uart.yaml](https://github.com/zephyrproject-rtos/zephyr/pull/82308/files#diff-1d64be33434b758bd8cc34a07c9a3d770c1f393fbf681ec1fb8914ab44f95ad8). And I do not think it is not a member defined by zephyr. But I did not notice it should be prefixed with nxp,. Since it is a member of nxp,bt-hci-uart.yaml. And file nxp,bt-hci-uart.yaml has been prefixed with nxp, is it necessary to add a prefix to each member of nxp,bt-hci-uart.yaml?

  1. Does there perhaps exist some existing properties elsewhere with the same semantics, if so, consider reusing those instead of defining new ones.

Yes. current-speed of UART can be used to achieve the purpose. I have remove the changes of hci-default-speed from this PR.

  1. Since the HCI node will be a child node of a UART device, could you derive some information of the baud rate from the UART node instead?

Yes. current-speed is used as the default bandrate for HCI.

Change running baudrate from `115200` from `3000000`.

Implement the function `bt_h4_vnd_setup` to update the HCI bandrate.

Add Kconfig `BT_H4_NXP_CTLR_WAIT_TIME_AFTER_BAUDRATE_UPDATE` to set
the waiting time after the controller bandrate HCI vendor specific
command sent. It is used to ensure the controller is ready to update
HCI bandrate.

Select `BT_HCI_SETUP` if `BT_H4_NXP_CTLR` is enabled.

Signed-off-by: Lyle Zhu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants