From patchwork Wed Jan 17 16:07:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13521955 Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 818562232D for ; Wed, 17 Jan 2024 16:08:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507711; cv=none; b=KzwzdRCGVvz+spVlArJjOYchXj0ArZYfr5iwK73OwDaIWQ27KiVSXZ2x1lFSVs7G8c6qrAA9+8tmGr+JyUXfb0ZL4XZxsNtlPYaQFdWBmeQEz1c177ObQKYc/ZrgmyFSzN9B/kASl4Awb/7AejZYI8Z9ZgLUkdrzWBvxWo2aMmU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507711; c=relaxed/simple; bh=YJPbO02xZXC38YN0dl13MAiQwG58+JzZk9dqvuDQNpY=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:From: To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; b=AJ2pS6nPUCwnb3D7l/E/AuwEMcqOKLTDyEySh3Au5eX0fglbBcThDE2/+YeYEUWrQ375qUFo/vpvvYMU18XYd3pcRt43MFa6gkc7H/wPwYvGIuFs9qDLDSECvTRlO2tdiRdq7rWcf0ixS0kjC/XqJ2k4OWafQ9O4zOjECAkGRCM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=tPi4TmAT; arc=none smtp.client-ip=209.85.208.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="tPi4TmAT" Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2cd46e7ae8fso124681301fa.1 for ; Wed, 17 Jan 2024 08:08:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1705507708; x=1706112508; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=N6ddlML0IuZ2voh4C/FU4IMUf2JGddrkn1DncdKHaxQ=; b=tPi4TmATEZ+WCo1KmxFE7a/m27hO03JMdKpMp2mRXX70p7GFBW/MPukj3zYoJrpOvo dtxCvSjW/enVNxgzl4biz2aHxIKbhQCIJ4BGLvFwSWOzYtMmpVrvyxaUr8qPEygoyhOM ck9EoP79r9cqibm3ceO6GjjWSz45PZMRNO7hi1/3TQob5xmAgAC4oFNEolVyoXcK8GLP DdhmyFFvmE3kVhQAy9eiIP0tNJNHnQIBT4BfGCHm4xRXp/0C4pppWEXTprKHebK0Vg01 4sRyyLNImHAc2yuv9IWnEQbswVvkwnzgL+JBBqkfhdv94Ed3uoLqVY5MJZ5R+3dWdQED /svA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705507708; x=1706112508; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N6ddlML0IuZ2voh4C/FU4IMUf2JGddrkn1DncdKHaxQ=; b=PscKz/oVTmWJhoYcR/FaQaM0WGtkBh6NO4y3P89K6qGDgUQa/wDq5klI4HrNlJOEkV MseDIyz3nkGbMGGskWGo4TJKXOFt5AL42QDeV12dfz1KzP5/qoko8dyNS3S+DkYkUhgF bMLYzJZDgus/yXIjGnIZwV9dYMuXPFmttLYvTcm4/bY6mD5E6OhxefN8z996tJ7FVE3D /k8DKmOxwmogRC7gBUQycBe8vuO2irGXzOH4+KG0CsqeKYi9vWJWdYoi40NYdzskzAHU ogtCgUkoB+UN88wLZB5zWMjKbHcNlx7ai9hts8KLg+rASKt5B6w/XHDa7sLsocDlp8xj XfgQ== X-Gm-Message-State: AOJu0YzGbElJ43JVW4kx1HXcD/gWaNKqhtQn3uvNpPFMReLjhmALy1Xc e1a2o7s5W+qvRc/eD7XPWUQGF4UQ/VrdqQ== X-Google-Smtp-Source: AGHT+IE3YdoLC4uwScnR5w55Pu9PiyAWHj/OoMWnvbsMPQP7TmJR26qtwHM6LtwrN5dVsvSXykJlIw== X-Received: by 2002:a2e:961a:0:b0:2cd:b15:da81 with SMTP id v26-20020a2e961a000000b002cd0b15da81mr2041774ljh.171.1705507708393; Wed, 17 Jan 2024 08:08:28 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:d0b5:43ec:48:baad]) by smtp.gmail.com with ESMTPSA id t10-20020a5d6a4a000000b00337b0374a3dsm1972092wrw.57.2024.01.17.08.08.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 08:08:28 -0800 (PST) From: Bartosz Golaszewski To: Kalle Valo , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Catalin Marinas , Will Deacon , Bjorn Helgaas , Heiko Stuebner , Jernej Skrabec , Chris Morgan , Linus Walleij , Geert Uytterhoeven , Arnd Bergmann , Neil Armstrong , =?utf-8?q?N=C3=ADcolas_F_=2E_R_?= =?utf-8?q?=2E_A_=2E_Prado?= , Marek Szyprowski , Peng Fan , Robert Richter , Dan Williams , Jonathan Cameron , Terry Bowman , Lukas Wunner , Huacai Chen , Alex Elder , Srini Kandagatla , Greg Kroah-Hartman , Abel Vesa Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 1/9] arm64: dts: qcom: qrb5165-rb5: describe the WLAN module of QCA6390 Date: Wed, 17 Jan 2024 17:07:40 +0100 Message-Id: <20240117160748.37682-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240117160748.37682-1-brgl@bgdev.pl> References: <20240117160748.37682-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Bartosz Golaszewski Describe the ath11k WLAN on-board the QCA6390 module. Include the relevant regulators and the enable GPIO. Signed-off-by: Bartosz Golaszewski --- arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 29 ++++++++++++++++++++++++ arch/arm64/boot/dts/qcom/sm8250.dtsi | 10 ++++++++ 2 files changed, 39 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts index cd0db4f31d4a..35a5d1ee45e5 100644 --- a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts +++ b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts @@ -734,6 +734,27 @@ &pcie0_phy { vdda-pll-supply = <&vreg_l9a_1p2>; }; +&pcieport0 { + wifi@0 { + compatible = "pci17cb,1101"; + reg = <0x10000 0x0 0x0 0x0 0x0>; + + pinctrl-names = "default"; + pinctrl-0 = <&wlan_en_state>; + + enable-gpios = <&tlmm 20 GPIO_ACTIVE_HIGH>; + + vddio-supply = <&vreg_s4a_1p8>; + vddaon-supply = <&vreg_s6a_0p95>; + vddpmu-supply = <&vreg_s2f_0p95>; + vddrfa1-supply = <&vreg_s2f_0p95>; + vddrfa2-supply = <&vreg_s8c_1p3>; + vddrfa3-supply = <&vreg_s5a_1p9>; + vddpcie1-supply = <&vreg_s8c_1p3>; + vddpcie2-supply = <&vreg_s5a_1p9>; + }; +}; + &pcie1 { status = "okay"; }; @@ -1303,6 +1324,14 @@ sdc2_card_det_n: sd-card-det-n-state { function = "gpio"; bias-pull-up; }; + + wlan_en_state: wlan-default-state { + pins = "gpio20"; + function = "gpio"; + drive-strength = <16>; + output-low; + bias-pull-up; + }; }; &uart6 { diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi index 760501c1301a..fef9c314ce55 100644 --- a/arch/arm64/boot/dts/qcom/sm8250.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi @@ -2197,6 +2197,16 @@ pcie0: pcie@1c00000 { dma-coherent; status = "disabled"; + + pcieport0: pcie@0 { + device_type = "pci"; + reg = <0x0 0x0 0x0 0x0 0x0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + bus-range = <0x01 0xff>; + }; }; pcie0_phy: phy@1c06000 { From patchwork Wed Jan 17 16:07:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13521956 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6EE6224CA for ; Wed, 17 Jan 2024 16:08:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507714; cv=none; b=k/AKj8iRcr9gHdavWkkfyFRo/ad9AcC9g9etKCgLBoda6hq9dcF2qUmjFzj1ufjo9UOMlWL3QOwdzXEu5hX3pzrZhDdIdV/EUdBdMCL7JqMj74f7a/WA4RqNH2vkQKQJm+kh3CbTYdFQubYw3i/d13JzWUceocE2jXIQOxqhXtk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507714; c=relaxed/simple; bh=q/5JvxXT/ttZHOPaBaK+hkdqKMYeEJovznnWmWlfS1s=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:From: To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; b=b1fg8kYi3TPHMz0rucP2TerVXM1Bh9tZ+elKllchU+Lg37xOOorXGNNUhLgoa/pKluQrSgIc6oEM9zDLhw8TCu0fV211Zb04tjJQEHkyu0qDr7DRAX8PGF1dGe2YhwWz2gBxE30BEiJ4LjM5hpDDHI5b3t0LA6DpPjMrDd5GA78= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=tMKIvYwo; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="tMKIvYwo" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-337bfab4137so1301397f8f.3 for ; Wed, 17 Jan 2024 08:08:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1705507710; x=1706112510; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ro38Lp7JNlLkoqTkPC0jSkCRLb9P/XpaGuu5BBfa8bA=; b=tMKIvYwoBDlYwUE0dJrwY09I80JN04KijzsGqod4oS88tUwpVoWcGHibY8ldR+Zky/ 10RiHIpzFB6sx5PSvCAVx28yXyVPOzB+AFgS6/5s64R29277oOYsx3hXPirCwRIo7ERJ 2t8tTCMLjSwMtkHk+hk9jkixAysLs3+hJx541tbRWW0RjqvniITxpi0Ri1fS/eoX6amo 3/umARPWQRIMIHHARrLwSSYm387/jlhGrVbt45XZa3+AADmPvTxaLr0uDCwR1p6Etr/t w9Ow1rk3+wmcPdaPzWhqma99WTN0GmfRMzvuvKV4q5Er0vo2ETSID/DnrdV9fMXl2s/P GwEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705507710; x=1706112510; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ro38Lp7JNlLkoqTkPC0jSkCRLb9P/XpaGuu5BBfa8bA=; b=iQMzDwBj1W/ze4ldj0eoVOxQTE/dkOflShLG8yZ2tqbIuIyMjdm7tyz1DFg7ELUbnB 4VRlLJqtI6rd1PMzQL2LuISXwiv5lX+1PkYggrfMxLAyKqjHgIuNYPyKCYz315aOuVWa tpV6g/nZUFXz9G5T7vVcNIzB5zuDSJVjRvIlhzK4o3hjZxphYQjxnvpfTy3TCMI3zHBn O4oTtl0gyTZjWvTysuXb+zErF2fWY3WGhzZRRBd82hSfxjYdI948IaJ8/f0vcPnbOhGP a6Hhc40kxIc49ejT6nEDAruGCAgs8lvAUvQapE7o0Ic4KksKM2z6MlLtDEnOahjDqrW4 5ROw== X-Gm-Message-State: AOJu0Yx7Hujh53WW3iBvq7Kw+oCLTsybjymjGRRLIFLbdlfAwrGjBIRz RhT/PJ4BLwjkMcykQxfEPkfDkJ3NbV3e8Q== X-Google-Smtp-Source: AGHT+IG2cSHLZyBy+LfnWZmmWmZ9clofYKmi0CdUV8SqFi2L1ljutoUNe61FdvAk4xWK60ztTQIGPA== X-Received: by 2002:a5d:65c6:0:b0:337:8d89:7364 with SMTP id e6-20020a5d65c6000000b003378d897364mr6008069wrw.50.1705507709990; Wed, 17 Jan 2024 08:08:29 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:d0b5:43ec:48:baad]) by smtp.gmail.com with ESMTPSA id t10-20020a5d6a4a000000b00337b0374a3dsm1972092wrw.57.2024.01.17.08.08.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 08:08:29 -0800 (PST) From: Bartosz Golaszewski To: Kalle Valo , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Catalin Marinas , Will Deacon , Bjorn Helgaas , Heiko Stuebner , Jernej Skrabec , Chris Morgan , Linus Walleij , Geert Uytterhoeven , Arnd Bergmann , Neil Armstrong , =?utf-8?q?N=C3=ADcolas_F_=2E_R_?= =?utf-8?q?=2E_A_=2E_Prado?= , Marek Szyprowski , Peng Fan , Robert Richter , Dan Williams , Jonathan Cameron , Terry Bowman , Lukas Wunner , Huacai Chen , Alex Elder , Srini Kandagatla , Greg Kroah-Hartman , Abel Vesa Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 2/9] arm64: dts: qcom: sm8550-qrd: add Wifi nodes Date: Wed, 17 Jan 2024 17:07:41 +0100 Message-Id: <20240117160748.37682-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240117160748.37682-1-brgl@bgdev.pl> References: <20240117160748.37682-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Neil Armstrong Describe the ath12k WLAN on-board the WCN7850 module present on the board. Signed-off-by: Neil Armstrong [Bartosz: - move the pcieport0 node into the .dtsi - make regulator naming consistent with existing DT code - add commit message] Signed-off-by: Bartosz Golaszewski --- arch/arm64/boot/dts/qcom/sm8550-qrd.dts | 37 +++++++++++++++++++++++++ arch/arm64/boot/dts/qcom/sm8550.dtsi | 10 +++++++ 2 files changed, 47 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts b/arch/arm64/boot/dts/qcom/sm8550-qrd.dts index d401d63e5c4d..c07e2ea1c95c 100644 --- a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts +++ b/arch/arm64/boot/dts/qcom/sm8550-qrd.dts @@ -813,6 +813,25 @@ &pcie0 { status = "okay"; }; +&pcieport0 { + wifi@0 { + compatible = "pci17cb,1107"; + reg = <0x10000 0x0 0x0 0x0 0x0>; + + pinctrl-names = "default"; + pinctrl-0 = <&wlan_en>, <&pmk8550_sleep_clk>; + + enable-gpios = <&tlmm 80 GPIO_ACTIVE_HIGH>; + + vddio-supply = <&vreg_l15b_1p8>; + vdd-supply = <&vreg_s5g_0p85>; + vddaon-supply = <&vreg_s2g_0p85>; + vdddig-supply = <&vreg_s4e_0p95>; + vddrfa1-supply = <&vreg_s6g_1p86>; + vddrfa2-supply = <&vreg_s4g_1p25>; + }; +}; + &pcie0_phy { vdda-phy-supply = <&vreg_l1e_0p88>; vdda-pll-supply = <&vreg_l3e_1p2>; @@ -900,6 +919,17 @@ &pcie_1_phy_aux_clk { clock-frequency = <1000>; }; +&pmk8550_gpios { + pmk8550_sleep_clk: sleep-clk-state { + pins = "gpio3"; + function = "func1"; + input-disable; + output-enable; + bias-disable; + power-source = <0>; + }; +}; + &qupv3_id_0 { status = "okay"; }; @@ -1035,6 +1065,13 @@ wcd_default: wcd-reset-n-active-state { bias-disable; output-low; }; + + wlan_en: wlan-en-state { + pins = "gpio80"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; }; &uart7 { diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi index ee1ba5a8c8fc..1f2dd4262eb9 100644 --- a/arch/arm64/boot/dts/qcom/sm8550.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi @@ -1754,6 +1754,16 @@ pcie0: pcie@1c00000 { phy-names = "pciephy"; status = "disabled"; + + pcieport0: pcie@0 { + device_type = "pci"; + reg = <0x0 0x0 0x0 0x0 0x0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + bus-range = <0x01 0xff>; + }; }; pcie0_phy: phy@1c06000 { From patchwork Wed Jan 17 16:07:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13521957 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E6D7225A4 for ; Wed, 17 Jan 2024 16:08:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507714; cv=none; b=d6OnMMUK8yhZoX19yH6eRs2UvkvWedVeEjd1DCTMCibuGTiUV0bmx4vvETl41IBWNS4ttRKPAIZIIlqEqk2K7ZSBZHJDcv5uTdAnoUDZQrF50FdqCvkQe6vVPf6lappVDyehRKyhkhvEUutsAJCoA0PioHWH9WZURYNNTg7OB9Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507714; c=relaxed/simple; bh=Pg/fENxXcu2zLMeYr9xAi8tTO7TWZmWEho6KkR40EUY=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:From: To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; b=Ue3i3wpEk6mkb2U664J+bc66LGjIQRR/yOB7iKBqZt9T2e32ARAODYw8SAFTXybfhYKveP8DBKyPhz4dj4rn3n0vPky7yYYFj0UQyLbMZhDz7xG7z4mrW9qo595NEfQxOEX/6no0GNHv9HGFnA9Rqdjp0h+Pt5/SAUaXpykGlMI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=y3PJUrNB; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="y3PJUrNB" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-40e80046246so16732605e9.1 for ; Wed, 17 Jan 2024 08:08:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1705507711; x=1706112511; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UE8rhVYnIQTzdmEB5YI9mr3bmEjnZIJOH8+2XDSin8c=; b=y3PJUrNBP4AUwWq5FuEWkKRR1/1KzL4skJqNfdhG8pMNdxVl/A4sXhWQS72ujgJ6dC tfoV8huuyDfUSl/uFbYc3aQoPSFygek8NzsdhNxXJVaY2m4RttX8I+6xnJvwoo+C0V9Y 7iBJKoItUdwm7U5s3v9abtaFqPQv7GPGS7DP6MEi8sUNg3i/eVLoV8rxtPUtE4BmuxTN QvQMR5sGthB/DhMP09AcVsFHH8ybNa6fqS/5m8h+UOPe8y1Nw3dNVcw6XuENHJ35ItUH P2IAyAB4/W2xHB+hnXlZv/Off59Yf2ef0K+eNkIVIFu5teKBzcTeFj0+WZCmP8TFHR90 WBXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705507711; x=1706112511; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UE8rhVYnIQTzdmEB5YI9mr3bmEjnZIJOH8+2XDSin8c=; b=OnPmImERhMTwMLmjY7Mt6vvQtQfvPe/6WOvn0dpxLhusP4PXGN8reiHy/Ef0FMKRlJ cBAJuF70efOTWYT/X6OUaVeV2pgr4FMH04tPhYeTTQwZ0/o9NmFOdkk2aJyFX1gGh0Ku h2h5GxdEQ+YCiw4fqt8PbOy7h3Ay57AmIIHCoYPo0u4QeciVnDt3j6AtoeVFnxC3czU0 Cgu6alrrpNT9fWgmnA4XALESutxAq46+62xN7CxXjPvFs9wpjpexFlctGU1CA/6dsWNz nb0ABN+ZHV3seJhYQE3Vwjs8c+fEbVZsx0iVv6rOsepgG6L3k2q4RI1zjrcSewtIeshz 44fQ== X-Gm-Message-State: AOJu0Yx9XArakRdyI1t17uHFtgTlAt1gZNDymCwq/UeW+BaYhk0sMLrd 72V7X/ggfjamBnPCpJptrmyVhuY3Piri/g== X-Google-Smtp-Source: AGHT+IHByLRYyKW3b144ASkrglpPI9QJNxChiqmFxutANx4g+4ZbmJ77dmnLmrrxPnGs9ZVDZm3/oA== X-Received: by 2002:a05:600c:d8:b0:40e:437a:1b56 with SMTP id u24-20020a05600c00d800b0040e437a1b56mr625379wmm.143.1705507711532; Wed, 17 Jan 2024 08:08:31 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:d0b5:43ec:48:baad]) by smtp.gmail.com with ESMTPSA id t10-20020a5d6a4a000000b00337b0374a3dsm1972092wrw.57.2024.01.17.08.08.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 08:08:31 -0800 (PST) From: Bartosz Golaszewski To: Kalle Valo , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Catalin Marinas , Will Deacon , Bjorn Helgaas , Heiko Stuebner , Jernej Skrabec , Chris Morgan , Linus Walleij , Geert Uytterhoeven , Arnd Bergmann , Neil Armstrong , =?utf-8?q?N=C3=ADcolas_F_=2E_R_?= =?utf-8?q?=2E_A_=2E_Prado?= , Marek Szyprowski , Peng Fan , Robert Richter , Dan Williams , Jonathan Cameron , Terry Bowman , Lukas Wunner , Huacai Chen , Alex Elder , Srini Kandagatla , Greg Kroah-Hartman , Abel Vesa Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 3/9] arm64: dts: qcom: sm8650-qrd: add Wifi nodes Date: Wed, 17 Jan 2024 17:07:42 +0100 Message-Id: <20240117160748.37682-4-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240117160748.37682-1-brgl@bgdev.pl> References: <20240117160748.37682-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Neil Armstrong Describe the ath12k WLAN on-board the WCN7850 module present on the board. Signed-off-by: Neil Armstrong [Bartosz: - move the pcieport0 node into the .dtsi - make regulator naming consistent with existing DT code - add commit message] Signed-off-by: Bartosz Golaszewski --- arch/arm64/boot/dts/qcom/sm8650-qrd.dts | 29 +++++++++++++++++++++++++ arch/arm64/boot/dts/qcom/sm8650.dtsi | 10 +++++++++ 2 files changed, 39 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm8650-qrd.dts b/arch/arm64/boot/dts/qcom/sm8650-qrd.dts index 592a67a47c78..5f960d90e7d2 100644 --- a/arch/arm64/boot/dts/qcom/sm8650-qrd.dts +++ b/arch/arm64/boot/dts/qcom/sm8650-qrd.dts @@ -513,6 +513,28 @@ &pcie0 { status = "okay"; }; +&pcieport0 { + wifi@0 { + compatible = "pci17cb,1107"; + reg = <0x10000 0x0 0x0 0x0 0x0>; + + pinctrl-names = "default"; + pinctrl-0 = <&wlan_en>; + + enable-gpios = <&tlmm 16 GPIO_ACTIVE_HIGH>; + + vddio12-supply = <&vreg_l3c_1p2>; + vddio-supply = <&vreg_l15b_1p8>; + vdd-supply = <&vreg_s4i_0p85>; + vddaon-supply = <&vreg_s2c_0p8>; + vdddig-supply = <&vreg_s3c_0p9>; + vddrfa1-supply = <&vreg_s6c_1p8>; + vddrfa2-supply = <&vreg_s1c_1p2>; + + clocks = <&rpmhcc RPMH_RF_CLK1>; + }; +}; + &pcie0_phy { vdda-phy-supply = <&vreg_l1i_0p88>; vdda-pll-supply = <&vreg_l3i_1p2>; @@ -718,6 +740,13 @@ ts_reset: ts-reset-state { drive-strength = <8>; bias-pull-up; }; + + wlan_en: wlan-en-state { + pins = "gpio16"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; }; &uart14 { diff --git a/arch/arm64/boot/dts/qcom/sm8650.dtsi b/arch/arm64/boot/dts/qcom/sm8650.dtsi index 2df77123a8c7..1da8b7844224 100644 --- a/arch/arm64/boot/dts/qcom/sm8650.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8650.dtsi @@ -2270,6 +2270,16 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>, dma-coherent; status = "disabled"; + + pcieport0: pcie@0 { + device_type = "pci"; + reg = <0x0 0x0 0x0 0x0 0x0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + bus-range = <0x01 0xff>; + }; }; pcie0_phy: phy@1c06000 { From patchwork Wed Jan 17 16:07:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13521958 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72CEF22F1D for ; Wed, 17 Jan 2024 16:08:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507717; cv=none; b=UsjPWcImC5u/913S19pEVryANUuE4zHZfzArf4cuv0I5NkXl3WEBq00YN3ieWQBdXbTE77NiHSU7Cm8g18x0m6sCnSQ0EBOuVDQSG0R160dr/GoLDTgWioO5IgfoVEA6Z5JfMjdIvMsWasdTlzFdwS9xTj6FfMyQHZy+tjfMLxs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507717; c=relaxed/simple; bh=lTpSs6LvEorlDFYJlBesu7302lT6V9qqbgDL6TCPnF0=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:From: To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; b=TI9qFjbIVbHb2MrXLdBpzdAxQUmgjP9OgzXoILsmKJb0N55ydLDOHHzcREt5rlZtoz/kaiA47XKRZ5VY3aAu6O8GNWtKawRMZTVsANUQGISkgoeYacPt+HRZZEZDnTDHI9w4ZMnF1nUX7TRHfIklkcgZS20ZMAh1SCgTaVOtagQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=u/ToQgI0; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="u/ToQgI0" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-40e8c5dab9aso5746645e9.3 for ; Wed, 17 Jan 2024 08:08:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1705507713; x=1706112513; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SBCi6IfvSuWJWsQQRO0GbKoKMq+lADolGg2VRt1L2AY=; b=u/ToQgI0j9CVtBRPzW4lR2cmoBy0I4vd2WA76Q2OpF0WXIXY+tuO8Oeo07oTBRiUyS gfydF1v4rNlzqkvxcB7+b65zeVr/wx8ZYqbxz5aEKU9fvJ2mUFarQoT6qQy/XnO/bY+W ExxSxMowczg/fYj3Wjd0OxtKInQiRtJ4FhGf5kw3qUrZkpgXZgg4+CrWQUlYqQ/JW3PI cumz0g1IR/XVz1Yd5CHfVnKfU2ABOw6i9lBhEEph6WFjWX76PfPEe+v8GpR0wB8VHzcD DZYh90mtRk0Bi6o3EoKpDMn1ZNxF+0O19MDvrn7LO5SjTqdwM4WOPeJc+nu76bzMZrOe h3og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705507713; x=1706112513; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SBCi6IfvSuWJWsQQRO0GbKoKMq+lADolGg2VRt1L2AY=; b=Lrxz/I4EKMdgjw87fsgvIzVNznmPnqIlzDuM7rb3BTCKPNomTVDhCIwwMIte6vkJvj CC40UJZgk30tXMZAnwNZlL8FGf9imLbMG6uezcuZ1mOTvIM7/K+QE2zMYxoCeQRcP0oT jcvrzx/Q0tZIcxC3romb2uuy9vBjcvYbhBY5HB1IUxnIkjhusl/H7zPy8ywmzQs3lIrA EBSGz0q8aCBOVyqSt9KPJ5YKxUS3ObbPswqlx9JTjMfpqeBgciu+wcEZmC0cKNg/d0ED oDzh6ySGKi2Z5zSe7bkJb9H50B5PVvB9N7xQPldVD1je/zjbytWTSRUFTN39aG97TtiN Cjtg== X-Gm-Message-State: AOJu0Yw7x1ahzt+v4SM0QWLdx6sJ9aTBXty3Mobg1JZQiLILBwi16t49 i9LEpxH388BkCryx9xcHnGkty25fuXlcqQ== X-Google-Smtp-Source: AGHT+IFjljDDCnBBoAi7yTfH1zGRdwIMW4kRxn1c76OZTcbCEivzT08IjDIvclpxoDafVoi8g/kDtQ== X-Received: by 2002:a05:600c:2d48:b0:40e:5493:df45 with SMTP id a8-20020a05600c2d4800b0040e5493df45mr5263664wmg.166.1705507713165; Wed, 17 Jan 2024 08:08:33 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:d0b5:43ec:48:baad]) by smtp.gmail.com with ESMTPSA id t10-20020a5d6a4a000000b00337b0374a3dsm1972092wrw.57.2024.01.17.08.08.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 08:08:32 -0800 (PST) From: Bartosz Golaszewski To: Kalle Valo , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Catalin Marinas , Will Deacon , Bjorn Helgaas , Heiko Stuebner , Jernej Skrabec , Chris Morgan , Linus Walleij , Geert Uytterhoeven , Arnd Bergmann , Neil Armstrong , =?utf-8?q?N=C3=ADcolas_F_=2E_R_?= =?utf-8?q?=2E_A_=2E_Prado?= , Marek Szyprowski , Peng Fan , Robert Richter , Dan Williams , Jonathan Cameron , Terry Bowman , Lukas Wunner , Huacai Chen , Alex Elder , Srini Kandagatla , Greg Kroah-Hartman , Abel Vesa Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 4/9] PCI: create platform devices for child OF nodes of the port node Date: Wed, 17 Jan 2024 17:07:43 +0100 Message-Id: <20240117160748.37682-5-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240117160748.37682-1-brgl@bgdev.pl> References: <20240117160748.37682-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Bartosz Golaszewski In order to introduce PCI power-sequencing, we need to create platform devices for child nodes of the port node. They will get matched against the pwrseq drivers (if one exists) and then the actual PCI device will reuse the node once it's detected on the bus. Signed-off-by: Bartosz Golaszewski --- drivers/pci/bus.c | 9 ++++++++- drivers/pci/remove.c | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index 9c2137dae429..8ab07f711834 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -342,8 +343,14 @@ void pci_bus_add_device(struct pci_dev *dev) */ pcibios_bus_add_device(dev); pci_fixup_device(pci_fixup_final, dev); - if (pci_is_bridge(dev)) + if (pci_is_bridge(dev)) { of_pci_make_dev_node(dev); + retval = of_platform_populate(dev->dev.of_node, NULL, NULL, + &dev->dev); + if (retval) + pci_err(dev, "failed to populate child OF nodes (%d)\n", + retval); + } pci_create_sysfs_dev_files(dev); pci_proc_attach_device(dev); pci_bridge_d3_update(dev); diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c index d749ea8250d6..77be0630b7b3 100644 --- a/drivers/pci/remove.c +++ b/drivers/pci/remove.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include #include +#include #include "pci.h" static void pci_free_resources(struct pci_dev *dev) @@ -18,11 +19,11 @@ static void pci_stop_dev(struct pci_dev *dev) pci_pme_active(dev, false); if (pci_dev_is_added(dev)) { - device_release_driver(&dev->dev); pci_proc_detach_device(dev); pci_remove_sysfs_dev_files(dev); of_pci_remove_node(dev); + of_platform_depopulate(&dev->dev); pci_dev_assign_added(dev, false); } From patchwork Wed Jan 17 16:07:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13521959 Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7AA952376D for ; Wed, 17 Jan 2024 16:08:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507718; cv=none; b=EXWKylrt683XwEPa5gurAGuUem6uF59T7SDBMru9XxSYdR+Tmroz7dGOEQ+zdeQGR7+PlhW4N0Fc/vlADehK63slmvBmqUQeJ08mXwQwIij5YYqxgzD68CY5zZpz8pAwHytk05NGdOb0NDI+Q774YjfAfunpdCCtvqevcxgZxPI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507718; c=relaxed/simple; bh=N8nSlGpY+h0yDVzKyyy2ahDrdLPIziiOuPJg6GZ4M/s=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:From: To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; b=KJoyTAiuryai7321zERh/gZJDaJI9fJVlPYwmgTQrpiumGDQdG35l+WP1elW0MoVObwEJ8WLtu1LXQ4Vzu3ssME6UEpjECEuZVRsu8u3uDEo1/rVqisdOkMSe0jl7BTiOkxeMfpsNPoZwbq8PX7sorWofLgtFX1diBl+4r5YVr4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=FJJlgoNK; arc=none smtp.client-ip=209.85.208.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="FJJlgoNK" Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2cd46e7ae8fso124683151fa.1 for ; Wed, 17 Jan 2024 08:08:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1705507714; x=1706112514; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ko9AldsNAGIySQ6r8IsXSCtLQ9r/1ys0AWCrWCqKA/w=; b=FJJlgoNKT3LU5UfqYlpOOGWKqIwmVOmtHxSdvM7fNQORfOrfcy0CzrMnZN+fWa+gYE j/g3yKzMzFhspGGE6cOAHSSnQbHj8WPd1quM/iAJdz3tpz+WkeO9P+LGeBkmWL7nrQX9 5YpqPjxe6fexhKRdVKo+D7DRO5QGuDSUSNycI1eLOq0XpvUCrKD17q6x8oCkuebSgo4p gd+bUYf09oWtK7l7KKdAY9GsaYcrlrijgWZZDzC+LwWF9Fz2WlfizAXwdz1Y7Zv3shR8 +wlgv4d8ahhed+H0qai6s5lNlm+yryZk2972V8AI4xNTvsP6St8RD2pI+Kl/xtAs6+Z5 mW9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705507714; x=1706112514; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ko9AldsNAGIySQ6r8IsXSCtLQ9r/1ys0AWCrWCqKA/w=; b=ItGuJ+2HpfZzPbRR0RxCnHcnK1seF4zmN03er+wQ0oXtZ6TbSUduH8jFAvVKl/COUI yQZWOFKu88WzlZuwu6ans6pILOtlsXQ2l01f4Ew0yt6NIyBGseKZHR5pp9FPIvAVR1Gu n0xQirBzqLg/e4qtebupXghqblqArJCUe5poR+IgeeTEduOl2AnAh9DgWrUaioIjxB5d LS2xxgtmRnMZmpylQbdaECOg5usNm6f2DbKKck7L1jcYF96z4+DA4SMMqq0nbkKeTJ+9 gD1Ci6h4XWjKkBYCM2qBYf7kT8x9rKTkqHb8MLx0s1YucWNEPsuP1weFpDCsUGkfth8y gEUw== X-Gm-Message-State: AOJu0YxnLmCNQHfGV6cnp1uTP5maisOHFH7Bd7GtL4bguqo1pwIKd2Qa 7uGlb0ij1Ytan6pbdjmq9h2+RyuCjnluaw== X-Google-Smtp-Source: AGHT+IH00GMnU28EnlPeGajWNZo/yfmgLAtVEq5+nkiN5uNxUQ5AichUQRHPt2D0pz/XGhDNycFPnw== X-Received: by 2002:a2e:a40d:0:b0:2cc:8a2b:4594 with SMTP id p13-20020a2ea40d000000b002cc8a2b4594mr2168546ljn.23.1705507714754; Wed, 17 Jan 2024 08:08:34 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:d0b5:43ec:48:baad]) by smtp.gmail.com with ESMTPSA id t10-20020a5d6a4a000000b00337b0374a3dsm1972092wrw.57.2024.01.17.08.08.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 08:08:34 -0800 (PST) From: Bartosz Golaszewski To: Kalle Valo , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Catalin Marinas , Will Deacon , Bjorn Helgaas , Heiko Stuebner , Jernej Skrabec , Chris Morgan , Linus Walleij , Geert Uytterhoeven , Arnd Bergmann , Neil Armstrong , =?utf-8?q?N=C3=ADcolas_F_=2E_R_?= =?utf-8?q?=2E_A_=2E_Prado?= , Marek Szyprowski , Peng Fan , Robert Richter , Dan Williams , Jonathan Cameron , Terry Bowman , Lukas Wunner , Huacai Chen , Alex Elder , Srini Kandagatla , Greg Kroah-Hartman , Abel Vesa Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 5/9] PCI: hold the rescan mutex when scanning for the first time Date: Wed, 17 Jan 2024 17:07:44 +0100 Message-Id: <20240117160748.37682-6-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240117160748.37682-1-brgl@bgdev.pl> References: <20240117160748.37682-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Bartosz Golaszewski With the introduction of the power sequencing drivers that will be able to trigger the port rescan, we need to hold the rescan mutex during the initial pci_host_probe() too or the two could get in each other's way. Signed-off-by: Bartosz Golaszewski --- drivers/pci/probe.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index b7335be56008..957f7afee7ba 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -3122,7 +3122,9 @@ int pci_host_probe(struct pci_host_bridge *bridge) struct pci_bus *bus, *child; int ret; + pci_lock_rescan_remove(); ret = pci_scan_root_bus_bridge(bridge); + pci_unlock_rescan_remove(); if (ret < 0) { dev_err(bridge->dev.parent, "Scanning root bridge failed"); return ret; From patchwork Wed Jan 17 16:07:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13521960 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB9BC2420F for ; Wed, 17 Jan 2024 16:08:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507720; cv=none; b=SEQ4OyBR40qk1vxNbVvkc9AJIs+aoeoQYEKftH+OeMMKHBIYrUG4wTmhmhPP6rpUKCXqtXLxYMgXIqnNIm+vRbeqFaxyNj930JR0ZPUOC6pv5PvN0O2Ut8lSXUZh9QxcuR+qtO7d/hIibyrqWvbX+uSDLICfi82KhWuJcZMVnWI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507720; c=relaxed/simple; bh=9hVgr52oxfJN+f3DPqCGtdW3fcs9H31q8sHIag5dqM8=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:From: To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; b=n1h21m4ONTZHbwtXzIreJ4Rk61p5AM/r6cyinH0/2igLBZTRMDCSjf7sj8xY22BglhD/RVbIvirpjxn1oEfu4X93stY3g0gvkzJt7RHOZYQaqpcmBABLBOYAXDDRkp9FB8o/NeupCmyRbRShY24nyLild5J2a98w5QgOVeeWguA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=NQI68Rmp; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="NQI68Rmp" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-40e800461baso25242995e9.3 for ; Wed, 17 Jan 2024 08:08:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1705507716; x=1706112516; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hmDMXWqDYRqbLZRDqVGsRFlI5kpmWEXG2UggM6BWIdg=; b=NQI68RmpObOV7v4qXphEqbzrqq71ej5IP6s3cSP2RqmUAX2ez5T5bDVAMcm/wmSDdA N00s3oYgoh0kBrcDqeaZk7iPXChzHTb/Ti9THgjllPRh9Gr2kdBddZoP6xd1jOzBwwlC +YaViHQ7NRc4kswd74xTFcClogeNcPmD0ukHn9wDtVz166unMzTonxvYG6DFuLH/AvhA Ezf1SUoq+ffBRsRNNdiEU0H2rMfXC1/qelP1nCncJSXfuYvtbJc4c/rfd3sqEa4C/YHg 5Ep91FMjlo++5R6K6UZvtByd15Anp8c0wc3SYWWwJ6lWVenjJrKGYFy2473L+AtJgeAD oPpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705507716; x=1706112516; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hmDMXWqDYRqbLZRDqVGsRFlI5kpmWEXG2UggM6BWIdg=; b=hdKU4du0Ue1LKqB2DvXBvr9zpA//auogMMNNV7HWB1t9siTN1wtpgyA2Al7P4FB7Q1 nsSAbPgJasgPFu7fhQhJtIbZvncL+WEaMTxBErbequME7MY3AO494asCoSFfLwhHgNEY nMShtXllQf4e7dzQz1+vzxo+clAuMFwkz35UFlZjOnzE2XCh+EjiX8oKnhg3nw+PGIWc bmtas0AeH2NGKRF5NGJ0/6SWRdh2qHU2vCp2pYxJxnVgQosZ2kAVUU7an8hCcInVCNe9 u8HpOaoe6DatoqFCstMm8Tjdb1iFZp/pQ79vi3cp3BplEcKc/ewIgsg6o5J/qDARZhpI 3sgw== X-Gm-Message-State: AOJu0Yxt227Wfqp7cCUPS7bTtrrrWnrqjbD9t6sKo6q9pB4+Jjij2aCt aweMCd71jvQFzWseDsp5pxEHGcnhjXWBng== X-Google-Smtp-Source: AGHT+IFjYcQdh7FZrRxxGNsX7G0G4hhDvyEqEiUFIygsmYmwACq1eG6JZb5KYfiYxR9GWoVqka6UfQ== X-Received: by 2002:a05:600c:4452:b0:40d:8954:a735 with SMTP id v18-20020a05600c445200b0040d8954a735mr2818810wmn.156.1705507716318; Wed, 17 Jan 2024 08:08:36 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:d0b5:43ec:48:baad]) by smtp.gmail.com with ESMTPSA id t10-20020a5d6a4a000000b00337b0374a3dsm1972092wrw.57.2024.01.17.08.08.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 08:08:35 -0800 (PST) From: Bartosz Golaszewski To: Kalle Valo , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Catalin Marinas , Will Deacon , Bjorn Helgaas , Heiko Stuebner , Jernej Skrabec , Chris Morgan , Linus Walleij , Geert Uytterhoeven , Arnd Bergmann , Neil Armstrong , =?utf-8?q?N=C3=ADcolas_F_=2E_R_?= =?utf-8?q?=2E_A_=2E_Prado?= , Marek Szyprowski , Peng Fan , Robert Richter , Dan Williams , Jonathan Cameron , Terry Bowman , Lukas Wunner , Huacai Chen , Alex Elder , Srini Kandagatla , Greg Kroah-Hartman , Abel Vesa Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 6/9] PCI/pwrseq: add pwrseq core code Date: Wed, 17 Jan 2024 17:07:45 +0100 Message-Id: <20240117160748.37682-7-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240117160748.37682-1-brgl@bgdev.pl> References: <20240117160748.37682-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Bartosz Golaszewski Some PCI devices must be powered-on before they can be detected on the bus. Introduce a simple framework reusing the existing PCI OF infrastructure. The way this works is: a DT node representing a PCI device connected to the port can be matched against its power sequencing platform driver. If the match succeeds, the driver is responsible for powering-up the device and calling pcie_pwrseq_device_enable() which will trigger a PCI bus rescan as well as subscribe to PCI bus notifications. When the device is detected and created, we'll make it consume the same DT node that the platform device did. When the device is bound, we'll create a device link between it and the parent power sequencing device. Signed-off-by: Bartosz Golaszewski --- drivers/pci/Kconfig | 1 + drivers/pci/Makefile | 1 + drivers/pci/pwrseq/Kconfig | 8 ++++ drivers/pci/pwrseq/Makefile | 3 ++ drivers/pci/pwrseq/pwrseq.c | 82 +++++++++++++++++++++++++++++++++++++ include/linux/pci-pwrseq.h | 24 +++++++++++ 6 files changed, 119 insertions(+) create mode 100644 drivers/pci/pwrseq/Kconfig create mode 100644 drivers/pci/pwrseq/Makefile create mode 100644 drivers/pci/pwrseq/pwrseq.c create mode 100644 include/linux/pci-pwrseq.h diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig index 74147262625b..e0fd5caa1ffc 100644 --- a/drivers/pci/Kconfig +++ b/drivers/pci/Kconfig @@ -291,5 +291,6 @@ source "drivers/pci/hotplug/Kconfig" source "drivers/pci/controller/Kconfig" source "drivers/pci/endpoint/Kconfig" source "drivers/pci/switch/Kconfig" +source "drivers/pci/pwrseq/Kconfig" endif diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile index cc8b4e01e29d..0a1673ef2c9e 100644 --- a/drivers/pci/Makefile +++ b/drivers/pci/Makefile @@ -9,6 +9,7 @@ obj-$(CONFIG_PCI) += access.o bus.o probe.o host-bridge.o \ obj-$(CONFIG_PCI) += msi/ obj-$(CONFIG_PCI) += pcie/ +obj-$(CONFIG_PCI) += pwrseq/ ifdef CONFIG_PCI obj-$(CONFIG_PROC_FS) += proc.o diff --git a/drivers/pci/pwrseq/Kconfig b/drivers/pci/pwrseq/Kconfig new file mode 100644 index 000000000000..a721a8a955c3 --- /dev/null +++ b/drivers/pci/pwrseq/Kconfig @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: GPL-2.0 + +menu "PCI Power sequencing drivers" + +config PCI_PWRSEQ + bool + +endmenu diff --git a/drivers/pci/pwrseq/Makefile b/drivers/pci/pwrseq/Makefile new file mode 100644 index 000000000000..4052b6bb5aa5 --- /dev/null +++ b/drivers/pci/pwrseq/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-$(CONFIG_PCI_PWRSEQ) += pwrseq.o diff --git a/drivers/pci/pwrseq/pwrseq.c b/drivers/pci/pwrseq/pwrseq.c new file mode 100644 index 000000000000..a750c7bc6830 --- /dev/null +++ b/drivers/pci/pwrseq/pwrseq.c @@ -0,0 +1,82 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2024 Linaro Ltd. + */ + +#include +#include +#include +#include +#include +#include +#include + +static int pci_pwrseq_notify(struct notifier_block *nb, unsigned long action, + void *data) +{ + struct pci_pwrseq *pwrseq = container_of(nb, struct pci_pwrseq, nb); + struct device *dev = data; + + if (dev_fwnode(dev) != dev_fwnode(pwrseq->dev)) + return NOTIFY_DONE; + + switch (action) { + case BUS_NOTIFY_ADD_DEVICE: + device_set_of_node_from_dev(dev, pwrseq->dev); + break; + case BUS_NOTIFY_BOUND_DRIVER: + pwrseq->link = device_link_add(dev, pwrseq->dev, + DL_FLAG_AUTOREMOVE_CONSUMER); + if (!pwrseq->link) + dev_err(pwrseq->dev, "Failed to add device link\n"); + break; + case BUS_NOTIFY_UNBOUND_DRIVER: + device_link_del(pwrseq->link); + break; + } + + return NOTIFY_DONE; +} + +int pci_pwrseq_device_enable(struct pci_pwrseq *pwrseq) +{ + if (!pwrseq->dev) + return -ENODEV; + + pwrseq->nb.notifier_call = pci_pwrseq_notify; + bus_register_notifier(&pci_bus_type, &pwrseq->nb); + + pci_lock_rescan_remove(); + pci_rescan_bus(to_pci_dev(pwrseq->dev->parent)->bus); + pci_unlock_rescan_remove(); + + return 0; +} +EXPORT_SYMBOL_GPL(pci_pwrseq_device_enable); + +void pci_pwrseq_device_disable(struct pci_pwrseq *pwrseq) +{ + bus_unregister_notifier(&pci_bus_type, &pwrseq->nb); +} +EXPORT_SYMBOL_GPL(pci_pwrseq_device_disable); + +static void devm_pci_pwrseq_device_disable(void *data) +{ + struct pci_pwrseq *pwrseq = data; + + pci_pwrseq_device_disable(pwrseq); +} + +int devm_pci_pwrseq_device_enable(struct device *dev, + struct pci_pwrseq *pwrseq) +{ + int ret; + + ret = pci_pwrseq_device_enable(pwrseq); + if (ret) + return ret; + + return devm_add_action_or_reset(dev, devm_pci_pwrseq_device_disable, + pwrseq); +} +EXPORT_SYMBOL_GPL(devm_pci_pwrseq_device_enable); diff --git a/include/linux/pci-pwrseq.h b/include/linux/pci-pwrseq.h new file mode 100644 index 000000000000..137b82b99d1c --- /dev/null +++ b/include/linux/pci-pwrseq.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright (C) 2024 Linaro Ltd. + */ + +#ifndef __PCI_PWRSEQ_H__ +#define __PCI_PWRSEQ_H__ + +#include + +struct device; + +struct pci_pwrseq { + struct notifier_block nb; + struct device *dev; + struct device_link *link; +}; + +int pci_pwrseq_device_enable(struct pci_pwrseq *pwrseq); +void pci_pwrseq_device_disable(struct pci_pwrseq *pwrseq); +int devm_pci_pwrseq_device_enable(struct device *dev, + struct pci_pwrseq *pwrseq); + +#endif /* __PCI_PWRSEQ_H__ */ From patchwork Wed Jan 17 16:07:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13521961 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78B2124A1C for ; Wed, 17 Jan 2024 16:08:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507721; cv=none; b=EZGzJUiqj3wq5rvwVFVn4C9/MIK9hqiMb9gCWYcREm2S9SEXgUatyKpuI+RQNKLthLcdHZP7aCcrgV4LBRF/7VXN4iV9NS3ypGXkFidqJ/GONue8eYt8gs/KGe/rz//fmGw6ayh+treBnKRuNjg/lvBt+Pfb+dTvcY1vg/JY8Mg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507721; c=relaxed/simple; bh=RmzggMuqX9S2sYKlWB5CTnSQ2ymEjp/UGoryY82oivE=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:From: To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; b=hGZ7a/18Z6bUDGw9pQ2SaEsy5AO3l70UHvgG/DdAjLauFp4fF+BOZHmSn14V2cRYJ4eLRKT1NLg6wkBrQwQfAt+QcI7gtGK6CnzGKXSWoqcPYk/Rcl1wFzm/uKXz0YDEdhnHgWrrY+2fKPNkaxe+hzitCIfe6HKz12ByOhyjf/U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=AGM2kIWV; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="AGM2kIWV" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-3376d424a79so8986868f8f.1 for ; Wed, 17 Jan 2024 08:08:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1705507718; x=1706112518; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iFu9yLDki9n8hZLDYiMoEZqERou6Z5NMTUbYakLpe9U=; b=AGM2kIWV9zkOgZm5YdSDtl353IyCrexsWyLpNaXizZKE1vpFt97Qfc4DrQRl9hU1Wd mgAKFdFP+XNpCd3yO/9zCnMhGtFd1W6LpYv74cpZt69+8gkYyytY4opyZwKakh1StNJI BzC54uf2s/M5c4GpDss8XRaJWGVHf9sWRUzo+bGB77SXHsSmarFarYVs0mRIbo3eXcO2 Hd7SFbeoWvCTrqocktxS3WJnwXnH+URCh/zDs2U+Y496tg9Xwn8UDMZhryoCx34WUG7h gSPjFe/yzFdihgETy1lqiRFeajWvRATHNZ3hFLklSG/n0iG16kPaRhO4ffS5N3noL4YN rI5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705507718; x=1706112518; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iFu9yLDki9n8hZLDYiMoEZqERou6Z5NMTUbYakLpe9U=; b=bof1nNldU4K+AOsL/BSw5xPHZQSeQMz0oNeN1T0mEp+qVx4MU2ePkoKZsvPj8xdcH9 bAgtykupfyzh7YVXqn+tfWgqpjXWY5otHGN6Hmql5uemofVy5WXrsEcJiMigIimQWTMO U5svLK0wml2jpyg9KpmVnSC0dv5ugkUNqKqy8KUKHrpPEz9fuaZHiD8+uVH0IzMNLp3A lLHqyyLz6ndpGtlEtkKMledw6ze6ZM6XzDPBaDjPmvDQ0OA4zP5CX3rqkcdI0AbdD6Ep 2EomHJzj044mHQvJqPha7K2XCvpXSPW8BhBo7xTABptb9e/PIFDC/wJN6uBlexrf6dss +EVg== X-Gm-Message-State: AOJu0YxsRWOuvhswJLNKBPDFs3CBl+yV81sfJJxNCWHk+ricWgX5ynde Sgly0c88RgBPTZvMBI6UUls7W8KHrpsf9A== X-Google-Smtp-Source: AGHT+IEmgi0LRLiPs2g64YkCGg5BMB/9EVVczXYVKQC5N4pf2ch45rIJoaEV0jPaB90LK0yrggei2g== X-Received: by 2002:a05:6000:1445:b0:337:c4d5:ce70 with SMTP id v5-20020a056000144500b00337c4d5ce70mr662501wrx.137.1705507717858; Wed, 17 Jan 2024 08:08:37 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:d0b5:43ec:48:baad]) by smtp.gmail.com with ESMTPSA id t10-20020a5d6a4a000000b00337b0374a3dsm1972092wrw.57.2024.01.17.08.08.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 08:08:37 -0800 (PST) From: Bartosz Golaszewski To: Kalle Valo , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Catalin Marinas , Will Deacon , Bjorn Helgaas , Heiko Stuebner , Jernej Skrabec , Chris Morgan , Linus Walleij , Geert Uytterhoeven , Arnd Bergmann , Neil Armstrong , =?utf-8?q?N=C3=ADcolas_F_=2E_R_?= =?utf-8?q?=2E_A_=2E_Prado?= , Marek Szyprowski , Peng Fan , Robert Richter , Dan Williams , Jonathan Cameron , Terry Bowman , Lukas Wunner , Huacai Chen , Alex Elder , Srini Kandagatla , Greg Kroah-Hartman , Abel Vesa Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 7/9] dt-bindings: wireless: ath11k: describe QCA6390 Date: Wed, 17 Jan 2024 17:07:46 +0100 Message-Id: <20240117160748.37682-8-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240117160748.37682-1-brgl@bgdev.pl> References: <20240117160748.37682-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Bartosz Golaszewski Describe the ath11k variant present on the QCA6390 module. Signed-off-by: Bartosz Golaszewski --- .../net/wireless/qcom,ath11k-pci.yaml | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k-pci.yaml b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k-pci.yaml index 817f02a8b481..c8ec9d313d93 100644 --- a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k-pci.yaml +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k-pci.yaml @@ -16,6 +16,7 @@ description: | properties: compatible: enum: + - pci17cb,1101 # QCA6390 - pci17cb,1103 # WCN6855 reg: @@ -27,10 +28,57 @@ properties: string to uniquely identify variant of the calibration data for designs with colliding bus and device ids + enable-gpios: + description: GPIO line enabling the ATH11K module when asserted. + maxItems: 1 + + vddio-supply: + description: VDD_IO supply regulator handle + + vddaon-supply: + description: VDD_AON supply regulator handle + + vddpmu-supply: + description: VDD_PMU supply regulator handle + + vddpcie1-supply: + description: VDD_PCIE1 supply regulator handle + + vddpcie2-supply: + description: VDD_PCIE2 supply regulator handle + + vddrfa1-supply: + description: VDD_RFA1 supply regulator handle + + vddrfa2-supply: + description: VDD_RFA2 supply regulator handle + + vddrfa3-supply: + description: VDD_RFA3 supply regulator handle + required: - compatible - reg +allOf: + - if: + properties: + compatible: + contains: + enum: + - pci17cb,1103 + then: + properties: + enable-gpios: false + vddio-supply: false + vddaon-supply: false + vddpmu-supply: false + vddrfa1-supply: false + vddrfa2-supply: false + vddrfa3-supply: false + vddpcie1-supply: false + vddpcie2-supply: false + additionalProperties: false examples: From patchwork Wed Jan 17 16:07:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13521962 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C39E24B5D for ; Wed, 17 Jan 2024 16:08:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507722; cv=none; b=Bd84+rd3HiK/dKGlX9VujMzQFHadJZsEFCT2UHObuQZgB2JknBH5Q7ZK9G+Q7fMVehAGtM9t2uIhOihiY6XWrahwnHby0x39QZ3CDT6yM4YLQ14jef9tDPTieC//huMz0f2JPSaRUWSLizzIqC/0vGgT9OtwMnEvwVb0LEuTfNo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507722; c=relaxed/simple; bh=mM8PwsCjRqxpEKB13QqnWtlTPmsb6ofAXID4BuBezD4=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:From: To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; b=FX7dIciy00VL6CtiWjkDx2Z17aD1fzXGejheF9L+s2M+Y/t7MXVJI/7jVrnMHSVpN/xi08duHrbKPiwB9AoWrEwU2WJPUtDpNVjOoAzozwvvTgoGGcSw0MmbL9k7ftHLTqDFScWD/Y7rtRCe79uHpWviS2bi48Ncv168mZVz8/M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=QK7JaqDA; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="QK7JaqDA" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-336c9acec03so9240476f8f.2 for ; Wed, 17 Jan 2024 08:08:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1705507719; x=1706112519; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9KiJFCSMkHl908ixeSikSO3f5Gun1Y9vXqztuxAOHIc=; b=QK7JaqDAX6UeY03/jWwluKciFOE4L7Z5QtbBbJsRWC+y010PQ5RkuSa7L3v3FXLFkZ +tSgLHDiYLvyGfbzKdaoYKrzIDO49cM+ZQ8nhgOfiHJKx40DfnX1+0aPK0FsNALedjOP JqIC25RgMeeUU31utBLG3fsLKCbCYSCaO11r0x8RpW7+jBrx/hmOZ8JkSG5vT0daH1+z 1mWxjBcWyxs0Zpf/9AZyBD2Xz1ThUcQS+lq4kFOAcU7ubuvUbHRePdZSWWeBbQUlcO2c UDjoFIgh1/ceEp8738+sR7R0oiVQ5lciXFigpkpJMHjp/wZuaCqAYcY+wgLGvHX42Zim cVAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705507719; x=1706112519; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9KiJFCSMkHl908ixeSikSO3f5Gun1Y9vXqztuxAOHIc=; b=lxK7mT5goxFYnH+8Jd1075f/t+4++gWUNlS39kRqmZT7xvTN0VX9opPPyGuNYY5T7Y f1QSdYSP6We8j41/jBuAxe7W3XCkY2sVdyxfJlRuAs7x1/Mr87nQVJjzWQG8cRJMjX0Z YtDdrb0QKB/I7ho8B2blp64BkiLn6NRdXS3hFfiaC49OZz4B2NKT/3gqPrk2XMy4wdp1 1Dbgy88DaMBkKsAlTDlWAcKJ6EabLR3iJbrnT3SYWhkrR0XBDH7HXHaqsry+en3aHBN4 vfZv6s7L+iYIuuVOHl2o9qy2T5a+3YXz1RlYfyHm9Qq9nE2vnoefd0g126py13EpW7vP 2iCQ== X-Gm-Message-State: AOJu0Yxl/h1gMJDLtDsj6t3bklj3stm0NoUCrRdojVujfPMNeyW0ztpU Bm1uICvLzWZ2P6U+jsw6852we+UrAZuOVQ== X-Google-Smtp-Source: AGHT+IE09EQiEo3vEyiN4aUkmSSulxM60vCAFa6QFBzATdMqmCKCemxhHosUEgDD4K1ltVFvSuduEg== X-Received: by 2002:adf:e90b:0:b0:336:6bf0:a005 with SMTP id f11-20020adfe90b000000b003366bf0a005mr4715360wrm.92.1705507719524; Wed, 17 Jan 2024 08:08:39 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:d0b5:43ec:48:baad]) by smtp.gmail.com with ESMTPSA id t10-20020a5d6a4a000000b00337b0374a3dsm1972092wrw.57.2024.01.17.08.08.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 08:08:39 -0800 (PST) From: Bartosz Golaszewski To: Kalle Valo , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Catalin Marinas , Will Deacon , Bjorn Helgaas , Heiko Stuebner , Jernej Skrabec , Chris Morgan , Linus Walleij , Geert Uytterhoeven , Arnd Bergmann , Neil Armstrong , =?utf-8?q?N=C3=ADcolas_F_=2E_R_?= =?utf-8?q?=2E_A_=2E_Prado?= , Marek Szyprowski , Peng Fan , Robert Richter , Dan Williams , Jonathan Cameron , Terry Bowman , Lukas Wunner , Huacai Chen , Alex Elder , Srini Kandagatla , Greg Kroah-Hartman , Abel Vesa Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 8/9] dt-bindings: wireless: ath11k: describe WCN7850 Date: Wed, 17 Jan 2024 17:07:47 +0100 Message-Id: <20240117160748.37682-9-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240117160748.37682-1-brgl@bgdev.pl> References: <20240117160748.37682-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Bartosz Golaszewski Describe the ath11k variant present on the WCN7850 module. Signed-off-by: Bartosz Golaszewski --- .../net/wireless/qcom,ath11k-pci.yaml | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k-pci.yaml b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k-pci.yaml index c8ec9d313d93..5648c855a122 100644 --- a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k-pci.yaml +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k-pci.yaml @@ -18,6 +18,7 @@ properties: enum: - pci17cb,1101 # QCA6390 - pci17cb,1103 # WCN6855 + - pci17cb,1107 # WCN7850 reg: maxItems: 1 @@ -28,13 +29,25 @@ properties: string to uniquely identify variant of the calibration data for designs with colliding bus and device ids + clocks: + maxItems: 1 + enable-gpios: description: GPIO line enabling the ATH11K module when asserted. maxItems: 1 + vdd-supply: + description: VDD supply regulator handle + + vdddig-supply: + description: VDD_DIG supply regulator handle + vddio-supply: description: VDD_IO supply regulator handle + vddio12-supply: + description: VDD_IO12 supply regulator handle + vddaon-supply: description: VDD_AON supply regulator handle @@ -61,6 +74,18 @@ required: - reg allOf: + - if: + properties: + compatible: + contains: + enum: + - pci17cb,1101 + then: + properties: + clocks: false + vdd-supply: false + vdddig-supply: false + vddio12-supply: false - if: properties: compatible: @@ -69,7 +94,11 @@ allOf: - pci17cb,1103 then: properties: + clocks: false enable-gpios: false + vdd-supply: false + vddio12-supply: false + vdddig-supply: false vddio-supply: false vddaon-supply: false vddpmu-supply: false @@ -78,6 +107,18 @@ allOf: vddrfa3-supply: false vddpcie1-supply: false vddpcie2-supply: false + - if: + properties: + compatible: + contains: + enum: + - pci17cb,1107 + then: + properties: + vddpmu-supply: false + vddrfa3-supply: false + vddpcie1-supply: false + vddpcie2-supply: false additionalProperties: false From patchwork Wed Jan 17 16:07:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13521963 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8D1E25553 for ; Wed, 17 Jan 2024 16:08:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507724; cv=none; b=CytO6uiZyMZgyn3BIGPBj6hu7ekKx6MkVxVFjBN+oL+11Z3OuS84gOn+N/4QnnfecI89AYOf2slDxIwdGoXG7B2VYh5FQhWtazNBKdQaw3481Q1CdSzFMoYAgx0eiDMI2d5G4rdiCrVVneMFin7tdE/AcIbh3VL5A35QJiA6y0g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507724; c=relaxed/simple; bh=WFyrJs1id+9YZIOtZ6FpABayALnwskaiuM+TVLg1sSM=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:From: To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; b=sE1aBW8UF/jRtelkUiW5DdB1uQ6MK8mmmJrXLhgUYpVx2b0z+Vad4f/muCQtcnJca5bOY2gZoFKGpeXsAHMXAoJD5B2dWmkAbvOCehExU1Akp/AcuEi6LJjpY5MxoVzW2436f7Ck5g+f56xFZTfc7/0k/Y8Ku81ABVIHBmR4yzo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=CKTeIh6F; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="CKTeIh6F" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-336c5b5c163so6704606f8f.1 for ; Wed, 17 Jan 2024 08:08:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1705507721; x=1706112521; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=csdPOquKgbyta51Uec8uuMPVMGRbxtZFd+25sTlPk8k=; b=CKTeIh6FgfS8dDceOOxEBjqu3PRAv17lJIOP54BEuwvcxXccpqnOLWxOdzt+YDtDG8 wWuTkW1p5J/6jBLzu3E2d1gvi2+C1RwvW/DPuCOW/9gUGW1Wyvz3gJ8N+o3x1yV5OCjf jRUcdN4kfjKmjFz+l+B80tyaLZ4A4rVOy2o35bDf0udWi1E5GAa6ePzCNwI0IIDxdlyJ 4V2Wf0+mH5BWdGsyDnHKFalAGUWCh0Xr9km5ZzV64RP6uwr4kmpB0ORuSRmrW+MEYzLn feTz4qru4FCDL5M9Em21tWR+fPqH6J7pmHvwQiHbz2GHR4rD6qEWg4+lBlhPhoZ+ILEl PpuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705507721; x=1706112521; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=csdPOquKgbyta51Uec8uuMPVMGRbxtZFd+25sTlPk8k=; b=Vl/j7+S85dMu686Ct5w0DXoXVVr9574tihCyhd6FodrrVkiFZEzcxj3hbC6PLb2aRt oCLGRx6LnA1kGLdXWLX9SABG3IekuQuCKIBOQq/oeydSWiZ4BTNINOO2qm/8EFLymuMn RZtAt2LM+HuU+hOU/XloinsjM8zWJCcEMjOgeCnA7R/kN6vz0u/ybJi5f5wxAFgEu9Wm 5ozCEZ0yroeoqW2s/oszEXWVAeOSsJlC7vujW0h5wQ7hE9fe7pstJgZ0D29lc/Fr1lzj FBBy9wJ2NnS+g0vCc4ol0aXjeFQWsJZWI9deiIM/49VW2x8hhCkvGyhEMT1NyD2/HNWW s0+Q== X-Gm-Message-State: AOJu0YzaacQA55j42W5EV3i02POkYv7iQopypw7dGHkhVUgX41qux2cq gebVCmIiPiKzTNpTn7DA9o9Kylf/6jY+P8MLGFkxYfurWCpdG88C37IhRZa0zLM= X-Google-Smtp-Source: AGHT+IE8hEEtpTYbJU01ZoUcCZSKPg5Q30PyVE7OMBk7WjjvUlXJokzoqSuozUEKiQC6pE+bjmyMZA== X-Received: by 2002:adf:ab09:0:b0:337:7b7a:6540 with SMTP id q9-20020adfab09000000b003377b7a6540mr591631wrc.5.1705507721046; Wed, 17 Jan 2024 08:08:41 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:d0b5:43ec:48:baad]) by smtp.gmail.com with ESMTPSA id t10-20020a5d6a4a000000b00337b0374a3dsm1972092wrw.57.2024.01.17.08.08.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 08:08:40 -0800 (PST) From: Bartosz Golaszewski To: Kalle Valo , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Catalin Marinas , Will Deacon , Bjorn Helgaas , Heiko Stuebner , Jernej Skrabec , Chris Morgan , Linus Walleij , Geert Uytterhoeven , Arnd Bergmann , Neil Armstrong , =?utf-8?q?N=C3=ADcolas_F_=2E_R_?= =?utf-8?q?=2E_A_=2E_Prado?= , Marek Szyprowski , Peng Fan , Robert Richter , Dan Williams , Jonathan Cameron , Terry Bowman , Lukas Wunner , Huacai Chen , Alex Elder , Srini Kandagatla , Greg Kroah-Hartman , Abel Vesa Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 9/9] PCI/pwrseq: add a pwrseq driver for QCA6390 Date: Wed, 17 Jan 2024 17:07:48 +0100 Message-Id: <20240117160748.37682-10-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240117160748.37682-1-brgl@bgdev.pl> References: <20240117160748.37682-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Bartosz Golaszewski Add a PCI power sequencing driver that's capable of correctly powering up the ath11k module on QCA6390 and WCN7850 using the PCI pwrseq functionality. Signed-off-by: Bartosz Golaszewski [Neil: add support for WCN7850] Signed-off-by: Neil Armstrong --- drivers/pci/pwrseq/Kconfig | 8 + drivers/pci/pwrseq/Makefile | 1 + drivers/pci/pwrseq/pci-pwrseq-qca6390.c | 267 ++++++++++++++++++++++++ 3 files changed, 276 insertions(+) create mode 100644 drivers/pci/pwrseq/pci-pwrseq-qca6390.c diff --git a/drivers/pci/pwrseq/Kconfig b/drivers/pci/pwrseq/Kconfig index a721a8a955c3..667c9c121f34 100644 --- a/drivers/pci/pwrseq/Kconfig +++ b/drivers/pci/pwrseq/Kconfig @@ -5,4 +5,12 @@ menu "PCI Power sequencing drivers" config PCI_PWRSEQ bool +config PCI_PWRSEQ_QCA6390 + tristate "PCI Power Sequencing driver for QCA6390" + select PCI_PWRSEQ + default (ATH11K_PCI && ARCH_QCOM) + help + Enable support for the PCI power sequencing driver for the + ath11k module of the QCA6390 WLAN/BT chip. + endmenu diff --git a/drivers/pci/pwrseq/Makefile b/drivers/pci/pwrseq/Makefile index 4052b6bb5aa5..5cf8cce01e82 100644 --- a/drivers/pci/pwrseq/Makefile +++ b/drivers/pci/pwrseq/Makefile @@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_PCI_PWRSEQ) += pwrseq.o +obj-$(CONFIG_PCI_PWRSEQ_QCA6390) += pci-pwrseq-qca6390.o diff --git a/drivers/pci/pwrseq/pci-pwrseq-qca6390.c b/drivers/pci/pwrseq/pci-pwrseq-qca6390.c new file mode 100644 index 000000000000..cdf3639ea29f --- /dev/null +++ b/drivers/pci/pwrseq/pci-pwrseq-qca6390.c @@ -0,0 +1,267 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2023 Linaro Ltd. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct pci_pwrseq_qca6390_vreg { + const char *name; + unsigned int load_uA; +}; + +struct pci_pwrseq_qca6390_pdata { + struct pci_pwrseq_qca6390_vreg *vregs; + size_t num_vregs; + unsigned int delay_msec; +}; + +struct pci_pwrseq_qca6390_ctx { + struct pci_pwrseq pwrseq; + const struct pci_pwrseq_qca6390_pdata *pdata; + struct regulator_bulk_data *regs; + struct gpio_descs *en_gpios; + unsigned long *en_gpios_values; + struct clk *clk; +}; + +static struct pci_pwrseq_qca6390_vreg pci_pwrseq_qca6390_vregs[] = { + { + .name = "vddio", + .load_uA = 20000, + }, + { + .name = "vddaon", + .load_uA = 100000, + }, + { + .name = "vddpmu", + .load_uA = 1250000, + }, + { + .name = "vddpcie1", + .load_uA = 35000, + }, + { + .name = "vddpcie2", + .load_uA = 15000, + }, + { + .name = "vddrfa1", + .load_uA = 200000, + }, + { + .name = "vddrfa2", + .load_uA = 400000, + }, + { + .name = "vddrfa3", + .load_uA = 400000, + }, +}; + +static struct pci_pwrseq_qca6390_pdata pci_pwrseq_qca6390_of_data = { + .vregs = pci_pwrseq_qca6390_vregs, + .num_vregs = ARRAY_SIZE(pci_pwrseq_qca6390_vregs), + .delay_msec = 16, +}; + +static struct pci_pwrseq_qca6390_vreg pci_pwrseq_wcn7850_vregs[] = { + { + .name = "vdd", + }, + { + .name = "vddio", + }, + { + .name = "vddio12", + }, + { + .name = "vddaon", + }, + { + .name = "vdddig", + }, + { + .name = "vddrfa1", + }, + { + .name = "vddrfa2", + }, +}; + +static struct pci_pwrseq_qca6390_pdata pci_pwrseq_wcn7850_of_data = { + .vregs = pci_pwrseq_wcn7850_vregs, + .num_vregs = ARRAY_SIZE(pci_pwrseq_wcn7850_vregs), + .delay_msec = 50, +}; + +static int pci_pwrseq_qca6390_power_on(struct pci_pwrseq_qca6390_ctx *ctx) +{ + int ret; + + ret = regulator_bulk_enable(ctx->pdata->num_vregs, ctx->regs); + if (ret) + return ret; + + ret = clk_prepare_enable(ctx->clk); + if (ret) + return ret; + + bitmap_fill(ctx->en_gpios_values, ctx->en_gpios->ndescs); + + ret = gpiod_set_array_value_cansleep(ctx->en_gpios->ndescs, + ctx->en_gpios->desc, + ctx->en_gpios->info, + ctx->en_gpios_values); + if (ret) { + regulator_bulk_disable(ctx->pdata->num_vregs, ctx->regs); + return ret; + } + + if (ctx->pdata->delay_msec) + msleep(ctx->pdata->delay_msec); + + return 0; +} + +static int pci_pwrseq_qca6390_power_off(struct pci_pwrseq_qca6390_ctx *ctx) +{ + int ret; + + bitmap_zero(ctx->en_gpios_values, ctx->en_gpios->ndescs); + + ret = gpiod_set_array_value_cansleep(ctx->en_gpios->ndescs, + ctx->en_gpios->desc, + ctx->en_gpios->info, + ctx->en_gpios_values); + if (ret) + return ret; + + clk_disable_unprepare(ctx->clk); + + return regulator_bulk_disable(ctx->pdata->num_vregs, ctx->regs); +} + +static void devm_pci_pwrseq_qca6390_power_off(void *data) +{ + struct pci_pwrseq_qca6390_ctx *ctx = data; + + pci_pwrseq_qca6390_power_off(ctx); +} + +static int pci_pwrseq_qca6390_probe(struct platform_device *pdev) +{ + struct pci_pwrseq_qca6390_ctx *ctx; + struct device *dev = &pdev->dev; + int ret, i; + + ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); + if (!ctx) + return -ENOMEM; + + ctx->pdata = of_device_get_match_data(dev); + if (!ctx->pdata) + return dev_err_probe(dev, -ENODEV, + "Failed to obtain platform data\n"); + + if (ctx->pdata->vregs) { + ctx->regs = devm_kcalloc(dev, ctx->pdata->num_vregs, + sizeof(*ctx->regs), GFP_KERNEL); + if (!ctx->regs) + return -ENOMEM; + + for (i = 0; i < ctx->pdata->num_vregs; i++) + ctx->regs[i].supply = ctx->pdata->vregs[i].name; + + ret = devm_regulator_bulk_get(dev, ctx->pdata->num_vregs, + ctx->regs); + if (ret < 0) + return dev_err_probe(dev, ret, + "Failed to get all regulators\n"); + + for (i = 0; i < ctx->pdata->num_vregs; i++) { + if (!ctx->pdata->vregs[1].load_uA) + continue; + + ret = regulator_set_load(ctx->regs[i].consumer, + ctx->pdata->vregs[i].load_uA); + if (ret) + return dev_err_probe(dev, ret, + "Failed to set vreg load\n"); + } + } + + ctx->clk = devm_clk_get_optional(dev, NULL); + if (IS_ERR(ctx->clk)) + return dev_err_probe(dev, PTR_ERR(ctx->clk), + "Failed to get clock\n"); + + ctx->en_gpios = devm_gpiod_get_array_optional(dev, "enable", + GPIOD_OUT_LOW); + if (IS_ERR(ctx->en_gpios)) + return dev_err_probe(dev, PTR_ERR(ctx->en_gpios), + "Failed to get enable GPIOs\n"); + + ctx->en_gpios_values = devm_bitmap_zalloc(dev, ctx->en_gpios->ndescs, + GFP_KERNEL); + if (!ctx->en_gpios_values) + return -ENOMEM; + + ret = pci_pwrseq_qca6390_power_on(ctx); + if (ret) + return dev_err_probe(dev, ret, + "Failed to power on the device\n"); + + ret = devm_add_action_or_reset(dev, devm_pci_pwrseq_qca6390_power_off, + ctx); + if (ret) + return ret; + + ctx->pwrseq.dev = dev; + + ret = devm_pci_pwrseq_device_enable(dev, &ctx->pwrseq); + if (ret) + return dev_err_probe(dev, ret, + "Failed to register the pwrseq wrapper\n"); + + return 0; +} + +static const struct of_device_id pci_pwrseq_qca6390_of_match[] = { + { + .compatible = "pci17cb,1101", + .data = &pci_pwrseq_qca6390_of_data, + }, + { + .compatible = "pci17cb,1107", + .data = &pci_pwrseq_wcn7850_of_data, + }, + { } +}; +MODULE_DEVICE_TABLE(of, pci_pwrseq_qca6390_of_match); + +static struct platform_driver pci_pwrseq_qca6390_driver = { + .driver = { + .name = "pci-pwrseq-qca6390", + .of_match_table = pci_pwrseq_qca6390_of_match, + }, + .probe = pci_pwrseq_qca6390_probe, +}; +module_platform_driver(pci_pwrseq_qca6390_driver); + +MODULE_AUTHOR("Bartosz Golaszewski "); +MODULE_DESCRIPTION("PCI Power Sequencing module for QCA6390"); +MODULE_LICENSE("GPL");