[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y+pULHm2Qys738Zg@kroah.com>
Date: Mon, 13 Feb 2023 16:15:56 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: Neeraj Sanjay Kale <neeraj.sanjaykale@....com>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, marcel@...tmann.org,
johan.hedberg@...il.com, luiz.dentz@...il.com,
jirislaby@...nel.org, alok.a.tiwari@...cle.com, hdanton@...a.com,
ilpo.jarvinen@...ux.intel.com, leon@...nel.org,
netdev@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-bluetooth@...r.kernel.org,
linux-serial@...r.kernel.org, amitkumar.karwar@....com,
rohit.fule@....com, sherry.sun@....com
Subject: Re: [PATCH v3 3/3] Bluetooth: NXP: Add protocol support for NXP
Bluetooth chipsets
On Mon, Feb 13, 2023 at 08:24:32PM +0530, Neeraj Sanjay Kale wrote:
> This adds a driver based on serdev driver for the NXP BT serial
> protocol based on running H:4, which can enable the built-in
> Bluetooth device inside a generic NXP BT chip.
>
> This driver has Power Save feature that will put the chip into
> sleep state whenever there is no activity for 2000ms, and will
> be woken up when any activity is to be initiated over UART.
>
> This driver enables the power save feature by default by sending
> the vendor specific commands to the chip during setup.
>
> During setup, the driver checks if a FW is already running on the
> chip based on the CTS line, and downloads device specific FW file
> into the chip over UART.
>
> The driver contains certain device specific default parameters
> related to FW filename, baudrate and timeouts which can be
> overwritten by an optional user space config file. These parameters
> may vary from one module vendor to another.
>
> Signed-off-by: Neeraj Sanjay Kale <neeraj.sanjaykale@....com>
> ---
> v2: Removed conf file support and added static data for each chip
> based on compatibility devices mentioned in DT bindings. Handled
> potential memory leaks and null pointer dereference issues,
> simplified FW download feature, handled byte-order and few cosmetic
> changes. (Ilpo Järvinen, Alok Tiwari, Hillf Danton)
> v3: Added conf file support necessary to support different vendor
> modules, moved .h file contents to .c, cosmetic changes. (Luiz
> Augusto von Dentz, Rob Herring, Leon Romanovsky)
> ---
> drivers/bluetooth/Kconfig | 11 +
> drivers/bluetooth/Makefile | 1 +
> drivers/bluetooth/btnxpuart.c | 1370 +++++++++++++++++++++++++++++++++
> 3 files changed, 1382 insertions(+)
> create mode 100644 drivers/bluetooth/btnxpuart.c
>
> diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig
> index 5a1a7bec3c42..773b40d34b7b 100644
> --- a/drivers/bluetooth/Kconfig
> +++ b/drivers/bluetooth/Kconfig
> @@ -465,4 +465,15 @@ config BT_VIRTIO
> Say Y here to compile support for HCI over Virtio into the
> kernel or say M to compile as a module.
>
> +config BT_NXPUART
> + tristate "NXP protocol support"
> + depends on SERIAL_DEV_BUS
> + help
> + NXP is serial driver required for NXP Bluetooth
> + devices with UART interface.
> +
> + Say Y here to compile support for NXP Bluetooth UART device into
> + the kernel, or say M here to compile as a module.
What is the module name?
> +#define MAX_TAG_STR_LEN 20
> +#define BT_FW_CONF_FILE "nxp/bt_mod_para.conf"
You can not load "configuration files" as firmware, as that is not what
firmware is for.
Firmware is to be sent straight to the device, the kernel is not
supposed to do any parsing like you are doing:
> +#define USER_CONFIG_TAG "user_config"
> +#define FW_NAME_TAG "fw_name"
> +#define OPER_SPEED_TAG "oper_speed"
> +#define FW_DL_PRI_BAUDRATE_TAG "fw_dl_pri_speed"
> +#define FW_DL_SEC_BAUDRATE_TAG "fw_dl_sec_speed"
> +#define FW_INIT_BAUDRATE "fw_init_speed"
> +#define PS_INTERVAL_MS "ps_interval_ms"
With these values.
Please use the normal kernel interfaces for configuring your device.
that is NOT the firmware interface, sorry.
thanks,
greg k-h
Powered by blists - more mailing lists