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: 13521965 Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (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 413D52233C for ; Wed, 17 Jan 2024 16:08:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507713; cv=none; b=tHbNhV80jJIPfYUjXsGGA+JkUC5dMQByLI+1ilLakRFWO/U6nVdLe/rBPDJZuBfyAINDCGo5MING9YLHFCftj5lx47ivUmqL8OtaJEgaw0QGmJwTdCf0QnCvg/tLf7KD17eXBURGpnwfgWhXS/0yYBmRn5ca2s5D9Ec2jdgtOC8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507713; 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=tzeUBM6gcVbw0VqtTkCUUptq4jGJ+myIwSbl1FrOGF0XhZSxr0HtWBTaMYiuSSmODKWyv3jUt7rTUKj7l6330DolD7un8+ttwJ6kieJV1H3P7jb0IGeeh2rlxdMqD18WrNec+Ns1C2OJe2peej6YAdyuvIhE2hh8m7HgZkHR6iA= 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.177 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-f177.google.com with SMTP id 38308e7fff4ca-2cddb0ee311so25382531fa.0 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=bXt0B6uKqU4S4AoYlbUtLPr9yzHtmWt3WCwQJeVF2e3uBCgDDDlDoJOQfNN4LU7mRF yRzbBpoz3TLRjc8YgI+a4o9lOPX/h8aS2qcJW752NnS5JCzo5x/7A3azs1qqMgR6sNLg hrgWD7SKo8Mc9rmhChRuuOrUYCD8X3aJHVzkiCEAHk4p08iyrzwWB8wJEx+5xP6yCz2C CxMr8ru0MWhHMMmxZ3Pn2mr/7qozszlO8kYSduyLmNGEsF2GEtHZYrGVCQsYGWCCHPUQ Pw3NpQpAGHpQNCsUFrEyjm0lD/8i+sk4HE7CC8Gm+8dYx3kgRODtGJe7UBtNM6Di/Ayu COjg== X-Gm-Message-State: AOJu0YyUBVw9FXA7dxCXLI2gLVPubiTmh8ERfLwJFgGUHdpnUPCkdLKQ x1Rs5RhHPljuVtPLVGm6n4m+pfJyTGv74w== 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: netdev@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: 13521967 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 A82DA224CD for ; Wed, 17 Jan 2024 16:08:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507715; cv=none; b=cnWi5hCNMJT/ZOAlubsntNMHDUE/RyzeRtVWYxmC59Gr42NEb41iCMzIVXUcVSUyoRRDBH/5g9yg9q5A7ivLlq4a7+WQfimkhuw3CpMUp1frNA/+RI+MjFgCOhQOrdhwpCQlrM5olAzr3wB4VSnW3Rx3NV1FdCqIed5BKYTf9hQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507715; 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=YAAZTc+C8xZdpEbGWytR0OpL7lZ9NBrlCJSwXzEvNYzj86kpJqs2n6nOdfYaVmr1QwVsC4AIlxSh35JnmYqc/R4wf3dmwZRA7TtEaM5ZHZjrqxFdySWTVB0REjSriELfwp4BfEMJAoO9iW47FtKhVW5xh/dKKvrD6zwuFD79gcY= 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.46 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-f46.google.com with SMTP id ffacd0b85a97d-337be1326e3so1631279f8f.2 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=QXiboFc+iKwCIEf4caFREq3K8qetnl6IfIgi4+AKZeVCAQK+Z/KzSH9KjgSuyWVD3b Y4E7ERTt+FfqIK/54efYaYOGlyL1CjpcVJJ4qaf9dc2zFUiUQy6uhLkXAs+p4M+ML21x E3dGVYYcvBJL33u7xMXSPkhV2sAqR/NH4lBWvah3Bi0vCeiU6kU++Y74f2FL6JDsTUqp lkNQbVuvmnpfqYoF8IxgO67Ax+EvcTbffzW3ov5xA6F0YWnVF3Je1iD/AqtzXCcZfITN H5zW7LsVzQZCz3jJu1anBsWZl4C5ahuTlmQwVGVpwlD9CUKbyyly/NdARVNGb3xYm7ep u38A== X-Gm-Message-State: AOJu0YyjhHJR2ykQrYPej+FwoVCWn3J/rC8jY1nAzsTsC8USaVspz/Sh EybmQmCRQsLq5dfZ8CPfEVOAToYbptOxVQ== 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: netdev@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: 13521966 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 460C9225AC for ; Wed, 17 Jan 2024 16:08:33 +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=1705507715; cv=none; b=ilhV9n3kVm3X+uXC4birJyttgEAYuphKuqmEQA5oqLutg6pmtQcX+0XHr2bYPmtL3d+Cty4YNNvKaSvupSHXA+23xDHI4jGwprNFgz+qtWU059V1Ph8/43KqY6Oh0BXZug1qrlRiSXMc0o+W3o6uGFZzWuwvV9+9lsckKZ+iE4I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507715; 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=b3+P9OfUH6e+iXChxCNL/nnImu6XSRdw8IUHYiUG2wTEubwWDQ12lmbnena38URc7KLgmi1aM30/F/EqYbTtjgL8ByL2D871i6c1YpIRluBjcAGuB0HdNSUZ6PN8kUSDB3ObceH2AQDX5+UgfRqz7xaIP0MBIREu8wBcZjG1fFo= 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.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="y3PJUrNB" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-337c4c9cde2so472452f8f.0 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=GHWSytSWq//D+39LgBVxiyo7u74S9Nh2ry5dgchEiYmU+PPMRDqrBlbTP3krZJEN0F rpJdbWI7dncW8rGcRSAygW39bJVJvYiqrS3wJN8fvfSDpXy5+ltl4L1T1pBW/KyaMvBd UWil56RXbZCWaveGXHGhcvo7sTzirFWw2s/FNtP5d6xtn1ZQa3M0aE3hIm7AMTZDOkux jSQRWMqVfsROe0abRsfvcINHk/ASZ8WKd81hUMAvo1bntu+DR6qNn4HrgaDAcVfD742s m2vgfn7rceIhAlZtMkQjQOxilgQqW6Nlsjhf8QHILnz1O9uYCYbAoUzsxXmGgWuDSDR1 wCbA== X-Gm-Message-State: AOJu0Yz9Dwz7whfp+o6Kg+HBXo8WYQdbYFDG/PLUpO1mZ6IWOWG2aglq pbhF19DA6+bMLEFW/QUQdmTWhoWkhtTOWw== 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: netdev@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: 13521968 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 4FFCA22F0B for ; Wed, 17 Jan 2024 16:08:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507716; cv=none; b=O7fjQnrd4FC9kHFvyHdg78iyIypSRVkaTQdFSOdZ9tnpzoseLAxZ9+5bK7ZmswDvXm7nZf6Y3oLUhe2v9DOOats+DxXa+aWVviIkamf0cKmD2UHBqjuYb+eGCgsN57hW21Yg6l4wOs0eOZk6W5AldVlZBXBE652JnH5SX+fZbuk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507716; 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=uG9me5YIKRZqxtjK6297o/Pe2+J8/J7cQ83fgla/fE/W061iZkP2GimiHO/Xnpwg7RoJrUmkZN88yAi7cUzynN765BnRf52DtQ8sIy2xwfHZUbGBfxDbf3GLPuAtGzX5CwAnSczNbjG/Uag1OqQbhKb94J3njSRByK4YV0UNOYo= 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.43 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-f43.google.com with SMTP id 5b1f17b1804b1-40e76626170so35567725e9.2 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=QGRiDhL+dZ4I8lF8/Brmrn4u84DxcczhUuYzav7+rKpOQE3dg0Pq+4976G/vkNnewq UBeb/p8DjT9RXdk4GEmexVVqxo6oJhd0KMqWLQxn3GD2edmsAZPhMl0lljU/Xe6gp5Mn 2hzTqNTJyJoJjBObf87f6tns2mOHsg/mNhYg/yPyaFkXGzembRWckSuVaEx3sLS4RfR+ mrkl5riK4h8gn3rk16d5CcQjRZL5mWWYw5Ux41Ufhczhgu/9W91+619zi80pvKSDaYdl unkdDRuvCl5vUkg6sfTTKPuZNsENR+CmcEz1cojXMRonkDQ81iEWSSssdzNWry3vkg/B y0Lg== X-Gm-Message-State: AOJu0Yw0J23bsLTSmddpHhKEWTTabN2tFMN7iEj6Ack0rmR9CPW82N53 FVDpYJvWOk7gXh/K4x687w4QBPcUCZTcXw== 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: netdev@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: 13521969 Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (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 7E33D23771 for ; Wed, 17 Jan 2024 16:08:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507718; cv=none; b=gGtvZT31BoPb+3TT7nnHoZKeSULPJEwT9HmtL47Kv9Gf7yQ7mkJmFpWKLyh3xdvtmBszTv8ML7bruNMeXg5g60hXGPB4N++Jj55JCiEhb99D++TLZQCynO6Q5aS5vN2YxvhMF+5sExt/wEougGWTeApldRKXt3B/JXZ0WJAN5Aw= 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=XYSz4EvRGtf5o407XrgaCYlKOHLBKIGD7c869z22N/3mclgvg7bLxq6A+2QmQy8MTKcqHEcP40ILlYESw/KrY3ZpvO7ZjFE2Zs5oxAapYqy17psKZI60u/KtGCnyHXLkZd9oxqa8wY518nWi2V2CV7v5jQEH2QAgJMvhUR832VE= 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.179 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-f179.google.com with SMTP id 38308e7fff4ca-2cdeb80fdfdso12955811fa.2 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=EHJh6+dvPKfjYWrx4TjG0sW3fexhbfUheisfsaORyXbw27sLILLVSBXjFBqjB3fabL dW9vO3ygfAfKlM5kUWrmAUL83zBGLuf2u1xbjSJ0kjs11SjSiYxzO+Y3cV3Crywkw5B7 5wOMZ5WP+FUIWsqvIzqwyydCq1TxcFNdVrbiBxzBX0UDqlKaGWfhUCocCazTm5Wno82F DhVQS5p/Zn5fBWHnhIz3XarM7A4WZ3+pnKTGAI9hw1j4p8PfZoq4YeLfFE/pRw9k20K7 xD2ZZ/k/aQO827ptsDoOXa7+4D6CiEN6zI4xCCgoB6Wif/PgDsv2ZSlJUx1MwO+M/qnu Uxgw== X-Gm-Message-State: AOJu0YzW5MOMcGHJRJm5jAB/onnTb1gYSICUmAyJWat8F2gTbFXVZKkg nmPilZKqBLojOnlw5LzZvmYdyMj6eID3Tw== 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: netdev@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: 13521970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 ED09024214 for ; Wed, 17 Jan 2024 16:08:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507719; cv=none; b=TGnejys7n+GWqp1qxELbDwYzylmuTbmoDZX3VmVjlL0b5WHiBSf31rKmh0cGQ3u7jSK3IvWBp46tkD3fGyM2++Jtk7mLxuluhzfjKwYJgvCYopQ7Y4ZtD+sKYpKQRQMvsv+toPKdQchbXmwU0uxdxqK4r0UGmVlVrzwyfvKEZhU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507719; 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=HapY3fOu2jV+5CahS6iDwmcekDbMdSKv9H+KjeMCFEJH9bAQiLRmsS9cXGPs0ac2VOnfHKUPx0WnUDm+jkDXcK40BMlvzq0JadFMP1n5aWBSrb4h2K2826e3gY+pb7tovH/4PuXx7biogpEH86j97qYYbNnnBDmY6unEj1eatTo= 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.47 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-f47.google.com with SMTP id 5b1f17b1804b1-40e884ac5c8so10289125e9.2 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=HGrOufNc/Mp3Mvqrs0cd76apz1sXbUF7jRV38PIv8aKaAC9eq/EhTTZ8rt4R+S+wkC m/+PbZJH2TIyH1R9h6b6O15eTkwvMSiKH/5vTG0FRBpXT4aA8M/hXqRXV0Q1iKSSTMQ3 uEtNm5y8fVLDEgqh2AaIf2gNHm2ZHt0Jt0WnXLUT/jHgP22goiDp7HHVxeZEiHnJzaA0 5p5SfXXMWpui7tsbTsqIXsbUdp5ubmwe06AYJpV4EDWZ4a/T4U3/yST37mWx2/V1ASo1 xhgttjs77/n19H6WPN/MmqwSLaCO4gDdyNogj8I7Nt+0xKAr1EvbxP8P5MRKaiAp0JFr bSSw== X-Gm-Message-State: AOJu0YyTr7tstMJNJhtd5k6TaoiZboBVTSjQY9I38rhSzkb8YH7Zbd7O surGcGtyMUmBDI5zKaQlWkwKUhyKudi2Ew== 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: netdev@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: 13521971 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 84AD624A1F for ; Wed, 17 Jan 2024 16:08:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507721; cv=none; b=VK1HIKjwfl3uF7zlADGFJGj/+Tslik9Z+ojyu7aCkSxMCSKrndEvalRBz4rZ5judS+fgoO3Rwy3G20mnOlCiA0dN7l3sd/ZF1bspEjTYOiBHr0AadssK7Md+QxlRGZznFmQFs2i2Z1MCL6GqXGMz19AOIAreFlkT11Nz8pIF7io= 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=VehojibDwyz4xN6XA7KydhKHq+Rmife7oM9DOvvuCjcST1p+E/pnCSPysxloV59W/2lQn3M/eyBfwZkVic3PakeHSCADGwspV89OPzSMA2DAzsw4Iaf3hJ4ic01yAsJMfv6Dr0R15HCRCCYM5IDvJGB9nsdpi0UnW/C9thAF8MM= 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.47 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-f47.google.com with SMTP id ffacd0b85a97d-337c4f0f9daso520211f8f.2 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=hVCGGgKS66001mo45yKFnF9X0WYK099KMxNCVMKb8elGm9GsCpwi22iHIs/zZgwTO4 t6OyDQizR+Y6SMdcb/oh++JewyAWBbUNN3uCQVx8+3ZI8Cye/5n7C8zC+b72D9S/UWx7 8dIhU5JVLMlVJVYYXmCtppDX6ZVuY9t5/7whm+OGLLL4+Bav6iL+AcjYHumNb2iqP/7I +LXHRhvTYSGHUvbYkxajLpJ2w2jLKwVOeViCH46IW/qCQQgz6jSzztjFLMCzc6e+hv7I uVTcnWiX5R3ysJHV1ITMk2dxAGXgruSgnPlfLqhHZhgAoM0RtZrtAqkkKzteQy2clkiV d/wQ== X-Gm-Message-State: AOJu0Yx63Zmvtj0MCRYSxjHqNuSF4uecsDN1l4Kg5HuAjyKo3Dm/1KYb X30utpwG1ft1UAWwHmpTdww5hLfU8mPuOw== 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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org 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: 13521972 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 4B835250E6 for ; Wed, 17 Jan 2024 16:08:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507722; cv=none; b=EBy9N4uzrMs14Rzcob7q6V07ISYiYFKKESa1Z60JmNhvw4sd9y1dIxT/mu2fcYS1MB9yGDLDkA5vSyrbsYXP3pqZNP5C3k7o+5iJrutyiyvEP3j0H4EAaaFrItlPg8LpAnMVHA7NZHeQ18eVxtBEa34C8SyYmsltuF40wUpds+M= 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=VMgxPpDdTKdGmEO91yLqZP2Eoj8GTIJmNATaj7A3//LG9tTXdmzNpoHooG7GJYA+v0ffxvwpgvo9zHsy7wNmt0JXKq/grjxoidDX/DfmIfxFO/KljNfgMLGSMRKwHYzfdNr3VMQ6i+qO6dwFVRkTpoLwYTljNn+gNFSDrxYuz10= 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.47 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-f47.google.com with SMTP id ffacd0b85a97d-337c40fde20so629146f8f.0 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=gqoGDcyPaXn/9c1zWuKThDf/e40pAcHfzyvvL1tlGcvNVZZg3SY8dDjPfo+YsVnd/f 9TyvczT4jq1Qv5zXpV9iwk4L0E4/OwpF+dscjNGMJSOiJjc3BcivpZ5M76dMrgM2/Dv/ my8r1/EtDvtTsIYI/8IAP8ip9AHb+2ven10UKaTFlyjBdnmcNFKVuw2L0HjUaiUTh4QA VwFWLK1i6rVDo/Ax9yfzjQv0WUPCEh1xP0s4Y9JTVxJ6iZNRxB8D7GtIlgQowUlGokEZ IVVyohFEocJW4N6wjsTVeYGlCrUwHM0wGozlHpXswKt3jvUtRuvE8ZFn8HwyJNbxZza5 qeFA== X-Gm-Message-State: AOJu0YzjaF3+Nz2Tn1xEbPKjdMlIujiKIBz8Zmf1QOjuUYzwddRMOJ89 5bfsFz8tGnx5qdyyaQ6bBb+6HvWbc88g2g== 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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org 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: 13521973 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 AEB5D25558 for ; Wed, 17 Jan 2024 16:08:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507725; cv=none; b=bzp69CijkbKw88yfPRewYvXH62XEWxpz02noWTcf5incqe9HA274qEu/KDS5iD/xHAFCdn/B9YZVW6pmTJCOv6TOB4mcFjpDzcAx9IpXVRayDq/3SQL3d7gGZ4i/6hqW9P+RTGV1QRRFjHxInldD/MtEAg4HfBRw0oNru5jJR2Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705507725; 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=W0ByVB9jbMidiSs7oOsyJFZqkaldKS9rc8MImeYMLBf/9H54ROpsNPugjZ7MgX+gWThrJ2LICJa2BAqbM+3mhVmmlbvygEhlxxyTAIulHExfsAeqLMbQJ96w7O3XuXCxCdyrMfkwhaLkyc/NiNHumzg4g7ohIUbN57m1R89LLuE= 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.46 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-f46.google.com with SMTP id ffacd0b85a97d-336c5b5c163so6704611f8f.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=rM7p8A5uQrz2gJ4SCxRrvmenHTAEiQFfCv81fxKA+T8ylNgB8Na30VYSKajwUa4AWp qB7ngyrSFvBAWsui+8nekugKn0mxiYNpBdVLl3VvMHqJhJaBs1SG+g3qNry4LzONqHWN WI1lMDEvlQNBvqVaeVPk5LCh6THtW3NPD5lKt1RgW3ErZjlm3CeH/1ujYdqE4zeEtrmH 1NXPz1L3hEiZetGfVLqhKEOVdMWs4p/mrtmqytjs5aNpQqkKadZn0KUNyzeIjTmIF/yw OhwIfbvgCO6cvvJk6YGRRcLg5qHVOnea3aX8EhG36K3ocpObBkZHHcTX7rL56zTVNkCP 0+/w== X-Gm-Message-State: AOJu0YyjXfpIQNWNFsLAf9NRN2BmJW/K+9yNpu/kgLtkGsStkvOQM3dJ MbB9QmTbeRwWkFdxlmsalAlwTjzpmfdd18dfBxYy3pgCkkOp6BQuy1wf0ZZhcUc= 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: netdev@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");