[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<AS4PR04MB969273C25C97907BF890533BE78B2@AS4PR04MB9692.eurprd04.prod.outlook.com>
Date: Mon, 26 Aug 2024 08:50:30 +0000
From: Neeraj Sanjay Kale <neeraj.sanjaykale@....com>
To: Catalin Popescu <catalin.popescu@...ca-geosystems.com>, Amitkumar Karwar
<amitkumar.karwar@....com>, "marcel@...tmann.org" <marcel@...tmann.org>,
"luiz.dentz@...il.com" <luiz.dentz@...il.com>, "davem@...emloft.net"
<davem@...emloft.net>, "edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>, "pabeni@...hat.com" <pabeni@...hat.com>,
"robh@...nel.org" <robh@...nel.org>, "krzk+dt@...nel.org"
<krzk+dt@...nel.org>, "conor+dt@...nel.org" <conor+dt@...nel.org>
CC: "linux-bluetooth@...r.kernel.org" <linux-bluetooth@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"bsp-development.geo@...ca-geosystems.com"
<bsp-development.geo@...ca-geosystems.com>,
"customers.leicageo@...gutronix.de" <customers.leicageo@...gutronix.de>
Subject: [PATCH next 2/2] Bluetooth: btnxpuart: support multiple init
baudrates
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
Powered by blists - more mailing lists