[PATCH next 2/2] Bluetooth: btnxpuart: support multiple init baudrates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Catalin,

Thank you for your patch. I have some comments below.

> 
> We need to support simultaneously different versions of the same chip that
> are using different baudrates (example: engineering and production samples).
> This happens typically when OTP has been modified and new primary
> baudrate is being used. As there's no other way to detect the correct
> baudrate, we need the driver to go through the list of configured baudrates
> and try each one out until it finds the matching one.
By design, it is expected for customer to know the OTP setting in the chip from respective module vendor documentation and mention the value in device tree property fw-init-baudrate.
Please check with your module vendor to synchronize the OTP settings in engineering and production chips.
Feel free to create a ticket in our customer support portal (https://www.nxp.com/support/support:SUPPORTHOME) for any queries.

> @@ static int nxp_setup(struct hci_dev *hdev)
>                 clear_bit(BTNXPUART_FW_DOWNLOADING, &nxpdev->tx_state);
>         }
> 
> -       serdev_device_set_baudrate(nxpdev->serdev, nxpdev-
> >fw_init_baudrate);
> -       nxpdev->current_baudrate = nxpdev->fw_init_baudrate;
> +       for (i = 0; i < ARRAY_SIZE(nxpdev->fw_init_baudrate); i++) {
> +               serdev_device_set_baudrate(nxpdev->serdev, nxpdev-
> >fw_init_baudrate[i]);
> +               nxpdev->current_baudrate = nxpdev->fw_init_baudrate[i];
> +
> +               if (nxpdev->current_baudrate != HCI_NXP_SEC_BAUDRATE) {
> +                       nxpdev->new_baudrate = HCI_NXP_SEC_BAUDRATE;
> +                       err = nxp_set_baudrate_cmd(hdev, NULL);
> +                       if (err)
> +                               continue;
> +               }
> 
> -       if (nxpdev->current_baudrate != HCI_NXP_SEC_BAUDRATE) {
> -               nxpdev->new_baudrate = HCI_NXP_SEC_BAUDRATE;
> -               hci_cmd_sync_queue(hdev, nxp_set_baudrate_cmd, NULL, NULL);
> +               nxpdev->fw_primary_baudrate = nxpdev->fw_init_baudrate[i];
> +               bt_dev_dbg(hdev, "Using primary baudrate %d", nxpdev-
> >fw_primary_baudrate);
> +               break;
>         }
Looping through a fw-init-baudrate array and finding correct baudrate through trial-and-error method would increase initialization time by 2 seconds for each failed iteration. (command timeout)
This will affect other customers who are critical about the time it takes for hci interface to be up after device bootup.

Thanks,
Neeraj





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux