From patchwork Wed Feb 12 15:46:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9_=28eBPF_Foundation=29?= X-Patchwork-Id: 13971997 X-Patchwork-Delegate: kuba@kernel.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B851A207667; Wed, 12 Feb 2025 15:47:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375272; cv=none; b=l8Eobbf43zqqgS1nTCif7WJN4SNHSmkv1sMyZjHHMsSQGdXr3hzXRK0HGj1q7B9jmt4+gyGYTWE7ev0T4ryvWe9zU5Cj8GgknLzkSCPzMXS+b9bh5TzZF1fjJuDwSkCq5y8GeUbpIbTMYXf7sQrz32KbRZvcJiiEtKnOgYPTTJM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375272; c=relaxed/simple; bh=JiiR9fVcT1igBQ8zQ9MI3IXIacvn9Y0GMWLLsV26JlQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RrS0bteHymRvaRPppfNm8iyJOAIxGPmN+GAjVHWsVS7RBGKDT9Z1iwhx6h60HksTR3UZo9VrNXhXd4gg/zddssuBG19PKKvw1sIWoMV7Y4OP7G2xR3dkFMEfUbr9M4BaUxXAyxtwl5HD42NN90NzUJlxiMtjfnhNVwXscuyZtmY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=GqpzyR3I; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="GqpzyR3I" Received: by mail.gandi.net (Postfix) with ESMTPSA id A2981440F0; Wed, 12 Feb 2025 15:47:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1739375267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EeJr9FDsSYw8HIYplOiopf+69p0J/ihX2v3ROipEQ7M=; b=GqpzyR3I4uTG51rFsmP2OeUzCa08P781lS4wsNvNHRNmd/hynSxYClZvWG9WFq2IegO/w1 A51zUmwAIb0tOVWCNvmAm9n0/A10chDETCHI+1HKsHM/Ovz2OSajwF00FkXJnJE/C15SAs 1GkkhvqpLHoqtvNznIDUPJ/QO7jw2R03OEZe0dPHPfZ/rAprtx/OaRnE5ajysaKp7aiJaD NJAPcz7JIiZ2rrwNQdGBgQQl82Varuc7mZ5G61xLisFjCSzBSTTEG6P398TclZh2xpV16S ECf/mp+xCkm4t/Rvk0jOMaTYbLNCBc6adWLKI2NJXyi9GNSzbQy7l/aWePLSdw== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Wed, 12 Feb 2025 16:46:20 +0100 Subject: [PATCH 01/12] dt-bindings: bluetooth: describe wilc 3000 bluetooth chip Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250212-wilc3000_bt-v1-1-9609b784874e@bootlin.com> References: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> In-Reply-To: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> To: =?utf-8?q?Alexis_Lothor=C3=A9?= , Marcel Holtmann , Luiz Augusto von Dentz , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ajay Singh , Claudiu Beznea , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Nicolas Ferre , Alexandre Belloni Cc: Marek Vasut , Thomas Petazzoni , linux-bluetooth@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeggedvkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtkeertdertdejnecuhfhrohhmpeetlhgvgihishcunfhothhhohhrrocuoegrlhgvgihishdrlhhothhhohhrvgessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnhepjedtjeetgeduueefffevueeuheffudffleehhffgjeefkeeguefhvdejvdekjeeknecuffhomhgrihhnpeguvghvihgtvghtrhgvvgdrohhrghenucfkphepvdgrtddvmeekgedvkeemfhelgegtmegvtddtmeemfhekheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvrgdtvdemkeegvdekmehfleegtgemvgdttdemmehfkeehpdhhvghloheplgduledvrdduieekrddurdduleejngdpmhgrihhlfhhrohhmpegrlhgvgihishdrlhhothhhohhrvgessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepvdegpdhrtghpthhtoheptghonhhorhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehrohgshheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepuggvvhhit ggvthhrvggvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepkhhriihkodgutheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepkhhusggrsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdgrrhhmqdhkvghrnhgvlheslhhishhtshdrihhnfhhrrgguvggrugdrohhrghdprhgtphhtthhopehluhhiiidruggvnhhtiiesghhmrghilhdrtghomh X-GND-Sasl: alexis.lothore@bootlin.com X-Patchwork-Delegate: kuba@kernel.org WILC3000 is a combo chip providing 802.11b/g/n and Bluetooth 5. The wlan part is exposed either through SDIO or SPI interface, and the bluetooth part is exposed through uart. The notable peculiarity of this chip is that the bluetooth part is not fully autonomous: its firmware is not loaded through UART interface but through SDIO/SPI interface, so the bluetooth description needs a reference to the wlan part to get access to the corresponding bus. Signed-off-by: Alexis Lothoré --- .../net/bluetooth/microchip,wilc3000-bt.yaml | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Documentation/devicetree/bindings/net/bluetooth/microchip,wilc3000-bt.yaml b/Documentation/devicetree/bindings/net/bluetooth/microchip,wilc3000-bt.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2a83ca3ad90b26fd619b574bc343bee9654a1e43 --- /dev/null +++ b/Documentation/devicetree/bindings/net/bluetooth/microchip,wilc3000-bt.yaml @@ -0,0 +1,41 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/bluetooth/microchip,wilc3000-bt.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip Bluetooth chips + +description: + This binding describes UART-attached Microchip bluetooth chips. These + chips are dual-radio chips supporting WiFi and Bluetooth. The bluetooth + side works with standard HCI commands over 4-wires UART (with flow + control) + +maintainers: + - Alexis Lothoré + +properties: + compatible: + enum: + - microchip,wilc3000-bt + + wlan: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to the wlan part of the combo chip + +required: + - compatible + - wlan + +additionalProperties: false + +examples: + - | + serial { + bluetooth { + compatible = "microchip,wilc3000-bt"; + wlan = <&wifi>; + }; + }; From patchwork Wed Feb 12 15:46:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9_=28eBPF_Foundation=29?= X-Patchwork-Id: 13971998 X-Patchwork-Delegate: kuba@kernel.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB7BA20B210; Wed, 12 Feb 2025 15:47:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375273; cv=none; b=PgbaB36jVzxWo6i+YxXV4JRLZAbiKLnG0XtweCFEfbO1H+N6Qb4HkCIaGVT+/hqHDusIxbcqMgVJuVhwoAVOUYTSzXNn0Hh9eSq5lU9ik8P1Pr3NOfK5K1iswBfQNoYInGqgQy22NvcWpS3mhrynn0kRBx9ehu9YtJ6CwE5Gbsc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375273; c=relaxed/simple; bh=1jztkzYD9KJ/1fJA6MUcU0W065d9PyvnLOCcHtgK/nM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=R3Dqu8ITmfvqm1msPVnZGOXwaarNAI0PT4b5BXdHS8NC/rzlGvJlsDIGj7zp9JWZiaGGJ7v7GaOXnBmDaphfr3gB4d1cea4hUwzBonIapcVcf3Avno00TNZZKi4qsvW9YNAB3thvpru3pv3/RcVmMwrDBxVXnCrwcn64Vb1RlDc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=AsR2Kr+r; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="AsR2Kr+r" Received: by mail.gandi.net (Postfix) with ESMTPSA id CC5D8440FF; Wed, 12 Feb 2025 15:47:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1739375268; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w7OFME9i2IUPBCJlachFUyekEY4wChv9lVNTlta/qgw=; b=AsR2Kr+r0EsfCT0bRR50j86StsO7qBNICof/C8pNBJ9MSjy+WFLvVLL5dcJDVzjlT1+q3r 57rTr179uIMOj88U4BHO1/nsJdJXgCOeFm6VxNOu5NGcHEJUjju9ZvFVAidGTBVIf9545+ JRaA5ObSMEGC0kM8OYoJ04DKOpS3eQmVTcQA2f4z4NPMPyhfDEUF5nt1aWJak5xeM8S+tI /7JAwzJWgqRI+KWpdgEEy/MAt26N34VUK0/SDa/IQiUyirEqvNuwMTA+KZg3Ur8KIFY5do wrwQ1rq0OHH7OQI2NLoVsGq8scg5HX5wHJxOPuDUSNJZh43HYrweV3mtIAXUUQ== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Wed, 12 Feb 2025 16:46:21 +0100 Subject: [PATCH 02/12] wifi: wilc1000: add a read-modify-write API for registers accesses Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250212-wilc3000_bt-v1-2-9609b784874e@bootlin.com> References: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> In-Reply-To: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> To: =?utf-8?q?Alexis_Lothor=C3=A9?= , Marcel Holtmann , Luiz Augusto von Dentz , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ajay Singh , Claudiu Beznea , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Nicolas Ferre , Alexandre Belloni Cc: Marek Vasut , Thomas Petazzoni , linux-bluetooth@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeggedvkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtkeertdertdejnecuhfhrohhmpeetlhgvgihishcunfhothhhohhrrocuoegrlhgvgihishdrlhhothhhohhrvgessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnhepgeevgefhteffuefhheekkeelffffvdeugffgveejffdtvdffudehtedtieevteetnecukfhppedvrgdtvdemkeegvdekmehfleegtgemvgdttdemmehfkeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdgrtddvmeekgedvkeemfhelgegtmegvtddtmeemfhekhedphhgvlhhopegludelvddrudeikedruddrudeljegnpdhmrghilhhfrhhomheprghlvgigihhsrdhlohhthhhorhgvsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopedvgedprhgtphhtthhopegtohhnohhrodgutheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhosghhsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopeguvghvihgtvghtrhgvvgesvhhgvghrrdhkvghrnhgvlhdrohhrghdpr hgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehkuhgsrgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrghrmhdqkhgvrhhnvghlsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtoheplhhuihiirdguvghnthiisehgmhgrihhlrdgtohhm X-GND-Sasl: alexis.lothore@bootlin.com X-Patchwork-Delegate: kuba@kernel.org Many places in wilc driver need to modify a single bit in a register, and then perform the following sequence: read the register, set/reset the needed bit, write the register. This sequence is performed in multiple places in the driver, with a varying amount of checks around possible errors. Replace all those sequences with a new hif_rmw_reg helper. Make sure to perform the write only if needed. Signed-off-by: Alexis Lothoré --- Since the registers meaning and effect is pretty opaque, this commit tries to remain conservative and converts only the "real" read-modify-write sequences: bare writes seemingly trying to affect a single bit but actually affecting the whole register are left untouched. --- drivers/net/wireless/microchip/wilc1000/sdio.c | 68 ++++++------ drivers/net/wireless/microchip/wilc1000/spi.c | 18 +++ drivers/net/wireless/microchip/wilc1000/wlan.c | 145 +++++++++---------------- drivers/net/wireless/microchip/wilc1000/wlan.h | 3 + 4 files changed, 105 insertions(+), 129 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/sdio.c b/drivers/net/wireless/microchip/wilc1000/sdio.c index af970f9991110807ebd880681ad0e8aaf8a0b9bc..7eab1c493774e197e43bdf265063aa8c5e6dff14 100644 --- a/drivers/net/wireless/microchip/wilc1000/sdio.c +++ b/drivers/net/wireless/microchip/wilc1000/sdio.c @@ -916,6 +916,7 @@ static int wilc_sdio_sync_ext(struct wilc *wilc, int nint) { struct sdio_func *func = dev_to_sdio_func(wilc->dev); struct wilc_sdio *sdio_priv = wilc->bus_data; + u32 int_en_mask = 0; if (nint > MAX_NUM_INT) { dev_err(&func->dev, "Too many interrupts (%d)...\n", nint); @@ -923,61 +924,42 @@ static int wilc_sdio_sync_ext(struct wilc *wilc, int nint) } if (sdio_priv->irq_gpio) { - u32 reg; int ret, i; /** * interrupt pin mux select **/ - ret = wilc_sdio_read_reg(wilc, WILC_PIN_MUX_0, ®); + ret = wilc->hif_func->hif_rmw_reg(wilc, WILC_PIN_MUX_0, BIT(8), + BIT(8)); if (ret) { - dev_err(&func->dev, "Failed read reg (%08x)...\n", - WILC_PIN_MUX_0); - return ret; - } - reg |= BIT(8); - ret = wilc_sdio_write_reg(wilc, WILC_PIN_MUX_0, reg); - if (ret) { - dev_err(&func->dev, "Failed write reg (%08x)...\n", - WILC_PIN_MUX_0); + dev_err(&func->dev, "Failed to set interrupt mux\n"); return ret; } /** * interrupt enable **/ - ret = wilc_sdio_read_reg(wilc, WILC_INTR_ENABLE, ®); - if (ret) { - dev_err(&func->dev, "Failed read reg (%08x)...\n", - WILC_INTR_ENABLE); - return ret; - } - for (i = 0; (i < 5) && (nint > 0); i++, nint--) - reg |= BIT((27 + i)); - ret = wilc_sdio_write_reg(wilc, WILC_INTR_ENABLE, reg); + int_en_mask |= BIT(WILC_INTR_ENABLE_BIT_BASE + i); + ret = wilc->hif_func->hif_rmw_reg(wilc, WILC_INTR_ENABLE, + int_en_mask, int_en_mask); if (ret) { - dev_err(&func->dev, "Failed write reg (%08x)...\n", - WILC_INTR_ENABLE); + dev_err(&func->dev, "Failed to enable interrupts\n"); return ret; } - if (nint) { - ret = wilc_sdio_read_reg(wilc, WILC_INTR2_ENABLE, ®); - if (ret) { - dev_err(&func->dev, - "Failed read reg (%08x)...\n", - WILC_INTR2_ENABLE); - return ret; - } + if (nint) { + int_en_mask = 0; for (i = 0; (i < 3) && (nint > 0); i++, nint--) - reg |= BIT(i); + int_en_mask |= BIT(i); - ret = wilc_sdio_write_reg(wilc, WILC_INTR2_ENABLE, reg); + ret = wilc->hif_func->hif_rmw_reg(wilc, + WILC_INTR2_ENABLE, + int_en_mask, + int_en_mask); if (ret) { dev_err(&func->dev, - "Failed write reg (%08x)...\n", - WILC_INTR2_ENABLE); + "Failed to enable internal interrupts\n"); return ret; } } @@ -985,6 +967,23 @@ static int wilc_sdio_sync_ext(struct wilc *wilc, int nint) return 0; } +static int wilc_sdio_rmw_reg(struct wilc *wilc, u32 reg, u32 mask, u32 data) +{ + u32 old_val, new_val; + int ret = 0; + + ret = wilc_sdio_read_reg(wilc, reg, &old_val); + if (ret) + return ret; + + new_val = old_val & ~mask; + new_val |= data; + if (new_val != old_val) + ret = wilc_sdio_write_reg(wilc, reg, new_val); + + return ret; +} + /* Global sdio HIF function table */ static const struct wilc_hif_func wilc_hif_sdio = { .hif_init = wilc_sdio_init, @@ -1003,6 +1002,7 @@ static const struct wilc_hif_func wilc_hif_sdio = { .disable_interrupt = wilc_sdio_disable_interrupt, .hif_reset = wilc_sdio_reset, .hif_is_init = wilc_sdio_is_init, + .hif_rmw_reg = wilc_sdio_rmw_reg }; static int wilc_sdio_suspend(struct device *dev) diff --git a/drivers/net/wireless/microchip/wilc1000/spi.c b/drivers/net/wireless/microchip/wilc1000/spi.c index 5bcabb7decea0fc8d0065a240f4acefabca3346a..aae4262045ff3e5f3668493ef235486e601996f7 100644 --- a/drivers/net/wireless/microchip/wilc1000/spi.c +++ b/drivers/net/wireless/microchip/wilc1000/spi.c @@ -1355,6 +1355,23 @@ static int wilc_spi_sync_ext(struct wilc *wilc, int nint) return 0; } +static int wilc_spi_rmw_reg(struct wilc *wilc, u32 reg, u32 mask, u32 data) +{ + u32 old_val, new_val; + int ret = 0; + + ret = wilc_spi_read_reg(wilc, reg, &old_val); + if (ret) + return ret; + + new_val = old_val & ~mask; + new_val |= data; + if (new_val != old_val) + ret = wilc_spi_write_reg(wilc, reg, new_val); + + return ret; +} + /* Global spi HIF function table */ static const struct wilc_hif_func wilc_hif_spi = { .hif_init = wilc_spi_init, @@ -1371,4 +1388,5 @@ static const struct wilc_hif_func wilc_hif_spi = { .hif_sync_ext = wilc_spi_sync_ext, .hif_reset = wilc_spi_reset, .hif_is_init = wilc_spi_is_init, + .hif_rmw_reg = wilc_spi_rmw_reg }; diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c index 9d80adc45d6be14c8818e8ef1643db6875cf57d2..f2b13bd44273ebe2ee474eda047e82bf1287bd6e 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.c +++ b/drivers/net/wireless/microchip/wilc1000/wlan.c @@ -578,53 +578,27 @@ static int chip_allow_sleep_wilc1000(struct wilc *wilc) pr_warn("FW not responding\n"); /* Clear bit 1 */ - ret = hif_func->hif_read_reg(wilc, wakeup_reg, ®); + ret = wilc->hif_func->hif_rmw_reg(wilc, wakeup_reg, wakeup_bit, 0); if (ret) return ret; - if (reg & wakeup_bit) { - reg &= ~wakeup_bit; - ret = hif_func->hif_write_reg(wilc, wakeup_reg, reg); - if (ret) - return ret; - } - ret = hif_func->hif_read_reg(wilc, from_host_to_fw_reg, ®); + ret = wilc->hif_func->hif_rmw_reg(wilc, from_host_to_fw_reg, + from_host_to_fw_bit, 0); if (ret) return ret; - if (reg & from_host_to_fw_bit) { - reg &= ~from_host_to_fw_bit; - ret = hif_func->hif_write_reg(wilc, from_host_to_fw_reg, reg); - if (ret) - return ret; - } return 0; } static int chip_allow_sleep_wilc3000(struct wilc *wilc) { - u32 reg = 0; int ret; - const struct wilc_hif_func *hif_func = wilc->hif_func; + u32 wake_bit = wilc->io_type == WILC_HIF_SDIO ? WILC_SDIO_WAKEUP_BIT : + WILC_SPI_WAKEUP_BIT; - if (wilc->io_type == WILC_HIF_SDIO) { - ret = hif_func->hif_read_reg(wilc, WILC_SDIO_WAKEUP_REG, ®); - if (ret) - return ret; - ret = hif_func->hif_write_reg(wilc, WILC_SDIO_WAKEUP_REG, - reg & ~WILC_SDIO_WAKEUP_BIT); - if (ret) - return ret; - } else { - ret = hif_func->hif_read_reg(wilc, WILC_SPI_WAKEUP_REG, ®); - if (ret) - return ret; - ret = hif_func->hif_write_reg(wilc, WILC_SPI_WAKEUP_REG, - reg & ~WILC_SPI_WAKEUP_BIT); - if (ret) - return ret; - } - return 0; + ret = wilc->hif_func->hif_rmw_reg(wilc, WILC_SDIO_WAKEUP_REG, wake_bit, + 0); + return ret; } static int chip_allow_sleep(struct wilc *wilc) @@ -699,10 +673,10 @@ static int chip_wakeup_wilc1000(struct wilc *wilc) static int chip_wakeup_wilc3000(struct wilc *wilc) { - u32 wakeup_reg_val, clk_status_reg_val, trials = 0; - u32 wakeup_reg, wakeup_bit; + u32 clk_status_reg_val, trials = 0; u32 clk_status_reg, clk_status_bit; - int wake_seq_trials = 5; + int wake_seq_trials = 5, ret; + u32 wakeup_reg, wakeup_bit; const struct wilc_hif_func *hif_func = wilc->hif_func; if (wilc->io_type == WILC_HIF_SDIO) { @@ -717,10 +691,12 @@ static int chip_wakeup_wilc3000(struct wilc *wilc) clk_status_bit = WILC3000_SPI_CLK_STATUS_BIT; } - hif_func->hif_read_reg(wilc, wakeup_reg, &wakeup_reg_val); do { - hif_func->hif_write_reg(wilc, wakeup_reg, wakeup_reg_val | - wakeup_bit); + ret = hif_func->hif_rmw_reg(wilc, wakeup_reg, wakeup_bit, + wakeup_bit); + if (ret) + dev_warn(wilc->dev, "Failed to set wake bit\n"); + /* Check the clock status */ hif_func->hif_read_reg(wilc, clk_status_reg, &clk_status_reg_val); @@ -745,8 +721,10 @@ static int chip_wakeup_wilc3000(struct wilc *wilc) * edge on the next loop */ if ((clk_status_reg_val & clk_status_bit) == 0) { - hif_func->hif_write_reg(wilc, wakeup_reg, - wakeup_reg_val & (~wakeup_bit)); + ret = hif_func->hif_rmw_reg(wilc, wakeup_reg, + wakeup_bit, 0); + if (ret) + dev_warn(wilc->dev, "Failed to set CLK bit\n"); /* added wait before wakeup sequence retry */ usleep_range(200, 300); } @@ -996,11 +974,11 @@ int wilc_wlan_handle_txq(struct wilc *wilc, u32 *txq_count) break; if (entries == 0) { - ret = func->hif_read_reg(wilc, WILC_HOST_TX_CTRL, ®); + ret = wilc->hif_func->hif_rmw_reg(wilc, + WILC_HOST_TX_CTRL, BIT(0), 0); if (ret) - break; - reg &= ~BIT(0); - ret = func->hif_write_reg(wilc, WILC_HOST_TX_CTRL, reg); + dev_warn(wilc->dev, + "Failed to reset TX CTRL bit\n"); } } while (0); @@ -1267,9 +1245,12 @@ int wilc_wlan_firmware_download(struct wilc *wilc, const u8 *buffer, if (ret) return ret; - wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, ®); - reg &= ~BIT(10); - ret = wilc->hif_func->hif_write_reg(wilc, WILC_GLB_RESET_0, reg); + ret = wilc->hif_func->hif_rmw_reg(wilc, WILC_GLB_RESET_0, BIT(10), 0); + if (ret) { + dev_err(wilc->dev, "Failed to reset WLAN CPU\n"); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); + return ret; + } wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, ®); if (reg & BIT(10)) pr_err("%s: Failed to reset\n", __func__); @@ -1357,16 +1338,12 @@ int wilc_wlan_start(struct wilc *wilc) if (ret) goto release; - wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, ®); - if ((reg & BIT(10)) == BIT(10)) { - reg &= ~BIT(10); - wilc->hif_func->hif_write_reg(wilc, WILC_GLB_RESET_0, reg); - wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, ®); - } - - reg |= BIT(10); - ret = wilc->hif_func->hif_write_reg(wilc, WILC_GLB_RESET_0, reg); - wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, ®); + ret = wilc->hif_func->hif_rmw_reg(wilc, WILC_GLB_RESET_0, BIT(10), 0); + if (!ret) + ret = wilc->hif_func->hif_rmw_reg(wilc, WILC_GLB_RESET_0, + BIT(10), BIT(10)); + if (ret) + dev_warn(wilc->dev, "Failed to reset WLAN CPU\n"); release: rv = release_bus(wilc, WILC_BUS_RELEASE_ONLY); @@ -1375,44 +1352,31 @@ int wilc_wlan_start(struct wilc *wilc) int wilc_wlan_stop(struct wilc *wilc, struct wilc_vif *vif) { - u32 reg = 0; int ret, rv; ret = acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); if (ret) return ret; - ret = wilc->hif_func->hif_read_reg(wilc, GLOBAL_MODE_CONTROL, ®); - if (ret) - goto release; - - reg &= ~WILC_GLOBAL_MODE_ENABLE_WIFI; - ret = wilc->hif_func->hif_write_reg(wilc, GLOBAL_MODE_CONTROL, reg); - if (ret) - goto release; - - ret = wilc->hif_func->hif_read_reg(wilc, PWR_SEQ_MISC_CTRL, ®); - if (ret) - goto release; - - reg &= ~WILC_PWR_SEQ_ENABLE_WIFI_SLEEP; - ret = wilc->hif_func->hif_write_reg(wilc, PWR_SEQ_MISC_CTRL, reg); - if (ret) - goto release; - - ret = wilc->hif_func->hif_read_reg(wilc, WILC_GP_REG_0, ®); + ret = wilc->hif_func->hif_rmw_reg(wilc, GLOBAL_MODE_CONTROL, + WILC_GLOBAL_MODE_ENABLE_WIFI, 0); if (ret) { - netdev_err(vif->ndev, "Error while reading reg\n"); + netdev_err(vif->ndev, "Failed to disable wlan control\n"); goto release; } - ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_0, - (reg | WILC_ABORT_REQ_BIT)); + ret = wilc->hif_func->hif_rmw_reg(wilc, PWR_SEQ_MISC_CTRL, + WILC_PWR_SEQ_ENABLE_WIFI_SLEEP, 0); if (ret) { - netdev_err(vif->ndev, "Error while writing reg\n"); + netdev_err(vif->ndev, "Failed to unmux wlan power seq\n"); goto release; } + ret = wilc->hif_func->hif_rmw_reg(wilc, WILC_GP_REG_0, + WILC_ABORT_REQ_BIT, 1); + if (ret) + netdev_err(vif->ndev, "Failed to stop wlan CPU\n"); + ret = 0; release: /* host comm is disabled - we can't issue sleep command anymore: */ @@ -1641,19 +1605,10 @@ static int init_chip(struct net_device *dev) goto release; if ((wilc->chipid & 0xfff) != 0xa0) { - ret = wilc->hif_func->hif_read_reg(wilc, - WILC_CORTUS_RESET_MUX_SEL, - ®); - if (ret) { - netdev_err(dev, "fail read reg 0x1118\n"); - goto release; - } - reg |= BIT(0); - ret = wilc->hif_func->hif_write_reg(wilc, - WILC_CORTUS_RESET_MUX_SEL, - reg); + ret = wilc->hif_func->hif_rmw_reg(wilc, + WILC_CORTUS_RESET_MUX_SEL, BIT(0), BIT(0)); if (ret) { - netdev_err(dev, "fail write reg 0x1118\n"); + netdev_err(dev, "Failed to enable WLAN global reset\n"); goto release; } ret = wilc->hif_func->hif_write_reg(wilc, diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.h b/drivers/net/wireless/microchip/wilc1000/wlan.h index b9e7f9222eadde6d736e1d0a403f84ec19399632..65e79371014d9e60755cb0aa38e04d351e67bcfb 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.h +++ b/drivers/net/wireless/microchip/wilc1000/wlan.h @@ -58,6 +58,7 @@ #define WILC_HOST_TX_CTRL_1 (WILC_PERIPH_REG_BASE + 0x88) #define WILC_INTR_REG_BASE (WILC_PERIPH_REG_BASE + 0xa00) #define WILC_INTR_ENABLE WILC_INTR_REG_BASE +#define WILC_INTR_ENABLE_BIT_BASE 27 #define WILC_INTR2_ENABLE (WILC_INTR_REG_BASE + 4) #define WILC_INTR_POLARITY (WILC_INTR_REG_BASE + 0x10) @@ -403,6 +404,7 @@ struct wilc_hif_func { void (*disable_interrupt)(struct wilc *nic); int (*hif_reset)(struct wilc *wilc); bool (*hif_is_init)(struct wilc *wilc); + int (*hif_rmw_reg)(struct wilc *wilc, u32 reg, u32 mask, u32 data); }; #define WILC_MAX_CFG_FRAME_SIZE 1468 @@ -472,4 +474,5 @@ int wilc_send_config_pkt(struct wilc_vif *vif, u8 mode, struct wid *wids, int wilc_wlan_init(struct net_device *dev); int wilc_get_chipid(struct wilc *wilc); int wilc_load_mac_from_nv(struct wilc *wilc); + #endif From patchwork Wed Feb 12 15:46:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9_=28eBPF_Foundation=29?= X-Patchwork-Id: 13971999 X-Patchwork-Delegate: kuba@kernel.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F1EE21772B; Wed, 12 Feb 2025 15:47:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375274; cv=none; b=CRCXEqG3GO6QUao2uPP0pRMJTv9wucNYgh+vBiUAJzvRZmdbi4ItGp+Rc2bLgCZdNc4+GRspOzXOtvFjo++BoB2Rzv1zEYgzQVIVOTA7OvXq1kNYrYIzgxkgEHzfYd1P74UVpv91j5o3oFpn82EX/GsNvjqjTDQPftfpdAeNGT4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375274; c=relaxed/simple; bh=Mlv81zmIhEZHJwT/hcQ3yQ6ZyHpYyAKt5h56HYPA/ZI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RnqYZWDlecnhQarlY7Q1ZFOcHy/+p9hvZwdPlNGqcSkBc0/3JvVon9pIA2QFMVWZxBUY5mbYeZJBeEeuqqz0+TccTs+3zr5QwmcG4s3N4DAIl3ZsYZU0hYy1BrxS99ELFOEBAuSLlCEugNpn/ucFdHkVSW8hiwoTZHqezI2GftI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=bWhR95VJ; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="bWhR95VJ" Received: by mail.gandi.net (Postfix) with ESMTPSA id 09DA1440FB; Wed, 12 Feb 2025 15:47:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1739375270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3fD1k5bMIW/imRQuzK5KhvhuylFhJp7j2W2nlf3giUE=; b=bWhR95VJSQ5uC0Sndhv/pxDenw+gX0dRpNFdgQqPWiD91pebWItUJdF7NB4RPGLQ8wl8nl GzgiZeiT8vYFJIsXBuf2C8sMvDFiGHOG5+Xq1dU0385nrdyGp/o0jA6HfVkmDJTLoiK42r cECb4VyA8zCdQv/5hiV5tzuV1kDfMWQ8LIHV2feTZlGPW7N0Pa11gKqaSjh360msfQPQ+M cifWlglhSf6M4hT+ELh6sMeMTBTBI0HhjFfg9ZHwvX/Y2ClOqR5fZ1KgjPGIuWoD/MjWIj Zg9rvDivxMjKIteLEfJBhlPH6ZVrne6QjQ3iXkcPenJUOHiuGawqL6ikkMLhhg== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Wed, 12 Feb 2025 16:46:22 +0100 Subject: [PATCH 03/12] wifi: wilc1000: add lock to prevent concurrent firmware startup Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250212-wilc3000_bt-v1-3-9609b784874e@bootlin.com> References: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> In-Reply-To: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> To: =?utf-8?q?Alexis_Lothor=C3=A9?= , Marcel Holtmann , Luiz Augusto von Dentz , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ajay Singh , Claudiu Beznea , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Nicolas Ferre , Alexandre Belloni Cc: Marek Vasut , Thomas Petazzoni , linux-bluetooth@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeggedvkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtkeertdertdejnecuhfhrohhmpeetlhgvgihishcunfhothhhohhrrocuoegrlhgvgihishdrlhhothhhohhrvgessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnhepgeevgefhteffuefhheekkeelffffvdeugffgveejffdtvdffudehtedtieevteetnecukfhppedvrgdtvdemkeegvdekmehfleegtgemvgdttdemmehfkeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdgrtddvmeekgedvkeemfhelgegtmegvtddtmeemfhekhedphhgvlhhopegludelvddrudeikedruddrudeljegnpdhmrghilhhfrhhomheprghlvgigihhsrdhlohhthhhorhgvsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopedvgedprhgtphhtthhopegtohhnohhrodgutheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhosghhsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopeguvghvihgtvghtrhgvvgesvhhgvghrrdhkvghrnhgvlhdrohhrghdpr hgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehkuhgsrgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrghrmhdqkhgvrhhnvghlsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtoheplhhuihiirdguvghnthiisehgmhgrihhlrdgtohhm X-GND-Sasl: alexis.lothore@bootlin.com X-Patchwork-Delegate: kuba@kernel.org wilc1000 driver supports WILC3000, a combo wifi/bluetooth chip. This chip needs a firmware for each radio. Before bringing support for the bluetooth side (and so, before adding bluetooth firmware load and start), add a dedicated lock around firmware loading and startup for wlan side. The bluetooth part will also use this lock to ensure that both firmware are not being loaded/started at the same time. Signed-off-by: Alexis Lothoré --- drivers/net/wireless/microchip/wilc1000/cfg80211.c | 2 ++ drivers/net/wireless/microchip/wilc1000/netdev.c | 5 +++++ drivers/net/wireless/microchip/wilc1000/netdev.h | 2 ++ 3 files changed, 9 insertions(+) diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c index e7aa0f9919232350761d51cbb1b5be87ca39e855..393fff618f919c5a6d3f4a7d894b187399455fb8 100644 --- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c +++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c @@ -1736,6 +1736,7 @@ static void wlan_init_locks(struct wilc *wl) mutex_init(&wl->cfg_cmd_lock); mutex_init(&wl->vif_mutex); mutex_init(&wl->deinit_lock); + mutex_init(&wl->radio_fw_start); spin_lock_init(&wl->txq_spinlock); mutex_init(&wl->txq_add_to_head_cs); @@ -1755,6 +1756,7 @@ void wlan_deinit_locks(struct wilc *wilc) mutex_destroy(&wilc->txq_add_to_head_cs); mutex_destroy(&wilc->vif_mutex); mutex_destroy(&wilc->deinit_lock); + mutex_destroy(&wilc->radio_fw_start); cleanup_srcu_struct(&wilc->srcu); } diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.c b/drivers/net/wireless/microchip/wilc1000/netdev.c index af298021e05041ba4b16a94c8ee768407a208dfc..d24859d12ccd535c966a9b7f46378ac3b3a21d7b 100644 --- a/drivers/net/wireless/microchip/wilc1000/netdev.c +++ b/drivers/net/wireless/microchip/wilc1000/netdev.c @@ -4,6 +4,7 @@ * All rights reserved. */ +#include "linux/mutex.h" #include #include #include @@ -534,6 +535,8 @@ static int wilc_wlan_initialize(struct net_device *dev, struct wilc_vif *vif) goto fail_irq_init; } + mutex_lock(&wl->radio_fw_start); + ret = wilc_wlan_get_firmware(dev); if (ret) goto fail_irq_enable; @@ -562,6 +565,7 @@ static int wilc_wlan_initialize(struct net_device *dev, struct wilc_vif *vif) netdev_err(dev, "Failed to configure firmware\n"); goto fail_fw_start; } + mutex_unlock(&wl->radio_fw_start); wl->initialized = true; return 0; @@ -569,6 +573,7 @@ static int wilc_wlan_initialize(struct net_device *dev, struct wilc_vif *vif) wilc_wlan_stop(wl, vif); fail_irq_enable: + mutex_unlock(&wl->radio_fw_start); if (!wl->dev_irq_num && wl->hif_func->disable_interrupt) wl->hif_func->disable_interrupt(wl); diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.h b/drivers/net/wireless/microchip/wilc1000/netdev.h index 95bc8b8fe65a584615b6b9021d08d11e4b36408b..5837f8ffe548dad1b756cdbd8543636f2be0e9b0 100644 --- a/drivers/net/wireless/microchip/wilc1000/netdev.h +++ b/drivers/net/wireless/microchip/wilc1000/netdev.h @@ -287,6 +287,8 @@ struct wilc { struct ieee80211_supported_band band; u32 cipher_suites[ARRAY_SIZE(wilc_cipher_suites)]; u8 nv_mac_address[ETH_ALEN]; + /* Lock to prevent concurrent start of wlan/bluetooth firmware */ + struct mutex radio_fw_start; }; struct wilc_wfi_mon_priv { From patchwork Wed Feb 12 15:46:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9_=28eBPF_Foundation=29?= X-Patchwork-Id: 13972000 X-Patchwork-Delegate: kuba@kernel.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1408E212B06; Wed, 12 Feb 2025 15:47:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375275; cv=none; b=CaI6IsAUqXKo/Uj0IE0I9XpnXvNkOFYuQwMGFZ+Zyiojb2KmjIrtE/dxbteWvODMJGCAS6IUv7JH0Ei8c96oSIpBn8jdYcMXhioqNDbxyClNajbbrV4Il1mSBu2SJtVRPEmF4rllNo3D6/3YkXbfo+ythgczaZFxz3ZL6d3mWr8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375275; c=relaxed/simple; bh=GOvQNyUVl9fP6G1phuIP+FuJTr0gdmOmVl0+2mbeB0o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=B/LBHxol6241R+rPF9jMwqb4nO4PimnMpIwh4/EA/sGAb4TcETY92V3wyZMLrECemwx5iR0BqZo9wkHxvf2iq0suRix7X63dR36E+iQU4ZWa/1QyrrSWUGy3Fs7lVJ8yNo/HSXja4NjdHs2seEesoAB9VTdWiOHISCvivy1Q8Sw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=OJGKYxq1; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="OJGKYxq1" Received: by mail.gandi.net (Postfix) with ESMTPSA id 215B14318E; Wed, 12 Feb 2025 15:47:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1739375271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f0QDXdrnVYdl2WcxZmvLO4vqnkGNCkcX//xPR9QV5j4=; b=OJGKYxq1p8fQMxq/s+dbAehrnUH1vUoJgKdDfQzN/kLeINzgAdHGOH9scjrtLCWCJoCzdJ KPYnJ/+u856gAgcYxI0hMRNKgfH9FMQvubkV8fqnOqDJpzC/YBWyqE4iUFdUPQvHa2Lx8R XUJDmzm58mYI3QUxOvPIeJyalj2msDNUc+a24r+N2SCZIoedTj3FpHQ7QVQmtOc+mmHCsS C7XBTU2u2zpA3TMV+8nPxorGCQiVuhOvxEB8iHH9n5yZh/2NWgKusrHOtmGDRWRi3XHfJv 9gH68xFvZvOfotnHyP5zIAbnHCcyh3FzytHAh8UuBbRR1+Pak28+uT98Eq41aw== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Wed, 12 Feb 2025 16:46:23 +0100 Subject: [PATCH 04/12] wifi: wilc1000: allow to use acquire/release bus in other parts of driver Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250212-wilc3000_bt-v1-4-9609b784874e@bootlin.com> References: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> In-Reply-To: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> To: =?utf-8?q?Alexis_Lothor=C3=A9?= , Marcel Holtmann , Luiz Augusto von Dentz , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ajay Singh , Claudiu Beznea , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Nicolas Ferre , Alexandre Belloni Cc: Marek Vasut , Thomas Petazzoni , linux-bluetooth@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeggedvkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtkeertdertdejnecuhfhrohhmpeetlhgvgihishcunfhothhhohhrrocuoegrlhgvgihishdrlhhothhhohhrvgessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnhepgeevgefhteffuefhheekkeelffffvdeugffgveejffdtvdffudehtedtieevteetnecukfhppedvrgdtvdemkeegvdekmehfleegtgemvgdttdemmehfkeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdgrtddvmeekgedvkeemfhelgegtmegvtddtmeemfhekhedphhgvlhhopegludelvddrudeikedruddrudeljegnpdhmrghilhhfrhhomheprghlvgigihhsrdhlohhthhhorhgvsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopedvgedprhgtphhtthhopegtohhnohhrodgutheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhosghhsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopeguvghvihgtvghtrhgvvgesvhhgvghrrdhkvghrnhgvlhdrohhrghdpr hgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehkuhgsrgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrghrmhdqkhgvrhhnvghlsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtoheplhhuihiirdguvghnthiisehgmhgrihhlrdgtohhm X-GND-Sasl: alexis.lothore@bootlin.com X-Patchwork-Delegate: kuba@kernel.org acquire_bus/release_bus is currently used only in wlan.c when needing to access the main bus (SDIO or SPI). For wilc3000, the bluetooth part will also need to perform some operations on the main bus (eg: bluetooth firmware loading), so expose acquire/release_bus. Signed-off-by: Alexis Lothoré --- drivers/net/wireless/microchip/wilc1000/wlan.c | 5 +++-- drivers/net/wireless/microchip/wilc1000/wlan.h | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c index f2b13bd44273ebe2ee474eda047e82bf1287bd6e..a697caf73ac3ed06602c029c17773f50e3f8edb5 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.c +++ b/drivers/net/wireless/microchip/wilc1000/wlan.c @@ -743,7 +743,7 @@ static int chip_wakeup(struct wilc *wilc) return chip_wakeup_wilc3000(wilc); } -static inline int acquire_bus(struct wilc *wilc, enum bus_acquire acquire) +int acquire_bus(struct wilc *wilc, enum bus_acquire acquire) { int ret = 0; @@ -757,12 +757,13 @@ static inline int acquire_bus(struct wilc *wilc, enum bus_acquire acquire) return ret; } -static inline int release_bus(struct wilc *wilc, enum bus_release release) +int release_bus(struct wilc *wilc, enum bus_release release) { int ret = 0; if (release == WILC_BUS_RELEASE_ALLOW_SLEEP && wilc->power_save_mode) ret = chip_allow_sleep(wilc); + mutex_unlock(&wilc->hif_cs); return ret; diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.h b/drivers/net/wireless/microchip/wilc1000/wlan.h index 65e79371014d9e60755cb0aa38e04d351e67bcfb..e45c2db0f5cd2de6844993dde15034ebbd93e73b 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.h +++ b/drivers/net/wireless/microchip/wilc1000/wlan.h @@ -475,4 +475,7 @@ int wilc_wlan_init(struct net_device *dev); int wilc_get_chipid(struct wilc *wilc); int wilc_load_mac_from_nv(struct wilc *wilc); +int acquire_bus(struct wilc *wilc, enum bus_acquire acquire); +int release_bus(struct wilc *wilc, enum bus_release release); + #endif From patchwork Wed Feb 12 15:46:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9_=28eBPF_Foundation=29?= X-Patchwork-Id: 13972001 X-Patchwork-Delegate: kuba@kernel.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47D56253B57; Wed, 12 Feb 2025 15:47:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375277; cv=none; b=BXAe8WSzziiPU1OHWOq21fwUZoSIYQ9iAc0gragZwSWp1tEbkRoK8AsIz12q+Z7MAjIplKOjrG67QG1TKKYuRVKRPd3S1/244q3WdkF5xq3gcrAwL25xmwf+lCeYrdgghorKibCB0oJ2C9XF+0FIKkwcUBrYJ6kPDLDKcyKZIcM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375277; c=relaxed/simple; bh=dFWgR2KJi9rrlMT6rS5NX5ube7zTK3kKjqLNnm+fCrU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ln+RLLaYUeASqFc82e0zvmrEazxAj/wAmCqLW6lHPkLwyO8JDg7FmVatzfBpf5dCw+wmAuWCx/urakAx0mYLBi/exdQgjzmWztrjDBJxlhXjKQWOEmDj3dzITAGsMLnMtWe6WH+TsgXt0oFfk9MB+2EhwS6fsHWHS0ARbzWPXMw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=h9aQZ1VU; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="h9aQZ1VU" Received: by mail.gandi.net (Postfix) with ESMTPSA id 46A5F440EF; Wed, 12 Feb 2025 15:47:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1739375272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BfTrS1OjRQIwj0wKN7rCzduFEiSKH12F8dOUfUGzre0=; b=h9aQZ1VUnpQBH1K35/5VnOQoGp5HDbCa5PiNnGEKScTKrRSC/mrTSXD1Sc0mhlkShKVw4B eShP7wCQ5x+h0ZnLV0PWAgA15HTmnm+5EAz079vSfxISf/mzMhJB8YXmiB/ZMDdI6idK2s L4rvtv58Yl8YoerEDFEXys0c+9XKRZO7t0/eVkANAuH+z3g9Gqv+fJwhKOA3GvJTmFcXf9 xfqkAiG0l568TtGVF9YhElfj+bkDOinuUcXIU2SgIh3xuSC8ddRypSytU/Bhd7TghJRZRe uL0k8qYKFRE6jPczp1LrgpgAoorULwcjvPsustaPJdXmfuIzmiJJDYjzmr01mA== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Wed, 12 Feb 2025 16:46:24 +0100 Subject: [PATCH 05/12] wifi: wilc1000: do not depend on power save flag to wake up chip Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250212-wilc3000_bt-v1-5-9609b784874e@bootlin.com> References: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> In-Reply-To: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> To: =?utf-8?q?Alexis_Lothor=C3=A9?= , Marcel Holtmann , Luiz Augusto von Dentz , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ajay Singh , Claudiu Beznea , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Nicolas Ferre , Alexandre Belloni Cc: Marek Vasut , Thomas Petazzoni , linux-bluetooth@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeggedvkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtkeertdertdejnecuhfhrohhmpeetlhgvgihishcunfhothhhohhrrocuoegrlhgvgihishdrlhhothhhohhrvgessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnhepgeevgefhteffuefhheekkeelffffvdeugffgveejffdtvdffudehtedtieevteetnecukfhppedvrgdtvdemkeegvdekmehfleegtgemvgdttdemmehfkeehnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehinhgvthepvdgrtddvmeekgedvkeemfhelgegtmegvtddtmeemfhekhedphhgvlhhopegludelvddrudeikedruddrudeljegnpdhmrghilhhfrhhomheprghlvgigihhsrdhlohhthhhorhgvsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopedvgedprhgtphhtthhopegtohhnohhrodgutheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhosghhsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopeguvghvihgtvghtrhgvvgesvhhgvghrrdhkvghrnhgvlhdrohhrghdpr hgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehkuhgsrgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrghrmhdqkhgvrhhnvghlsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtoheplhhuihiirdguvghnthiisehgmhgrihhlrdgtohhm X-GND-Sasl: alexis.lothore@bootlin.com X-Patchwork-Delegate: kuba@kernel.org The wilc chips family has at least two mechanisms dedicated to power save: - a firmware configuration message, currently wired to the set_power_mgmt_ops of the cfg80211_ops structure (and so, configured through iw) - dedicated raw registers which allow to wake up the chip each time we need to communicate with it and to allow it again to sleep once done: those registers are currently manipulated almost any time we are about to use the SDIO/SPI bus to drive the chip. Those mechanisms are currently coupled together, and so the second mechanism is driven only if the first one is enabled, but it is wrong: even without the power save feature being configured in the wlan firmware, there are cases where the wake up and clock registers need to be written correctly, otherwise the chip stays unresponsive. The downstream driver seems to acknowledge this issue, since the flag matching the first feature has been completely removed. Decouple those two features by removing the condition on the powersave flag in acquire_bus/release_bus to make sure that the wakeup/allow_sleep registers are actually written when the passed enums (WILC_BUS_ACQUIRE_AND_WAKEUP, WILC_BUS_RELEASE_ALLOW_SLEEP) explicitly require those writes. Signed-off-by: Alexis Lothoré --- drivers/net/wireless/microchip/wilc1000/wlan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c index a697caf73ac3ed06602c029c17773f50e3f8edb5..1031f8153c76ca5761c1e91d03ba357a5c915774 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.c +++ b/drivers/net/wireless/microchip/wilc1000/wlan.c @@ -748,7 +748,7 @@ int acquire_bus(struct wilc *wilc, enum bus_acquire acquire) int ret = 0; mutex_lock(&wilc->hif_cs); - if (acquire == WILC_BUS_ACQUIRE_AND_WAKEUP && wilc->power_save_mode) { + if (acquire == WILC_BUS_ACQUIRE_AND_WAKEUP) { ret = chip_wakeup(wilc); if (ret) mutex_unlock(&wilc->hif_cs); @@ -761,7 +761,7 @@ int release_bus(struct wilc *wilc, enum bus_release release) { int ret = 0; - if (release == WILC_BUS_RELEASE_ALLOW_SLEEP && wilc->power_save_mode) + if (release == WILC_BUS_RELEASE_ALLOW_SLEEP) ret = chip_allow_sleep(wilc); mutex_unlock(&wilc->hif_cs); From patchwork Wed Feb 12 15:46:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9_=28eBPF_Foundation=29?= X-Patchwork-Id: 13972002 X-Patchwork-Delegate: kuba@kernel.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB17E2566D7; Wed, 12 Feb 2025 15:47:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375277; cv=none; b=aAyTIJeLR0KZIcFGeGb7whkL6j9fjxy7NHgjpqo8e9m6AdiECO253puLK2Rrq1tytFkfQm1Ql6plzeoaQnp+cEPSVfJ04Nd+qoo1NytLXsfycZRfTTyZb8RisGXsvoqz1wod+eWcwhasCkA7kBi4fPEU9G7B+87+kH9ZWbAKakQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375277; c=relaxed/simple; bh=xAmGyU91V+m4Q7kGIo3hv+45LYipGVyiZmeFoNFG190=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HOwLCNm1ik/E+3nHJQBXKEBRwej6M/bV6x2YhF5TIGPWtckJR1AJhOKPuXHuwhgqg1Xmc56Fmo8pXTvqwnXYLSiSyxiluToHE8wcluFaI5p2s8YctrLmP9RJgyFVF54Jv2fMIOBKdpv1I14Mjf7Q9HLV3Zu6jSInvXodfWOKn3s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=TjZ/AkzY; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="TjZ/AkzY" Received: by mail.gandi.net (Postfix) with ESMTPSA id 6D0FA440FC; Wed, 12 Feb 2025 15:47:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1739375273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eSlKEKgzm/q54egNWa8O2T+4J35Hi0UxWaRxNxaH0z0=; b=TjZ/AkzYBhFedMs08HnK2oPOp6dXjcONfnjOmvCeVY5yD1HgW2rZK1tK9BIt9Q7pqBJYXM jYJbWmd+ejh+BLMlLWDafz5mHwh/O7xNF6pK/P8aDakRyOBG62CoB7YzeQGv83sOTcjApk SMWRhwtEVnVGV+bymbbS/YDY266W7IAXQYfm7N52QcqA9xD/CMc/odRIGEqCmv/K5CGAFH UBwMwGzp9Tvpt4awsN2oxlifbSxp7cEwZ1yRsNL1e0wZOx1fLVvenTvahnFd5AsTHz0D7n 602Uyye/ALCwG8XYAfhIBXoX04BI8r9In1S5/ai7cWsYZdzFuQri43BFeewxXQ== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Wed, 12 Feb 2025 16:46:25 +0100 Subject: [PATCH 06/12] wifi: wilc1000: remove timeout parameter from set_power_mgmt Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250212-wilc3000_bt-v1-6-9609b784874e@bootlin.com> References: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> In-Reply-To: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> To: =?utf-8?q?Alexis_Lothor=C3=A9?= , Marcel Holtmann , Luiz Augusto von Dentz , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ajay Singh , Claudiu Beznea , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Nicolas Ferre , Alexandre Belloni Cc: Marek Vasut , Thomas Petazzoni , linux-bluetooth@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeggedvkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtkeertdertdejnecuhfhrohhmpeetlhgvgihishcunfhothhhohhrrocuoegrlhgvgihishdrlhhothhhohhrvgessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnhepgeevgefhteffuefhheekkeelffffvdeugffgveejffdtvdffudehtedtieevteetnecukfhppedvrgdtvdemkeegvdekmehfleegtgemvgdttdemmehfkeehnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehinhgvthepvdgrtddvmeekgedvkeemfhelgegtmegvtddtmeemfhekhedphhgvlhhopegludelvddrudeikedruddrudeljegnpdhmrghilhhfrhhomheprghlvgigihhsrdhlohhthhhorhgvsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopedvgedprhgtphhtthhopegtohhnohhrodgutheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhosghhsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopeguvghvihgtvghtrhgvvgesvhhgvghrrdhkvghrnhgvlhdrohhrghdpr hgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehkuhgsrgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrghrmhdqkhgvrhhnvghlsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtoheplhhuihiirdguvghnthiisehgmhgrihhlrdgtohhm X-GND-Sasl: alexis.lothore@bootlin.com X-Patchwork-Delegate: kuba@kernel.org While the timeout parameter is part for the cfg80211 ops set_power_mgmt, wilc currently does not uses it (it processes only the boolean value). Remove the unused parameter from the driver-specific function. Signed-off-by: Alexis Lothoré --- drivers/net/wireless/microchip/wilc1000/cfg80211.c | 2 +- drivers/net/wireless/microchip/wilc1000/hif.c | 2 +- drivers/net/wireless/microchip/wilc1000/hif.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c index 393fff618f919c5a6d3f4a7d894b187399455fb8..ff8c1a40634cee9960777eb017f6b2905e6399a5 100644 --- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c +++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c @@ -1348,7 +1348,7 @@ static int set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, if (!priv->hif_drv) return -EIO; - wilc_set_power_mgmt(vif, enabled, timeout); + wilc_set_power_mgmt(vif, enabled); return 0; } diff --git a/drivers/net/wireless/microchip/wilc1000/hif.c b/drivers/net/wireless/microchip/wilc1000/hif.c index bba53307b960d996032f56affead0cd0922902a4..3b14d560bc295844d873ed966592f031f6b50206 100644 --- a/drivers/net/wireless/microchip/wilc1000/hif.c +++ b/drivers/net/wireless/microchip/wilc1000/hif.c @@ -1932,7 +1932,7 @@ int wilc_edit_station(struct wilc_vif *vif, const u8 *mac, return result; } -int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout) +int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled) { struct wilc *wilc = vif->wilc; struct wid wid; diff --git a/drivers/net/wireless/microchip/wilc1000/hif.h b/drivers/net/wireless/microchip/wilc1000/hif.h index 96eeaf31d23777e0392699240479b341529bfd42..5ecf6ba293a598823d09de43b597f8d54d375a7c 100644 --- a/drivers/net/wireless/microchip/wilc1000/hif.h +++ b/drivers/net/wireless/microchip/wilc1000/hif.h @@ -192,7 +192,7 @@ int wilc_del_allstation(struct wilc_vif *vif, u8 mac_addr[][ETH_ALEN]); int wilc_del_station(struct wilc_vif *vif, const u8 *mac_addr); int wilc_edit_station(struct wilc_vif *vif, const u8 *mac, struct station_parameters *params); -int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout); +int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled); int wilc_setup_multicast_filter(struct wilc_vif *vif, u32 enabled, u32 count, u8 *mc_list); int wilc_remain_on_channel(struct wilc_vif *vif, u64 cookie, u16 chan, From patchwork Wed Feb 12 15:46:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9_=28eBPF_Foundation=29?= X-Patchwork-Id: 13972003 X-Patchwork-Delegate: kuba@kernel.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 45BBA207667; Wed, 12 Feb 2025 15:47:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375278; cv=none; b=tJ1dIQEW5iL7t6nMAcBjrCHNoe/2WcZAFfqdj8qR9lFeymsG8eHYugPJD6ufA9Xpqcc3Es7QgthzmcuFQSAPCLXDjI7Hj990HclLCOb6Cy2yfKI8AmZZOrKXWPzvZGNucXwRkCNcWQJFHh4EVxxfDS06ENyRxuTjJK4QhvNwruY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375278; c=relaxed/simple; bh=wwE9J/3DWzGzvf3HX8mIawo1HhEFag+7yqU3+gKUFAs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=deEKJK906mu1OF9QGfdZIvgoU2OuIyzesipKSTFNYJEKV0Aej8/ieSMwDbr6S1EP6fGF7473ibtUuLQeNArRTgbV6YPAjaqkgWuHEAEfeN3NxI6VC2mgzh9IyyHXYcJgSm1OdRQK6ARCaMM2HK2atO9yz86CgYSQ+8CBRE9vdoU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=e7S/94rb; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="e7S/94rb" Received: by mail.gandi.net (Postfix) with ESMTPSA id 9280244103; Wed, 12 Feb 2025 15:47:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1739375274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2ARy609cfvM2of9MOB+Gm0QH81VkAA3wJdG6pfhwRTg=; b=e7S/94rbSfelEL+qP0xlfBImgIn7ZSDO3cwrEN8vMru0qDJf+lQ1Il2tbn6XCUdhGq9dDj EiyOCNfx9StQORtHFc/YcwSIC+cOYWxOVYJn0PDRGkQdVMuIyBCFNmM3Vp4OGHGMPba+/Z yT1TOXxkgY4IwKSU9QZlmtqSfOkB0GQRasGWUx8uER+eU7QW9Gm0MHtJWN5f3f3ptSnHZk IaVJRbmnJQI3YGn9qmm5/ECByeOtGXB63qf1zPaYLdPmWtT2S5q1liSxbY/ps/SeFg7Gbm j8MvF4bqNBqpB5qxyE+WkkDpEQfvPcyvzTRwslMmbS6pAY8zvYzMxi4RiiNGuw== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Wed, 12 Feb 2025 16:46:26 +0100 Subject: [PATCH 07/12] wifi: wilc1000: reorganize makefile objs into sorted list Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250212-wilc3000_bt-v1-7-9609b784874e@bootlin.com> References: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> In-Reply-To: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> To: =?utf-8?q?Alexis_Lothor=C3=A9?= , Marcel Holtmann , Luiz Augusto von Dentz , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ajay Singh , Claudiu Beznea , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Nicolas Ferre , Alexandre Belloni Cc: Marek Vasut , Thomas Petazzoni , linux-bluetooth@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeggedvkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtkeertdertdejnecuhfhrohhmpeetlhgvgihishcunfhothhhohhrrocuoegrlhgvgihishdrlhhothhhohhrvgessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnhepgeevgefhteffuefhheekkeelffffvdeugffgveejffdtvdffudehtedtieevteetnecukfhppedvrgdtvdemkeegvdekmehfleegtgemvgdttdemmehfkeehnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehinhgvthepvdgrtddvmeekgedvkeemfhelgegtmegvtddtmeemfhekhedphhgvlhhopegludelvddrudeikedruddrudeljegnpdhmrghilhhfrhhomheprghlvgigihhsrdhlohhthhhorhgvsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopedvgedprhgtphhtthhopegtohhnohhrodgutheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhosghhsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopeguvghvihgtvghtrhgvvgesvhhgvghrrdhkvghrnhgvlhdrohhrghdpr hgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehkuhgsrgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrghrmhdqkhgvrhhnvghlsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtoheplhhuihiirdguvghnthiisehgmhgrihhlrdgtohhm X-GND-Sasl: alexis.lothore@bootlin.com X-Patchwork-Delegate: kuba@kernel.org Put one object per line and sort them by alphabetical order Signed-off-by: Alexis Lothoré --- drivers/net/wireless/microchip/wilc1000/Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/Makefile b/drivers/net/wireless/microchip/wilc1000/Makefile index c3c9e34c1eaa93e7f6f13c6e4701f800408e8f89..9a2602b4a1494309ba06e4b553a8fc76a3f5433e 100644 --- a/drivers/net/wireless/microchip/wilc1000/Makefile +++ b/drivers/net/wireless/microchip/wilc1000/Makefile @@ -1,8 +1,14 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_WILC1000) += wilc1000.o -wilc1000-objs := cfg80211.o netdev.o mon.o \ - hif.o wlan_cfg.o wlan.o +wilc1000-objs := \ + cfg80211.o \ + hif.o \ + mon.o \ + netdev.o \ + wlan.o \ + wlan_cfg.o + obj-$(CONFIG_WILC1000_SDIO) += wilc1000-sdio.o wilc1000-sdio-objs += sdio.o From patchwork Wed Feb 12 15:46:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9_=28eBPF_Foundation=29?= X-Patchwork-Id: 13972005 X-Patchwork-Delegate: kuba@kernel.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5903125D54D; Wed, 12 Feb 2025 15:47:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375281; cv=none; b=aVI7qhSDoHGpKHxaJ4m6q0Fshuxo1+VomUZvCrK+90zt/crfw21SilLhS4/p2CL8PKUnKW+Ky7SA7atiQX9iqvrDh7TBmgikA8gAUG5joz3JYSk9jPILDl2bJFznTVT/rW3XPcAIigIteBa3/aDojzqwpTjX+Ptq6AqX473u9pM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375281; c=relaxed/simple; bh=AWLj6SV3rNZ0v6kvnMy7yz6d7oQPDG9H/h8CSF6Cpjc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BiAauaZ2zcHPzTvUfTPBB3eFFo7F1Ay8nSCItqFd75E80QqXrI+3nLnheZAg7H69wvADzgdaRJnbb7Et9GYLcskTOW+exMModgMkjwPNg076ingQ3o4i67wcHz/NIew8KOWSGxQjNA7uiAk8gMzEkewBB+wpnCBatSgw3xYfT6Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=VF1tRokk; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="VF1tRokk" Received: by mail.gandi.net (Postfix) with ESMTPSA id A9D8E4416D; Wed, 12 Feb 2025 15:47:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1739375275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pzg0Qq/qg3rAWPPeu5SKfOe56oxW2Nn9A9YqyPialNM=; b=VF1tRokkMyYEImLEJmyns1eZ/pyOaOenK0thWrf3WKZUnX7m6bocLhQmT6MaEE+50BN04X H7wF4kSvWSU4qqrhcvGJPRQyK/CdyZqtz6G565ULf15yMLQ4x5kOIsK1bCR1BUDcxvY7tn X7aDXor5zyiTClB/CwIUHN6QbZwLFN2JEh5vmdJXAAZhnAwC+Ainh5ymHEU/pp91+k1Va3 a06eAJ5VT/JAxVcdqUswFl2KVfI62qoWwRZXfTTa3F1zFEwiuj2l8wdA3vS0HewTIBOx1V PyZZKRbSII74xNgW2TE12C0eQZOaK+kGuc4mNDod2JV6deRMtiCNHO9T9API2w== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Wed, 12 Feb 2025 16:46:27 +0100 Subject: [PATCH 08/12] wifi: wilc1000: add basic functions to allow bluetooth bringup Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250212-wilc3000_bt-v1-8-9609b784874e@bootlin.com> References: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> In-Reply-To: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> To: =?utf-8?q?Alexis_Lothor=C3=A9?= , Marcel Holtmann , Luiz Augusto von Dentz , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ajay Singh , Claudiu Beznea , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Nicolas Ferre , Alexandre Belloni Cc: Marek Vasut , Thomas Petazzoni , linux-bluetooth@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeggedvkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtkeertdertdejnecuhfhrohhmpeetlhgvgihishcunfhothhhohhrrocuoegrlhgvgihishdrlhhothhhohhrvgessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnhepgefhlefhveelgfefgfduudduuedvtdevkefgtdeffeduueevffevleevhfejueegnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkphepvdgrtddvmeekgedvkeemfhelgegtmegvtddtmeemfhekheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvrgdtvdemkeegvdekmehfleegtgemvgdttdemmehfkeehpdhhvghloheplgduledvrdduieekrddurdduleejngdpmhgrihhlfhhrohhmpegrlhgvgihishdrlhhothhhohhrvgessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepvdegpdhrtghpthhtoheptghonhhorhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehrohgshheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepuggvvhhitggvthhrv ggvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepkhhriihkodgutheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepkhhusggrsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdgrrhhmqdhkvghrnhgvlheslhhishhtshdrihhnfhhrrgguvggrugdrohhrghdprhgtphhtthhopehluhhiiidruggvnhhtiiesghhmrghilhdrtghomh X-GND-Sasl: alexis.lothore@bootlin.com X-Patchwork-Delegate: kuba@kernel.org Despite using a dedicated uart bus as main interface for bluetooth operations, WILC3000 needs some initialization to be done over the wlan bus (either SPI or SDIO) before being able to process HCI commands. Those operations mostly consists in: - some internal registers configuration - a bluetooth firmware download - bluetooth firmware start Some of those operations also need to consider whether wlan is running or not (eg: some coex registers need to be explicitly written if wlan is not already running) Add two set of APIs to fulfill those needs: - two getters (one for sdio, one for spi) to allow retrieving an opaque handle on wilc structure - some init/shutdown APIs, consuming this opaque wilc struct and actually performing the needed bluetooth initialization steps The new code in charge of bluetooth initialization is driven by a dedicated Kconfig, which will be selected by the new bluetooth driver Kconfig coming in the next commits. The wilc driver then exposes a few new functions to allow the future bluetooth driver to request the chip initialization: - wilc__get_by_phandle : returns an opaque handle on the wilc structure - wilc_bt_init: use the handle returned previously and request bluetooth initialization - wilc_put: once done, give back the handle Signed-off-by: Alexis Lothoré --- The bluetooth init sequence is heavily inspired from Microchip downstream kernel, see [1]. While the downstream kernel relies on user to trigger the bluetooth init sequence (through a chardev), this version is autonomous and supposed to be triggered by the actual bluetooth driver in the next commits. [1] https://github.com/linux4microchip/linux/blob/linux-6.6-mchp/drivers/net/wireless/microchip/wilc1000/bt.c --- drivers/net/wireless/microchip/wilc1000/Kconfig | 3 + drivers/net/wireless/microchip/wilc1000/Makefile | 1 + drivers/net/wireless/microchip/wilc1000/bt.c | 322 +++++++++++++++++++++++ drivers/net/wireless/microchip/wilc1000/netdev.c | 9 + drivers/net/wireless/microchip/wilc1000/sdio.c | 33 +++ drivers/net/wireless/microchip/wilc1000/spi.c | 25 ++ drivers/net/wireless/microchip/wilc1000/wlan.h | 17 ++ include/net/wilc.h | 19 ++ 8 files changed, 429 insertions(+) diff --git a/drivers/net/wireless/microchip/wilc1000/Kconfig b/drivers/net/wireless/microchip/wilc1000/Kconfig index 62cfcdc9aacc007893db85840b5a3a8d11b7ac07..8e7b072a9882094d60ea0d8f85f9df171957cedb 100644 --- a/drivers/net/wireless/microchip/wilc1000/Kconfig +++ b/drivers/net/wireless/microchip/wilc1000/Kconfig @@ -46,3 +46,6 @@ config WILC1000_HW_OOB_INTR mechanism for SDIO host controllers that don't support SDIO interrupt. Select this option If the SDIO host controller in your platform doesn't support SDIO time division interrupt. + +config WILC_BT + bool diff --git a/drivers/net/wireless/microchip/wilc1000/Makefile b/drivers/net/wireless/microchip/wilc1000/Makefile index 9a2602b4a1494309ba06e4b553a8fc76a3f5433e..4eb510eedd91e92932e4d611b16a6088d3e3b987 100644 --- a/drivers/net/wireless/microchip/wilc1000/Makefile +++ b/drivers/net/wireless/microchip/wilc1000/Makefile @@ -9,6 +9,7 @@ wilc1000-objs := \ wlan.o \ wlan_cfg.o +wilc1000-$(CONFIG_WILC_BT) += bt.o obj-$(CONFIG_WILC1000_SDIO) += wilc1000-sdio.o wilc1000-sdio-objs += sdio.o diff --git a/drivers/net/wireless/microchip/wilc1000/bt.c b/drivers/net/wireless/microchip/wilc1000/bt.c new file mode 100644 index 0000000000000000000000000000000000000000..b0f68a5479a5bd6f70e2390a35512037dc6c332b --- /dev/null +++ b/drivers/net/wireless/microchip/wilc1000/bt.c @@ -0,0 +1,322 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include +#include +#include +#include +#include +#include +#include +#include "netdev.h" +#include "wlan_if.h" +#include "wlan.h" + +#define FW_WILC3000_BLE "mchp/wilc3000_ble_firmware.bin" + +static int wilc_bt_power_down(struct wilc *wilc) +{ + int ret; + + acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); + + ret = wilc->hif_func->hif_rmw_reg(wilc, GLOBAL_MODE_CONTROL, BIT(1), 0); + if (ret) { + dev_err(wilc->dev, "Failed to disable BT mode\n"); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); + return ret; + } + + ret = wilc->hif_func->hif_rmw_reg(wilc, COE_AUTO_PS_ON_NULL_PKT, + BIT(30), 0); + if (ret) { + dev_err(wilc->dev, "Failed to disable awake coexistence null frames\n"); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); + return ret; + } + + ret = wilc->hif_func->hif_rmw_reg(wilc, COE_AUTO_PS_OFF_NULL_PKT, + BIT(30), 0); + if (ret) { + dev_err(wilc->dev, "Failed to disable doze coexistence null frames\n"); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); + return ret; + } + + ret = wilc->hif_func->hif_rmw_reg(wilc, PWR_SEQ_MISC_CTRL, BIT(29), 0); + if (ret) { + dev_err(wilc->dev, "Failed to disable bluetooth wake-up\n"); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); + return ret; + } + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); + + if (!wilc->initialized) { + acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); + ret = wilc->hif_func->hif_deinit(wilc); + release_bus(wilc, WILC_BUS_RELEASE_ONLY); + } + + return 0; +} + +static int wilc_bt_power_up(struct wilc *wilc) +{ + int ret; + + acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); + if (!wilc->initialized) { + ret = wilc->hif_func->hif_rmw_reg(wilc, COE_AUTO_PS_ON_NULL_PKT, + BIT(30), 0); + if (ret) { + dev_err(wilc->dev, "Failed to disable awake coexistence null frames\n"); + goto fail; + } + + ret = wilc->hif_func->hif_rmw_reg(wilc, + COE_AUTO_PS_OFF_NULL_PKT, BIT(30), 0); + if (ret) { + dev_err(wilc->dev, "Failed to disable awake coexistence null frames\n"); + goto fail; + } + } + + ret = wilc->hif_func->hif_rmw_reg(wilc, PWR_SEQ_MISC_CTRL, BIT(29), + BIT(29)); + if (ret) { + dev_err(wilc->dev, "Failed to enable bluetooth wake-up\n"); + goto fail; + } + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); + + return 0; + +fail: + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); + wilc_bt_power_down(wilc); + return ret; +} + +static int wilc_bt_firmware_download(struct wilc *wilc) +{ + const struct firmware *wilc_bt_firmware; + u32 addr, size, size2, blksz; + size_t buffer_size; + const u8 *buffer; + u8 *dma_buffer; + u32 offset; + int ret = 0; + + dev_info(wilc->dev, "Bluetooth firmware: %s\n", FW_WILC3000_BLE); + ret = request_firmware(&wilc_bt_firmware, FW_WILC3000_BLE, wilc->dev); + if (ret) { + dev_err(wilc->dev, "%s - firmware not available. Skip!\n", + FW_WILC3000_BLE); + return ret; + } + + buffer = wilc_bt_firmware->data; + buffer_size = (size_t)wilc_bt_firmware->size; + if (buffer_size <= 0) { + dev_err(wilc->dev, "Firmware size = 0!\n"); + ret = -EINVAL; + goto out_release_firmware; + } + + acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); + + ret = wilc->hif_func->hif_write_reg(wilc, WILC_BT_BOOTROM_CONFIGURATION, + WILC_BT_BOOTROM_DISABLE); + if (ret) { + dev_err(wilc->dev, "Failed to disable BT bootrom\n"); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); + goto out_release_firmware; + } + + ret = wilc->hif_func->hif_rmw_reg(wilc, WILC_BT_RESET_MUX, + WILC_BT_ENABLE_GLOBAL_RESET, + WILC_BT_ENABLE_GLOBAL_RESET); + if (ret) { + dev_err(wilc->dev, "Failed to configure reset for BT CPU\n"); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); + goto out_release_firmware; + } + + ret = wilc->hif_func->hif_rmw_reg(wilc, WILC_BT_CPU_CONFIGURATION, + WILC_BT_CPU_ENABLE, + WILC_BT_CPU_ENABLE); + if (!ret) + ret = wilc->hif_func->hif_rmw_reg(wilc, + WILC_BT_CPU_CONFIGURATION, + WILC_BT_CPU_ENABLE, 0); + if (ret) { + dev_err(wilc->dev, "Failed to disable BT CPU\n"); + goto out_release_firmware; + } + + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); + + /* blocks of sizes > 512 causes the wifi to hang! */ + blksz = (1ul << 9); + /* Allocate a DMA coherent buffer. */ + dma_buffer = kmalloc(blksz, GFP_KERNEL); + if (!dma_buffer) { + ret = -ENOMEM; + dev_err(wilc->dev, + "Can't allocate buffer for BT firmware download\n"); + goto out_free_buffer; + } + dev_info(wilc->dev, "Downloading BT firmware size = %zu ...\n", + buffer_size); + + offset = 0; + addr = WILC_BT_IRAM; + size = buffer_size; + offset = 0; + + while (((int)size) && (offset < buffer_size)) { + if (size <= blksz) + size2 = size; + else + size2 = blksz; + + /* Copy firmware into a DMA coherent buffer */ + memcpy(dma_buffer, &buffer[offset], size2); + + acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); + + ret = wilc->hif_func->hif_block_tx(wilc, addr, dma_buffer, + size2); + + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); + + if (ret) + break; + + addr += size2; + offset += size2; + size -= size2; + } + + if (ret) { + dev_err(wilc->dev, "Failed to download BT firmware\n"); + goto out_free_buffer; + } + dev_info(wilc->dev, "Finished downloading firmware\n"); + +out_free_buffer: + kfree(dma_buffer); +out_release_firmware: + release_firmware(wilc_bt_firmware); +return ret; +} + +static int wilc_bt_start(struct wilc *wilc) +{ + int ret; + + acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); + + dev_info(wilc->dev, "Starting BT firmware\n"); + /* + * Write the firmware download complete magic at + * location 0xFFFF000C (Cortus map) or C000C (AHB map). + * This will let the boot-rom code execute from RAM. + */ + ret = wilc->hif_func->hif_write_reg(wilc, WILC_BT_FW_MAGIC_LOC, + WILC_BT_FW_MAGIC); + if (ret) { + dev_err(wilc->dev, "Failed to write BT firmware magic\n"); + return ret; + } + + ret = wilc->hif_func->hif_rmw_reg(wilc, WILC_BT_CPU_CONFIGURATION, + WILC_BT_CPU_BOOT, 0); + if (ret) { + dev_err(wilc->dev, "Failed to disable BT CPU"); + return ret; + } + + msleep(100); + + ret = wilc->hif_func->hif_rmw_reg(wilc, WILC_BT_CPU_CONFIGURATION, + WILC_BT_CPU_BOOT, WILC_BT_CPU_BOOT); + if (ret) { + dev_err(wilc->dev, "Failed to enable BT CPU"); + return ret; + } + /* An additional wait to give BT firmware time to do + * CPLL update as the time measured since the start of + * BT FW till the end of function "rf_nmi_init_tuner" + * was 71.2 ms + */ + msleep(100); + + dev_info(wilc->dev, "BT Start Succeeded\n"); + + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); + + return 0; +} + +int wilc_bt_init(void *wilc_wl_priv) +{ + struct wilc *wilc = (struct wilc *)wilc_wl_priv; + int ret; + + if (!wilc->hif_func->hif_is_init(wilc)) { + dev_info(wilc->dev, "Initializing bus before starting BT"); + acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); + ret = wilc->hif_func->hif_init(wilc, false); + release_bus(wilc, WILC_BUS_RELEASE_ONLY); + if (ret) + return ret; + } + + mutex_lock(&wilc->radio_fw_start); + ret = wilc_bt_power_up(wilc); + if (ret) { + dev_err(wilc->dev, "Error powering up bluetooth chip\n"); + goto hif_deinit; + } + ret = wilc_bt_firmware_download(wilc); + if (ret) { + dev_err(wilc->dev, "Error downloading firmware\n"); + goto power_down; + } + ret = wilc_bt_start(wilc); + if (ret) { + dev_err(wilc->dev, "Error starting bluetooth firmware\n"); + goto power_down; + } + mutex_unlock(&wilc->radio_fw_start); + return 0; + +power_down: + wilc_bt_power_down(wilc); +hif_deinit: + mutex_unlock(&wilc->radio_fw_start); + if (!wilc->initialized) + wilc->hif_func->hif_deinit(wilc); + return ret; +} +EXPORT_SYMBOL(wilc_bt_init); + +int wilc_bt_shutdown(void *wilc_wl_priv) +{ + struct wilc *wilc = (struct wilc *)wilc_wl_priv; + int ret; + + mutex_lock(&wilc->radio_fw_start); + ret = wilc->hif_func->hif_rmw_reg(wilc, WILC_BT_CPU_CONFIGURATION, + WILC_BT_CPU_ENABLE, 0); + if (ret) + dev_warn(wilc->dev, "Failed to disable BT CPU\n"); + if (wilc_bt_power_down(wilc)) + dev_warn(wilc->dev, "Failed to power down BT CPU\n"); + if (!wilc->initialized) + wilc->hif_func->hif_deinit(wilc); + mutex_unlock(&wilc->radio_fw_start); + + return 0; +} +EXPORT_SYMBOL(wilc_bt_shutdown); diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.c b/drivers/net/wireless/microchip/wilc1000/netdev.c index d24859d12ccd535c966a9b7f46378ac3b3a21d7b..2f1f68b2156a937a240167d820603ff708507401 100644 --- a/drivers/net/wireless/microchip/wilc1000/netdev.c +++ b/drivers/net/wireless/microchip/wilc1000/netdev.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "cfg80211.h" #include "wlan_cfg.h" @@ -1024,6 +1025,14 @@ struct wilc_vif *wilc_netdev_ifc_init(struct wilc *wl, const char *name, } EXPORT_SYMBOL_GPL(wilc_netdev_ifc_init); +void wilc_put(void *wilc_wl_priv) +{ + struct wilc *wilc = (struct wilc *)wilc_wl_priv; + + put_device(wilc->dev); +} +EXPORT_SYMBOL_GPL(wilc_put); + MODULE_DESCRIPTION("Atmel WILC1000 core wireless driver"); MODULE_LICENSE("GPL"); MODULE_FIRMWARE(WILC1000_FW(WILC1000_API_VER)); diff --git a/drivers/net/wireless/microchip/wilc1000/sdio.c b/drivers/net/wireless/microchip/wilc1000/sdio.c index 7eab1c493774e197e43bdf265063aa8c5e6dff14..78789682f145aa06f30d274efc75805e583c0b43 100644 --- a/drivers/net/wireless/microchip/wilc1000/sdio.c +++ b/drivers/net/wireless/microchip/wilc1000/sdio.c @@ -5,11 +5,16 @@ */ #include +#include "linux/device.h" +#include "linux/device/driver.h" #include #include #include #include #include +#include +#include +#include #include "netdev.h" #include "cfg80211.h" @@ -1072,5 +1077,33 @@ static struct sdio_driver wilc_sdio_driver = { }; module_sdio_driver(wilc_sdio_driver); +static int find_wilc_device(struct device *dev, const void *data) +{ + struct device_node *target_node = (struct device_node *)data; + struct sdio_func *func = container_of(dev, struct sdio_func, dev); + + return func->card->dev.of_node == target_node ? 1 : 0; +} + +void *wilc_sdio_get_byphandle(struct device_node *wlan_node) +{ + struct wilc *wilc; + struct device *wilc_dev; + + /* Search in devices bound to the driver if any has a device_node + * matching the targeted one + */ + wilc_dev = driver_find_device(&wilc_sdio_driver.drv, NULL, + (void *)wlan_node, find_wilc_device); + if (!wilc_dev) + return ERR_PTR(-EPROBE_DEFER); + + get_device(wilc_dev); + wilc = (struct wilc *)dev_get_drvdata(wilc_dev); + + return wilc; +} +EXPORT_SYMBOL(wilc_sdio_get_byphandle); + MODULE_DESCRIPTION("Atmel WILC1000 SDIO wireless driver"); MODULE_LICENSE("GPL"); diff --git a/drivers/net/wireless/microchip/wilc1000/spi.c b/drivers/net/wireless/microchip/wilc1000/spi.c index aae4262045ff3e5f3668493ef235486e601996f7..93082de3d6ba4cf545a3ec741d8ed16c5372d69b 100644 --- a/drivers/net/wireless/microchip/wilc1000/spi.c +++ b/drivers/net/wireless/microchip/wilc1000/spi.c @@ -4,11 +4,16 @@ * All rights reserved. */ +#include "linux/device/driver.h" +#include "linux/of.h" +#include "linux/of_platform.h" #include #include #include #include #include +#include +#include #include "netdev.h" #include "cfg80211.h" @@ -1390,3 +1395,23 @@ static const struct wilc_hif_func wilc_hif_spi = { .hif_is_init = wilc_spi_is_init, .hif_rmw_reg = wilc_spi_rmw_reg }; + +void *wilc_spi_get_byphandle(struct device_node *wlan_node) +{ + struct wilc *wilc; + struct device *wilc_dev; + + /* Search in devices bound to the driver if any has a device_node + * matching the targeted one + */ + wilc_dev = driver_find_device_by_of_node(&wilc_spi_driver.driver, + wlan_node); + if (!wilc_dev) + return ERR_PTR(-EPROBE_DEFER); + + get_device(wilc_dev); + wilc = (struct wilc *)dev_get_drvdata(wilc_dev); + + return wilc; +} +EXPORT_SYMBOL(wilc_spi_get_byphandle); diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.h b/drivers/net/wireless/microchip/wilc1000/wlan.h index e45c2db0f5cd2de6844993dde15034ebbd93e73b..74381f81e3f236cc55d3af3e7906ed7fb7d790ed 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.h +++ b/drivers/net/wireless/microchip/wilc1000/wlan.h @@ -116,6 +116,21 @@ #define WILC_SPI_CLOCKLESS_ADDR_LIMIT 0x30 +#define WILC_BT_RESET_MUX 0x3b0090 +#define WILC_BT_ENABLE_GLOBAL_RESET BIT(0) + +#define WILC_BT_CPU_CONFIGURATION 0x3b0400 +#define WILC_BT_CPU_ENABLE BIT(2) +#define WILC_BT_CPU_BOOT (BIT(3) | WILC_BT_CPU_ENABLE) + +#define WILC_BT_IRAM 0x400000 + +#define WILC_BT_BOOTROM_CONFIGURATION 0x4f0000 +#define WILC_BT_BOOTROM_DISABLE 0x71 + +#define WILC_BT_FW_MAGIC_LOC 0x4f000c +#define WILC_BT_FW_MAGIC 0x10add09e + /* Functions IO enables bits */ #define WILC_SDIO_CCCR_IO_EN_FUNC1 BIT(1) @@ -174,6 +189,8 @@ #define GLOBAL_MODE_CONTROL 0x1614 #define PWR_SEQ_MISC_CTRL 0x3008 +#define COE_AUTO_PS_ON_NULL_PKT 0x160468 +#define COE_AUTO_PS_OFF_NULL_PKT 0x16046C #define WILC_GLOBAL_MODE_ENABLE_WIFI BIT(0) #define WILC_PWR_SEQ_ENABLE_WIFI_SLEEP BIT(28) diff --git a/include/net/wilc.h b/include/net/wilc.h new file mode 100644 index 0000000000000000000000000000000000000000..60c69d4d8442907c05e644ecd646b24ccd161f47 --- /dev/null +++ b/include/net/wilc.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef __WILC_HEADER_H +#define __WILC_HEADER_H + +#include + +#if defined(CONFIG_WILC1000_SDIO) || defined(CONFIG_WILC1000_SDIO_MODULE) +void *wilc_sdio_get_byphandle(struct device_node *wlan_node); +#endif +#if defined(CONFIG_WILC1000_SPI) || defined(CONFIG_WILC1000_SPI_MODULE) +void *wilc_spi_get_byphandle(struct device_node *wlan_node); +#endif +void wilc_put(void *wilc_wl_priv); + +int wilc_bt_init(void *wilc_wl_priv); +int wilc_bt_shutdown(void *wilc_wl_priv); + +#endif From patchwork Wed Feb 12 15:46:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9_=28eBPF_Foundation=29?= X-Patchwork-Id: 13972004 X-Patchwork-Delegate: kuba@kernel.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58FCC25D54C; Wed, 12 Feb 2025 15:47:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375280; cv=none; b=EVjjrsudsdnsKSaaBSUD79I/s+yQlzRCuB1bWKKY8LEC6tAEyiQIGBOz1ZKCW03p+i03ohqfq66UXqf8aTwkCJcjQFFsQM0gw2KM/86tCfaOaTZPxfvxdSwfitt/wSmJEQxijiA8tnCXTxHznVa884EQCbFg8DbN8SRWQg745X8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375280; c=relaxed/simple; bh=z6QtgQals0nj68HfLj/ST7GjV9kzm8CLeT9eKOKoVVM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=G7IX0L+ebNhbGA5ML/AbjkvDBt2mZhXMB0Lr4xupi6WtzqEQgxSu1zxlfhREEQp9K3z1zh/UKxia0SvosNIPv3XEpwkNYls0yHDnpCWUvgZXLTkgpAzz1co8mt1nHSRg4boQwvguPDISdXMy737hdAgHGsa05QCs4A3rQ2fmgDA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=jrZVpFHW; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="jrZVpFHW" Received: by mail.gandi.net (Postfix) with ESMTPSA id CCCFC44169; Wed, 12 Feb 2025 15:47:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1739375276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7E2aPfiJbXJ3tUrfXAYeEsTGlAb+ywwjD1zVqSfPHug=; b=jrZVpFHWxMTZVGPE3b26AtIMX6fFWPpy7jG9ONNAjya+xGWm/5ge/MptzCoRqa3QN/OuD3 EfYXG+yofXLpdkkI+kuN+wgNA1hXtxDre4kOAORGkMB0SVX9fhUpOHuZhvPZp1jdB2CWp2 PARvNi/nimMfnbzIJcNXCwiyO2jqn48JtxEVu2BH3IIxTxtFxIt+4wAKQkVIVDq8vIkEmn 3Zc+f67QkgmNME9khtV4sWwPnu23Q3Q1tsLwF8LN0OFRlqXjzjAMiVFoKfgSbxxBl0jSY1 dYE/ccQamdo1DsUN5+EZtjo21CglcBKydQcHFIoQGk29N51cMCo1aw+xXPS7AQ== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Wed, 12 Feb 2025 16:46:28 +0100 Subject: [PATCH 09/12] wifi: wilc1000: disable firmware power save if bluetooth is in use Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250212-wilc3000_bt-v1-9-9609b784874e@bootlin.com> References: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> In-Reply-To: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> To: =?utf-8?q?Alexis_Lothor=C3=A9?= , Marcel Holtmann , Luiz Augusto von Dentz , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ajay Singh , Claudiu Beznea , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Nicolas Ferre , Alexandre Belloni Cc: Marek Vasut , Thomas Petazzoni , linux-bluetooth@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeggedvkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtkeertdertdejnecuhfhrohhmpeetlhgvgihishcunfhothhhohhrrocuoegrlhgvgihishdrlhhothhhohhrvgessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnhepgeevgefhteffuefhheekkeelffffvdeugffgveejffdtvdffudehtedtieevteetnecukfhppedvrgdtvdemkeegvdekmehfleegtgemvgdttdemmehfkeehnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehinhgvthepvdgrtddvmeekgedvkeemfhelgegtmegvtddtmeemfhekhedphhgvlhhopegludelvddrudeikedruddrudeljegnpdhmrghilhhfrhhomheprghlvgigihhsrdhlohhthhhorhgvsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopedvgedprhgtphhtthhopegtohhnohhrodgutheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhosghhsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopeguvghvihgtvghtrhgvvgesvhhgvghrrdhkvghrnhgvlhdrohhrghdpr hgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehkuhgsrgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrghrmhdqkhgvrhhnvghlsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtoheplhhuihiirdguvghnthiisehgmhgrihhlrdgtohhm X-GND-Sasl: alexis.lothore@bootlin.com X-Patchwork-Delegate: kuba@kernel.org If the wlan interface exposed by wilc driver has power save enabled (either explicitly with iw dev wlan set power_save on, or because kernel is built with CONFIG_CFG80211_DEFAULT_PS), it will send a power management command to the wlan firmware when corresponding interface is brought up. The bluetooth part, if used, is supposed to work independently from the WLAN CPU. Unfortunately, this power save management, if applied by the WLAN side, disrupts bluetooth operations (the bluetooth CPU does not answer any command anymore on the UART interface) Make sure that the bluetooth part can work independently by disabling power save in wlan firmware when bluetooth is in use. Signed-off-by: Alexis Lothoré --- drivers/net/wireless/microchip/wilc1000/bt.c | 29 +++++++++++++++++++--- drivers/net/wireless/microchip/wilc1000/cfg80211.c | 5 +++- drivers/net/wireless/microchip/wilc1000/netdev.h | 3 +++ 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/bt.c b/drivers/net/wireless/microchip/wilc1000/bt.c index b0f68a5479a5bd6f70e2390a35512037dc6c332b..f0eb5fb506eddf0f6f4f3f0b182eaa650c1c7a87 100644 --- a/drivers/net/wireless/microchip/wilc1000/bt.c +++ b/drivers/net/wireless/microchip/wilc1000/bt.c @@ -7,6 +7,7 @@ #include #include #include +#include "cfg80211.h" #include "netdev.h" #include "wlan_if.h" #include "wlan.h" @@ -261,22 +262,36 @@ static int wilc_bt_start(struct wilc *wilc) int wilc_bt_init(void *wilc_wl_priv) { struct wilc *wilc = (struct wilc *)wilc_wl_priv; + struct wilc_vif *vif; int ret; + wilc->bt_enabled = true; + if (!wilc->hif_func->hif_is_init(wilc)) { dev_info(wilc->dev, "Initializing bus before starting BT"); acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); ret = wilc->hif_func->hif_init(wilc, false); release_bus(wilc, WILC_BUS_RELEASE_ONLY); - if (ret) + if (ret) { + wilc->bt_enabled = false; return ret; + } } + /* Power save feature managed by WLAN firmware may disrupt + * operations from the bluetooth CPU, so disable it while bluetooth + * is in use (if enabled, it will be enabled back when bluetooth is + * not used anymore) + */ + vif = wilc_get_wl_to_vif(wilc); + if (wilc->power_save_mode && wilc_set_power_mgmt(vif, false)) + goto hif_deinit; + mutex_lock(&wilc->radio_fw_start); ret = wilc_bt_power_up(wilc); if (ret) { dev_err(wilc->dev, "Error powering up bluetooth chip\n"); - goto hif_deinit; + goto reenable_power_save; } ret = wilc_bt_firmware_download(wilc); if (ret) { @@ -293,10 +308,14 @@ int wilc_bt_init(void *wilc_wl_priv) power_down: wilc_bt_power_down(wilc); -hif_deinit: +reenable_power_save: + if (wilc->power_save_mode_request) + wilc_set_power_mgmt(vif, true); mutex_unlock(&wilc->radio_fw_start); +hif_deinit: if (!wilc->initialized) wilc->hif_func->hif_deinit(wilc); + wilc->bt_enabled = false; return ret; } EXPORT_SYMBOL(wilc_bt_init); @@ -304,6 +323,7 @@ EXPORT_SYMBOL(wilc_bt_init); int wilc_bt_shutdown(void *wilc_wl_priv) { struct wilc *wilc = (struct wilc *)wilc_wl_priv; + struct wilc_vif *vif; int ret; mutex_lock(&wilc->radio_fw_start); @@ -313,6 +333,9 @@ int wilc_bt_shutdown(void *wilc_wl_priv) dev_warn(wilc->dev, "Failed to disable BT CPU\n"); if (wilc_bt_power_down(wilc)) dev_warn(wilc->dev, "Failed to power down BT CPU\n"); + vif = wilc_get_wl_to_vif(wilc); + if (wilc->power_save_mode_request && wilc_set_power_mgmt(vif, true)) + dev_warn(wilc->dev, "Failed to set back wlan power save\n"); if (!wilc->initialized) wilc->hif_func->hif_deinit(wilc); mutex_unlock(&wilc->radio_fw_start); diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c index ff8c1a40634cee9960777eb017f6b2905e6399a5..04cff3561aad847a3f58a09766d0ef0fa61603e0 100644 --- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c +++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c @@ -1344,11 +1344,14 @@ static int set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, { struct wilc_vif *vif = netdev_priv(dev); struct wilc_priv *priv = &vif->priv; + struct wilc *wilc = vif->wilc; if (!priv->hif_drv) return -EIO; - wilc_set_power_mgmt(vif, enabled); + wilc->power_save_mode_request = enabled; + if (!wilc->bt_enabled) + wilc_set_power_mgmt(vif, enabled); return 0; } diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.h b/drivers/net/wireless/microchip/wilc1000/netdev.h index 5837f8ffe548dad1b756cdbd8543636f2be0e9b0..4c297eb95eeb143fc2f1248e616ee307afa52dbd 100644 --- a/drivers/net/wireless/microchip/wilc1000/netdev.h +++ b/drivers/net/wireless/microchip/wilc1000/netdev.h @@ -213,6 +213,7 @@ struct wilc { struct clk *rtc_clk; bool initialized; u32 chipid; + bool power_save_mode_request; bool power_save_mode; int dev_irq_num; int close; @@ -289,6 +290,8 @@ struct wilc { u8 nv_mac_address[ETH_ALEN]; /* Lock to prevent concurrent start of wlan/bluetooth firmware */ struct mutex radio_fw_start; + /* Is the bluetooth part in use ? */ + bool bt_enabled; }; struct wilc_wfi_mon_priv { From patchwork Wed Feb 12 15:46:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9_=28eBPF_Foundation=29?= X-Patchwork-Id: 13972006 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8ECDE260A33; Wed, 12 Feb 2025 15:47:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375282; cv=none; b=NRPmzjIRF3xDW7sTwZSVo6i4/bde2S12OQ83htN5Fm+Wo3UkwVlw+XY0N+qDrp6W3CfW3ks1c0PNRx04Rhw0BLr32u3POevBsGoXYVfI41h63sMdh0UUwudwGg9/v0R3TILHjkZos1Fo7i1BWOg8bymPYgVSMVNdN5kMJPB9iK8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375282; c=relaxed/simple; bh=fYVaUjVpOZRNw0S/JxgOjIog5MTjm+jUX2SsawPqNx4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BmFibWZMWjhkIP7etAhrb1dmlevzQqOLwcZLU31H1Uooh2XJPwMfng0mBRTbA2s7cL87vftxjcAlP8KwkdxUAv9GysBklV3dHJHXREcDvA+7rB1264UWr1qNps6OmEBu73aOVzUZmc4kHXE7fCsQrSFsYmf19yNPnQzJGQS0vvE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=nzQjBATA; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="nzQjBATA" Received: by mail.gandi.net (Postfix) with ESMTPSA id DE26644166; Wed, 12 Feb 2025 15:47:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1739375277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pUgTDBJ7HqgNU9e/B8PEjHEMHLmkvOsenNOHrVru48I=; b=nzQjBATAZ/NKCeU5kTh9nkowbvXCRZLIhBCTTt0Bq8Nkb3yfE9zitxrOfPhX+bp850tf14 wk2trk9a50Kbee3D1SrYegZfyiT23Af75q/kyNDr4jhG7L7yX94YgwUzlTwV3N6BlrW713 mXSoCinP5wxS/h6hiWdXcjOr41JpIsDFIOiYpBRZ2j9E4C/CRRwdEmjjKXMKnz0uyCTGxj OhnBLgmvJpow/yUMnYPBtD6GWN/ZmbTR8a8dEq9tdhXgNRfEPCvHjEi+PM4rtlZwKP6wli k0brz7y685H8tGkfZl/wm0Qcf4bMtd70t7vN0XfDZ2vJDcHWoxJvWt7aaDBPuw== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Wed, 12 Feb 2025 16:46:29 +0100 Subject: [PATCH 10/12] bluetooth: hci_wilc: add wilc hci driver Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250212-wilc3000_bt-v1-10-9609b784874e@bootlin.com> References: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> In-Reply-To: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> To: =?utf-8?q?Alexis_Lothor=C3=A9?= , Marcel Holtmann , Luiz Augusto von Dentz , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ajay Singh , Claudiu Beznea , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Nicolas Ferre , Alexandre Belloni Cc: Marek Vasut , Thomas Petazzoni , linux-bluetooth@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeggedvkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtkeertdertdejnecuhfhrohhmpeetlhgvgihishcunfhothhhohhrrocuoegrlhgvgihishdrlhhothhhohhrvgessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnhepgeevgefhteffuefhheekkeelffffvdeugffgveejffdtvdffudehtedtieevteetnecukfhppedvrgdtvdemkeegvdekmehfleegtgemvgdttdemmehfkeehnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehinhgvthepvdgrtddvmeekgedvkeemfhelgegtmegvtddtmeemfhekhedphhgvlhhopegludelvddrudeikedruddrudeljegnpdhmrghilhhfrhhomheprghlvgigihhsrdhlohhthhhorhgvsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopedvgedprhgtphhtthhopegtohhnohhrodgutheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhosghhsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopeguvghvihgtvghtrhgvvgesvhhgvghrrdhkvghrnhgvlhdrohhrghdpr hgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehkuhgsrgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrghrmhdqkhgvrhhnvghlsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtoheplhhuihiirdguvghnthiisehgmhgrihhlrdgtohhm X-GND-Sasl: alexis.lothore@bootlin.com WILC3000 is a combo chip providing 802.11b/g/n and Bluetooth 5.0 capabilities. The wifi side is used either over SDIO or SPI, and the bluetooth side is used over uart, with standard hci. The wifi side is already supported by Linux. Add a dedicated bluetooth driver to support the bluetooth feature from wilc3000 chip. Similarly to other supported bluetooth chips, wilc devices need a firmware to be uploaded before being able to use bluetooth. However, the major difference is that the firmware needs to be uploaded through the wifi bus (SDIO or SPI). This constraint makes this new driver depends on the corresponding wilc wlan driver for the bluetooth setup. Once the basic BT initialization has been performed, both side can be used independently, and in parallel. Since this creates a dependency to some wlan driver, create a dedicated module (hci_wilc) rather than integrating wilc bluetooth support in hci_uart, to avoid propagating this dependency. Signed-off-by: Alexis Lothoré Reviewed-by: Luiz Augusto von Dentz --- drivers/bluetooth/Kconfig | 13 ++ drivers/bluetooth/Makefile | 3 +- drivers/bluetooth/hci_uart.h | 1 + drivers/bluetooth/hci_wilc.c | 333 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 349 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index 4ab32abf0f48644715d4c27ec0d2fdaccef62b76..a96607fb0cc8fed2ccb1811a4b1b4fe586396b07 100644 --- a/drivers/bluetooth/Kconfig +++ b/drivers/bluetooth/Kconfig @@ -147,6 +147,19 @@ config BT_HCIUART_NOKIA Say Y here to compile support for Nokia's H4+ protocol. +config BT_HCIUART_WILC + tristate "WILC protocol support" + depends on (WILC1000_SDIO || WILC1000_SPI) + select WILC_BT + depends on BT_HCIUART + depends on BT_HCIUART_SERDEV + select BT_HCIUART_H4 + help + The WILC uart protocol allows interacting with wilc3000 chips + with HCI over UART. The bluetooth firmware needs to be uploaded + to the chip through the main bus, so this driver needs the + corresponding wlan driver. + config BT_HCIUART_BCSP bool "BCSP protocol support" depends on BT_HCIUART diff --git a/drivers/bluetooth/Makefile b/drivers/bluetooth/Makefile index 81856512ddd030ba8172ff106b80b4b951188cbd..a1e69884acf4ce91f02ff5592541616048b07e31 100644 --- a/drivers/bluetooth/Makefile +++ b/drivers/bluetooth/Makefile @@ -35,10 +35,11 @@ obj-$(CONFIG_BT_NXPUART) += btnxpuart.o obj-$(CONFIG_BT_HCIUART_NOKIA) += hci_nokia.o obj-$(CONFIG_BT_HCIRSI) += btrsi.o - btmrvl-y := btmrvl_main.o btmrvl-$(CONFIG_DEBUG_FS) += btmrvl_debugfs.o +obj-$(CONFIG_BT_HCIUART_WILC) += hci_wilc.o + hci_uart-y := hci_ldisc.o hci_uart-$(CONFIG_BT_HCIUART_SERDEV) += hci_serdev.o hci_uart-$(CONFIG_BT_HCIUART_H4) += hci_h4.o diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h index fbf3079b92a5339154f8847ff36b3c08ef49e2bb..83fc48be4335e0946853fdec32c38bf2fb195009 100644 --- a/drivers/bluetooth/hci_uart.h +++ b/drivers/bluetooth/hci_uart.h @@ -35,6 +35,7 @@ #define HCI_UART_NOKIA 10 #define HCI_UART_MRVL 11 #define HCI_UART_AML 12 +#define HCI_UART_WILC 13 #define HCI_UART_RAW_DEVICE 0 #define HCI_UART_RESET_ON_INIT 1 diff --git a/drivers/bluetooth/hci_wilc.c b/drivers/bluetooth/hci_wilc.c new file mode 100644 index 0000000000000000000000000000000000000000..97dc4620c74ef0733469839adda7890bda90406e --- /dev/null +++ b/drivers/bluetooth/hci_wilc.c @@ -0,0 +1,333 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Bluetooth HCI UART driver for WILC devices + * + */ +#include "linux/bitops.h" +#include "linux/byteorder/generic.h" +#include "linux/err.h" +#include "linux/gfp_types.h" +#include "net/bluetooth/bluetooth.h" +#include "net/bluetooth/hci.h" +#include +#include +#include +#include +#include +#include +#include + +#include "hci_uart.h" + +#define WILC_BT_UART_MANUFACTURER 205 +#define WILC_UART_DEFAULT_BAUDRATE 115200 +#define WILC_UART_BAUDRATE 460800 + +#define HCI_VERSION_BOOTROM 0xFF +#define HCI_VERSION_FIRMWARE 0x06 + +#define HCI_VENDOR_CMD_WRITE_MEM 0xFC52 +#define HCI_VENDOR_CMD_UPDATE_UART 0xFC53 +#define HCI_VENDOR_CMD_UPDATE_ADDR 0xFC54 +#define HCI_VENDOR_CMD_RESET 0xFC55 +#define HCI_VENDOR_CMD_READ_REG 0xFC01 + +struct wilc_adapter { + struct hci_uart hu; + struct device *dev; + void *wlan_priv; + bool flow_control; +}; + +struct wilc_data { + struct sk_buff *rx_skb; + struct sk_buff_head txq; +}; + +struct hci_update_uart_param { + __le32 baudrate; + __u8 flow_control; +} __packed; + +static int wilc_open(struct hci_uart *hu) +{ + struct wilc_data *wdata; + + BT_DBG("hci_wilc: open"); + wdata = kzalloc(sizeof(*wdata), GFP_KERNEL); + if (!wdata) + return -ENOMEM; + skb_queue_head_init(&wdata->txq); + hu->priv = wdata; + + return 0; +} + +static int wilc_close(struct hci_uart *hu) +{ + struct wilc_data *wdata = hu->priv; + + BT_DBG("hci_wilc: close"); + skb_queue_purge(&wdata->txq); + kfree_skb(wdata->rx_skb); + kfree(wdata); + hu->priv = NULL; + return 0; +} + +static int wilc_flush(struct hci_uart *hu) +{ + struct wilc_data *wdata = hu->priv; + + BT_DBG("hci_wilc: flush"); + skb_queue_purge(&wdata->txq); + return 0; +} + +static const struct h4_recv_pkt wilc_bt_recv_pkts[] = { + { H4_RECV_ACL, .recv = hci_recv_frame }, + { H4_RECV_SCO, .recv = hci_recv_frame }, + { H4_RECV_EVENT, .recv = hci_recv_frame }, +}; + +static int wilc_recv(struct hci_uart *hu, const void *data, int len) +{ + struct wilc_data *wdata = hu->priv; + int err; + + if (!test_bit(HCI_UART_REGISTERED, &hu->flags)) + return -EUNATCH; + wdata->rx_skb = h4_recv_buf(hu->hdev, wdata->rx_skb, data, len, + wilc_bt_recv_pkts, + ARRAY_SIZE(wilc_bt_recv_pkts)); + if (IS_ERR(wdata->rx_skb)) { + err = PTR_ERR(wdata->rx_skb); + bt_dev_err(hu->hdev, "Frame reassembly failed (%d)", err); + wdata->rx_skb = NULL; + } + + return len; +} + +static int wilc_enqueue(struct hci_uart *hu, struct sk_buff *skb) +{ + struct wilc_data *wdata = hu->priv; + + BT_DBG("hci_wilc: enqueue skb %pK", skb); + memcpy(skb_push(skb, 1), &hci_skb_pkt_type(skb), 1); + skb_queue_tail(&wdata->txq, skb); + return 0; +} + +static struct sk_buff *wilc_dequeue(struct hci_uart *hu) +{ + struct wilc_data *wdata = hu->priv; + + BT_DBG("hci_wilc: dequeue skb"); + return skb_dequeue(&wdata->txq); +} + +static int _set_uart_settings(struct hci_uart *hu, unsigned int speed, + bool flow_control) +{ + struct hci_update_uart_param param; + int ret; + + param.baudrate = cpu_to_le32(speed); + param.flow_control = flow_control ? 1 : 0; + ret = __hci_cmd_sync_status(hu->hdev, HCI_VENDOR_CMD_UPDATE_UART, + sizeof(param), ¶m, HCI_CMD_TIMEOUT); + if (ret) { + BT_ERR("Failed to update UART settings"); + return ret; + } + + serdev_device_set_baudrate(hu->serdev, speed); + serdev_device_set_flow_control(hu->serdev, flow_control); + + return 0; +} + +static int wilc_set_baudrate(struct hci_uart *hu, unsigned int speed) +{ + struct wilc_adapter *wilc_adapter; + + BT_INFO("WILC uart settings update request: speed=%d", speed); + wilc_adapter = serdev_device_get_drvdata(hu->serdev); + + return _set_uart_settings(hu, speed, wilc_adapter->flow_control); +} + +static int check_firmware_running(struct hci_uart *hu) +{ + struct hci_rp_read_local_version *version; + struct sk_buff *skb; + int ret = 0; + + BT_DBG("Resetting bluetooth chip"); + ret = __hci_cmd_sync_status(hu->hdev, HCI_OP_RESET, 0, NULL, + HCI_CMD_TIMEOUT); + if (ret) { + BT_ERR("Can not reset wilc"); + return ret; + } + + BT_DBG("Checking chip state"); + skb = __hci_cmd_sync(hu->hdev, HCI_OP_READ_LOCAL_VERSION, 0, NULL, + HCI_CMD_TIMEOUT); + if (IS_ERR(skb)) { + BT_ERR("Error while checking bootrom"); + return PTR_ERR(skb); + } + + if (skb->len != sizeof(struct hci_rp_read_local_version)) { + BT_ERR("Can not read local version"); + return -1; + } + version = (struct hci_rp_read_local_version *)skb->data; + BT_DBG("Status: 0x%1X, HCI version: 0x%1X", version->status, + version->hci_ver); + kfree_skb(skb); + if (version->hci_ver != HCI_VERSION_FIRMWARE) { + BT_ERR("Bluetooth firmware is not running !"); + if (version->hci_ver == HCI_VERSION_BOOTROM) + BT_WARN("Bootrom is running"); + return 1; + } + BT_DBG("Firmware is running"); + return 0; +} + +static int wilc_setup(struct hci_uart *hu) +{ + struct wilc_adapter *wilc_adapter; + int ret; + + BT_DBG("hci_wilc: setup"); + serdev_device_set_baudrate(hu->serdev, WILC_UART_DEFAULT_BAUDRATE); + serdev_device_set_flow_control(hu->serdev, false); + ret = check_firmware_running(hu); + if (ret) + return ret; + + BT_DBG("Updating firmware uart settings"); + + wilc_adapter = serdev_device_get_drvdata(hu->serdev); + ret = _set_uart_settings(&wilc_adapter->hu, WILC_UART_BAUDRATE, true); + if (ret) { + BT_ERR("Failed to reconfigure firmware uart settings"); + return ret; + } + wilc_adapter->flow_control = true; + + BT_INFO("Wilc successfully initialized"); + return ret; +} + +static const struct hci_uart_proto wilc_bt_proto = { + .id = HCI_UART_WILC, + .name = "Microchip", + .manufacturer = WILC_BT_UART_MANUFACTURER, + .init_speed = WILC_UART_DEFAULT_BAUDRATE, + .open = wilc_open, + .close = wilc_close, + .flush = wilc_flush, + .recv = wilc_recv, + .enqueue = wilc_enqueue, + .dequeue = wilc_dequeue, + .setup = wilc_setup, + .set_baudrate = wilc_set_baudrate, +}; + +static int wilc_bt_serdev_probe(struct serdev_device *serdev) +{ + struct wilc_adapter *wilc_adapter; + struct device_node *wlan_node; + void *wlan = NULL; + int ret; + + wilc_adapter = kzalloc(sizeof(*wilc_adapter), GFP_KERNEL); + if (!wilc_adapter) + return -ENOMEM; + + wlan_node = of_parse_phandle(serdev->dev.of_node, "wlan", 0); + if (!wlan_node) { + BT_ERR("Can not run wilc bluetooth without wlan node"); + ret = -EINVAL; + goto exit_free_adapter; + } + +#if IS_ENABLED(CONFIG_WILC1000_SDIO) + wlan = wilc_sdio_get_byphandle(wlan_node); +#endif +#if IS_ENABLED(CONFIG_WILC1000_SPI) + if (!wlan || wlan == ERR_PTR(-EPROBE_DEFER)) + wlan = wilc_spi_get_byphandle(wlan_node); +#endif + if (IS_ERR(wlan)) { + pr_warn("Can not initialize bluetooth: %pe\n", wlan); + ret = PTR_ERR(wlan); + goto exit_put_wlan_node; + } + + of_node_put(wlan_node); + wilc_adapter->wlan_priv = wlan; + ret = wilc_bt_init(wlan); + if (ret) { + pr_err("Failed to initialize bluetooth firmware (%d)\n", ret); + goto exit_put_wlan; + } + + wilc_adapter->dev = &serdev->dev; + wilc_adapter->hu.serdev = serdev; + wilc_adapter->flow_control = false; + serdev_device_set_drvdata(serdev, wilc_adapter); + ret = hci_uart_register_device(&wilc_adapter->hu, &wilc_bt_proto); + if (ret) { + dev_err(&serdev->dev, "Failed to register hci device"); + goto exit_deinit_bt; + } + + dev_info(&serdev->dev, "WILC hci interface registered"); + return 0; + +exit_deinit_bt: + wilc_bt_shutdown(wlan); +exit_put_wlan: + wilc_put(wlan); +exit_put_wlan_node: + of_node_put(wlan_node); +exit_free_adapter: + kfree(wilc_adapter); + return ret; +} + +static void wilc_bt_serdev_remove(struct serdev_device *serdev) +{ + struct wilc_adapter *wilc_adapter = serdev_device_get_drvdata(serdev); + + hci_uart_unregister_device(&wilc_adapter->hu); + wilc_bt_shutdown(wilc_adapter->wlan_priv); + wilc_put(wilc_adapter->wlan_priv); + kfree(wilc_adapter); +} + +static const struct of_device_id wilc_bt_of_match[] = { + { .compatible = "microchip,wilc3000-bt" }, + {}, +}; +MODULE_DEVICE_TABLE(of, wilc_bt_of_match); + +static struct serdev_device_driver wilc_bt_serdev_driver = { + .probe = wilc_bt_serdev_probe, + .remove = wilc_bt_serdev_remove, + .driver = { + .name = "hci_uart_wilc", + .of_match_table = of_match_ptr(wilc_bt_of_match), + }, +}; + +module_serdev_device_driver(wilc_bt_serdev_driver) +MODULE_AUTHOR("Alexis Lothoré "); +MODULE_DESCRIPTION("Bluetooth HCI Uart for WILC devices"); +MODULE_LICENSE("GPL"); From patchwork Wed Feb 12 15:46:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9_=28eBPF_Foundation=29?= X-Patchwork-Id: 13972007 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB96326137A; Wed, 12 Feb 2025 15:48:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375283; cv=none; b=UWObZH77aAmlyPf1il85dGfPmuPfCAc414kD9fQvEFuY+i5+sXyJYQJXJpRfPWqreQr8ubPGSowxxmoH7ajWnvnQv9EhlmA3JgZcUkQjtAFlN1iA4esfF4emXzPqfIBajvAUV+AxtQHTmyTALyaDvUdyyRYRfpKZEUE6Td6sKbo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375283; c=relaxed/simple; bh=7Nuvq0/XaKtH4YYZYU9GOiSo9SqvZGltin6mD5/9gJA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PBGRRb8U9ZhWSxZT2RZUergO/jH4OF9JnOiahA3PtiqfeRm4tFflnYspijAtRmamtYHYIdkHZb8534TfhR/FVUhmLUhtZJ54B5I9/rrLOPP9OmGp0liaU+yLwfWb/GCwXcaqOf8I0vyE/6Zp9KdZWenlZnKePd9kBtEtjGPshYc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=M/Zjyda5; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="M/Zjyda5" Received: by mail.gandi.net (Postfix) with ESMTPSA id 0C692440FC; Wed, 12 Feb 2025 15:47:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1739375279; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p9mJBeQJc9XrbJbz/UPw2MShuHNEjyFKhfrVFDRUvK8=; b=M/Zjyda56Eh4V0dsM4qeR+/eslwZfJQPAYgKb1WzvTTfRW0i8U2TNFAM697MotdutEeiXS 3xlhRpa+zc4gqJOl3N+yWbCuPQqt0mNQhCmyS4XZe5folQvFmsDQNBoD6EULajikDVFBsP HrOMnHdt/+LXGxmMKEWfW3Y1weQVEV/PiIXJiIFfSOdJp2BKbLcvpf8tTaxgoHuFPyiRMc wc+39CjNGKTgTNcbM6p5h510bNColfVX6zgHbV9YhjxA6u4Rt0lNl2f2eD+k9vr+yhe2sb bzTvNkDwqqOAYIGi3uAeV5NKiabl/obLsnlyLNiWkpE5+6SRQnCa8G/PiEtNiA== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Wed, 12 Feb 2025 16:46:30 +0100 Subject: [PATCH 11/12] ARM: dts: at91-sama5d27_wlsom1: update bluetooth chip description Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250212-wilc3000_bt-v1-11-9609b784874e@bootlin.com> References: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> In-Reply-To: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> To: =?utf-8?q?Alexis_Lothor=C3=A9?= , Marcel Holtmann , Luiz Augusto von Dentz , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ajay Singh , Claudiu Beznea , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Nicolas Ferre , Alexandre Belloni Cc: Marek Vasut , Thomas Petazzoni , linux-bluetooth@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeggedvkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtkeertdertdejnecuhfhrohhmpeetlhgvgihishcunfhothhhohhrrocuoegrlhgvgihishdrlhhothhhohhrvgessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnhepgeevgefhteffuefhheekkeelffffvdeugffgveejffdtvdffudehtedtieevteetnecukfhppedvrgdtvdemkeegvdekmehfleegtgemvgdttdemmehfkeehnecuvehluhhsthgvrhfuihiivgepkeenucfrrghrrghmpehinhgvthepvdgrtddvmeekgedvkeemfhelgegtmegvtddtmeemfhekhedphhgvlhhopegludelvddrudeikedruddrudeljegnpdhmrghilhhfrhhomheprghlvgigihhsrdhlohhthhhorhgvsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopedvgedprhgtphhtthhopegtohhnohhrodgutheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhosghhsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopeguvghvihgtvghtrhgvvgesvhhgvghrrdhkvghrnhgvlhdrohhrghdpr hgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehkuhgsrgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrghrmhdqkhgvrhhnvghlsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtoheplhhuihiirdguvghnthiisehgmhgrihhlrdgtohhm X-GND-Sasl: alexis.lothore@bootlin.com The SAMA5D27 WLSOM1 plaftorm embeds a wilc3000 chip exposing 802.11b/g/n and bluetooth 5. The current description for this chip does not expose the bluetooth part: it only configures the relevant flexcom peripheral to set it as uart, and relies on user to trigger the corresponding hci device creation in kernel through hci_attach. Now that a bluetooth driver is available and handles the device creation, replace the bare uart description with a proper bluetooth node. Signed-off-by: Alexis Lothoré --- arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1.dtsi | 8 ++++++++ arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1_ek.dts | 10 ---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1.dtsi b/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1.dtsi index ef11606a82b31c2f745141cdac1318805f473273..10d48a9ef92c9621a8885feebda6119d3f61af75 100644 --- a/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1.dtsi +++ b/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1.dtsi @@ -50,10 +50,18 @@ wifi_pwrseq: wifi_pwrseq { &flx1 { atmel,flexcom-mode = ; + status = "okay"; uart6: serial@200 { pinctrl-0 = <&pinctrl_flx1_default>; pinctrl-names = "default"; + atmel,use-dma-rx; + atmel,use-dma-tx; + status = "okay"; + bluetooth: bluetooth@0 { + compatible = "microchip,wilc3000-bt"; + wlan = <&wilc>; + }; }; }; diff --git a/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1_ek.dts b/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1_ek.dts index 15239834d886edbf9e732ac461a92ac9eea42ae5..8b89ee0b47ccb6e60b67f3e4db6caa827ce9c0bc 100644 --- a/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1_ek.dts +++ b/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1_ek.dts @@ -85,16 +85,6 @@ uart5: serial@200 { }; }; -&flx1 { - status = "okay"; - - uart6: serial@200 { - atmel,use-dma-rx; - atmel,use-dma-tx; - status = "okay"; - }; -}; - &macb0 { status = "okay"; }; From patchwork Wed Feb 12 15:46:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9_=28eBPF_Foundation=29?= X-Patchwork-Id: 13972008 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00D78262151; Wed, 12 Feb 2025 15:48:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375285; cv=none; b=E0/FHMWe2iP1OlQHy5rzfQss/UeXWjz6F5hd08ewyx87MntF34eq9xptZPW0FVnK2KP3ARqrZFqojSRm++DOZn1gQvK3xqu3ARN5ib/7nowGI8OH3kdVF70Rbt/de1ygqYmyTlKXa6UZJ+zDFZ57DQ9rfzWknctaz7kuStfGcVE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739375285; c=relaxed/simple; bh=osZmc1DPVoTq245gL1CMMReUC2xc6UC5A8bH+WgUWnc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qcxsns8x82jdNw5bJCUjjDzFLNXMbPL68wwDflEXh5AXz0kCDDZczttCZ8iyfyAP4XheWMEFYJ7xMShsYNO3mNcJ0Nu9cwMucxYK/nYq/Hr98x4sCyUT+ObhCJ3I1ftobM7SU4RxslAzq22Zch9KDsuoUQJyeWM2GgET9kxsetU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=mXvv70m2; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="mXvv70m2" Received: by mail.gandi.net (Postfix) with ESMTPSA id 364144416E; Wed, 12 Feb 2025 15:47:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1739375280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P0G+yYadJWDhMsM9S6K3wOyG/oWy+c8825+nanSQpks=; b=mXvv70m2Am4yO9Kvh96qPNwuxJRncLele/NuEh6/2t4WDnmi3Z/YfV9XJ2Sc+NNlAW0FgG 7hxEycTIR8B7mq2rLD3m96VSZMlRCDVvtNR9IBwJNWyRy4Pn7VQaOeOhgeNU/N/dFdaHVl s+/443rY8H5dyrNEHa/6aNADLCq0wzn7oTBUF1MwUAdluXbD+hW2ESqaNHFvMtwvDuSLDg MYi+Ord8vFvRNsqeodt+svNBmSq85ft2DTI3BGiwtT0pIUpdrIoqKUTKpraxtbIn+5K08P hfH5ZQyps+2ZiKs537yNF+taQyBpbRY6dPth7dbiUyFT0Bhs7BFXZdYO6rVQtg== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Wed, 12 Feb 2025 16:46:31 +0100 Subject: [PATCH 12/12] MAINTAINERS: add entry for new wilc3000 bluetooth driver Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250212-wilc3000_bt-v1-12-9609b784874e@bootlin.com> References: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> In-Reply-To: <20250212-wilc3000_bt-v1-0-9609b784874e@bootlin.com> To: =?utf-8?q?Alexis_Lothor=C3=A9?= , Marcel Holtmann , Luiz Augusto von Dentz , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ajay Singh , Claudiu Beznea , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Nicolas Ferre , Alexandre Belloni Cc: Marek Vasut , Thomas Petazzoni , linux-bluetooth@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeggedvkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtkeertdertdejnecuhfhrohhmpeetlhgvgihishcunfhothhhohhrrocuoegrlhgvgihishdrlhhothhhohhrvgessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnhepgeevgefhteffuefhheekkeelffffvdeugffgveejffdtvdffudehtedtieevteetnecukfhppedvrgdtvdemkeegvdekmehfleegtgemvgdttdemmehfkeehnecuvehluhhsthgvrhfuihiivgepkeenucfrrghrrghmpehinhgvthepvdgrtddvmeekgedvkeemfhelgegtmegvtddtmeemfhekhedphhgvlhhopegludelvddrudeikedruddrudeljegnpdhmrghilhhfrhhomheprghlvgigihhsrdhlohhthhhorhgvsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopedvgedprhgtphhtthhopegtohhnohhrodgutheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhosghhsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopeguvghvihgtvghtrhgvvgesvhhgvghrrdhkvghrnhgvlhdrohhrghdpr hgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehkuhgsrgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrghrmhdqkhgvrhhnvghlsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtoheplhhuihiirdguvghnthiisehgmhgrihhlrdgtohhm X-GND-Sasl: alexis.lothore@bootlin.com Add MAINTAINERS entry for the new bluetooth driver in drivers/bluetooth/hci_wilc.c Signed-off-by: Alexis Lothoré --- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 82b227c3939a49996498f4e829541eb5380ab2b3..2f02aecc21e96a2f9e6ff2de3864bb2d2b964127 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15526,6 +15526,13 @@ L: linux-wireless@vger.kernel.org S: Supported F: drivers/net/wireless/microchip/wilc1000/ +MICROCHIP WILC3000 BLUETOOTH DRIVER +M: Alexis Lothoré +L: linux-bluetooth@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/net/bluetooth/microchip,wilc3000-bt.yaml +F: drivers/bluetooth/hci_wilc.c + MICROSEMI MIPS SOCS M: Alexandre Belloni M: UNGLinuxDriver@microchip.com