-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
base: main
Are you sure you want to change the base?
Driver: hci_nxp_setup: Support HCI baudrate update #82308
Conversation
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. | ||
|
There was a problem hiding this comment.
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.
- If these are specific to this driver, then shouldn't you prefix them with
nxp,
(or possibly withzephyr,
as per https://docs.zephyrproject.org/latest/build/dts/bindings-upstream.html#the-zephyr-prefix)? - Does there perhaps exist some existing properties elsewhere with the same semantics, if so, consider reusing those instead of defining new ones.
- 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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- If these are specific to this driver, then shouldn't you prefix them with
nxp,
(or possibly withzephyr,
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
?
- 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.
- 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]>
092efce
to
773755f
Compare
Add
hci-default-speed
to set default HCI bandrate after the firmware download. Andhci-operation-speed
is used to set the running HCI bandrate.Change running baudrate from
115200
from3000000
.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
ifBT_H4_NXP_CTLR
is enabled.