mbox series

[0/5] qcom: wcnss: Allow overriding firmware form DT

Message ID 20210312003318.3273536-1-bjorn.andersson@linaro.org
Headers show
Series qcom: wcnss: Allow overriding firmware form DT | expand

Message

Bjorn Andersson March 12, 2021, 12:33 a.m. UTC
The wireless subsystem found in Qualcomm MSM8974 and MSM8916 among others needs
platform-, and perhaps even board-, specific firmware. Add support for
providing this in devicetree.

Bjorn Andersson (5):
  dt-bindings: soc: qcom: wcnss: Add firmware-name property
  wcn36xx: Allow firmware name to be overridden by DT
  soc: qcom: wcnss_ctrl: Introduce local variable "dev"
  soc: qcom: wcnss_ctrl: Allow reading firmware-name from DT
  arm64: dts: qcom: msm8916: Enable modem and WiFi

 .../devicetree/bindings/soc/qcom/qcom,wcnss.txt   |  7 +++++++
 arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi         | 12 ++++++++++++
 arch/arm64/boot/dts/qcom/msm8916.dtsi             |  2 +-
 drivers/net/wireless/ath/wcn36xx/main.c           |  7 +++++++
 drivers/net/wireless/ath/wcn36xx/smd.c            |  4 ++--
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h        |  1 +
 drivers/soc/qcom/wcnss_ctrl.c                     | 15 ++++++++++-----
 7 files changed, 40 insertions(+), 8 deletions(-)

Comments

Bryan O'Donoghue March 15, 2021, 11:57 a.m. UTC | #1
On 12/03/2021 00:33, Bjorn Andersson wrote:
> The WLAN NV firmware blob differs between platforms, and possibly
> devices, so add support in the wcnss_ctrl driver for reading the path of
> this file from DT in order to allow these files to live in a generic
> file system (or linux-firmware).
> 
> The new property is optional and the code falls back to the old filename
> if the property isn't specified.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
>   drivers/soc/qcom/wcnss_ctrl.c | 10 +++++++---
>   1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/soc/qcom/wcnss_ctrl.c b/drivers/soc/qcom/wcnss_ctrl.c
> index 358526b9de06..2a06d631e415 100644
> --- a/drivers/soc/qcom/wcnss_ctrl.c
> +++ b/drivers/soc/qcom/wcnss_ctrl.c
> @@ -200,6 +200,7 @@ static int wcnss_download_nv(struct wcnss_ctrl *wcnss, bool *expect_cbc)
>   	struct wcnss_download_nv_req *req;
>   	const struct firmware *fw;
>   	struct device *dev = wcnss->dev;
> +	const char *nvbin = NVBIN_FILE;
>   	const void *data;
>   	ssize_t left;
>   	int ret;
> @@ -208,10 +209,13 @@ static int wcnss_download_nv(struct wcnss_ctrl *wcnss, bool *expect_cbc)
>   	if (!req)
>   		return -ENOMEM;
>   
> -	ret = request_firmware(&fw, NVBIN_FILE, dev);
> +	ret = of_property_read_string(dev->of_node, "firmware-name", &nvbin);
> +	if (ret < 0 && ret != -EINVAL)
> +		goto free_req;
> +
> +	ret = request_firmware(&fw, nvbin, dev);
>   	if (ret < 0) {
> -		dev_err(dev, "Failed to load nv file %s: %d\n",
> -			NVBIN_FILE, ret);
> +		dev_err(dev, "Failed to load nv file %s: %d\n", nvbin, ret);
>   		goto free_req;
>   	}
>   
> 

Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Vinod Koul March 18, 2021, 4:48 p.m. UTC | #2
On 11-03-21, 16:33, Bjorn Andersson wrote:
> The wireless subsystem found in Qualcomm MSM8974 and MSM8916 among others needs
> platform-, and perhaps even board-, specific firmware. Add support for
> providing this in devicetree.

Reviewed-by: Vinod Koul <vkoul@kernel.org>
Jeffrey Hugo March 18, 2021, 4:56 p.m. UTC | #3
form -> from in the subject?

On Thu, Mar 11, 2021 at 5:34 PM Bjorn Andersson
<bjorn.andersson@linaro.org> wrote:
>
> The wireless subsystem found in Qualcomm MSM8974 and MSM8916 among others needs
> platform-, and perhaps even board-, specific firmware. Add support for
> providing this in devicetree.
Bjorn Andersson March 18, 2021, 5:06 p.m. UTC | #4
On Thu 18 Mar 11:56 CDT 2021, Jeffrey Hugo wrote:

> form -> from in the subject?
> 

Seems like I only failed in the cover letter, right?

Regards,
Bjorn

> On Thu, Mar 11, 2021 at 5:34 PM Bjorn Andersson
> <bjorn.andersson@linaro.org> wrote:
> >
> > The wireless subsystem found in Qualcomm MSM8974 and MSM8916 among others needs
> > platform-, and perhaps even board-, specific firmware. Add support for
> > providing this in devicetree.
Jeffrey Hugo March 18, 2021, 6:12 p.m. UTC | #5
On Thu, Mar 18, 2021 at 11:06 AM Bjorn Andersson
<bjorn.andersson@linaro.org> wrote:
>
> On Thu 18 Mar 11:56 CDT 2021, Jeffrey Hugo wrote:
>
> > form -> from in the subject?
> >
>
> Seems like I only failed in the cover letter, right?

Looks like.  I didn't even parse that this was the cover letter.

Nothing to see here.