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?= X-Patchwork-Id: 864587 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: linux-bluetooth@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 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: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?= X-Patchwork-Id: 864586 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: linux-bluetooth@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 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: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?= X-Patchwork-Id: 864585 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: linux-bluetooth@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 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: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?= X-Patchwork-Id: 864584 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: linux-bluetooth@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 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?= X-Patchwork-Id: 864583 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: linux-bluetooth@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 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: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?= X-Patchwork-Id: 864582 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: linux-bluetooth@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"; };