From patchwork Tue May 6 13:10:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 888272 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.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 71B5328002C for ; Tue, 6 May 2025 13:10:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746537028; cv=none; b=aZ7CsYtnPC6oL1hew8pqzFsK8mn1yFUP7BZ4zrhqfhE5KGi2X+LTrGRd3ht4cjOhR0S8zXOno/msnjTJzTh/JMtHORAvxIk0ztc8gGKeS8a0ggs93RVejRNt2zyJVilL9AvAuQi1+GJOjRixR9Umvrd3yscdEB8jLMJ+Qt2uK4Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746537028; c=relaxed/simple; bh=oTcDnSI1bNVQqjBsPCRTQxoefbYwyIGZKDofCNxpi+M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gTsvGuztRqXKoPJ0rxnG77y+sa9YKoHOVwK7iDZWEFBN3Cv3olY7HSJKJF1XcuXAJnVK0rb0aSrf/YIbvhvqDpVtGjwRHK08TFpagtN8M/vAu3L/0cyKkFW9jM5fmYWdRqGT6C4VOh4xY0/Fn5pkT2hPbSMfYBoEJ+kET+UG3RQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=a4WKFFdK; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="a4WKFFdK" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-43ea40a6e98so49661895e9.1 for ; Tue, 06 May 2025 06:10:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746537025; x=1747141825; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=/Iv8onXZwEMREo5qlPvqBSmY6LEmZfGy2ZM9zSxD9OA=; b=a4WKFFdKS8MVw21zsMcTol8MZQl49WtmzRvMReUEFRkt5/um+olhpbKiolV6TpcvJU nLIf9qEEMgAi2n0f3eln+MDaG3oEacH0XJotjT+P6BH7QXa+xes4/5wgwcctL9zYqInA CbccGZlAp1XZl1CaNqgs/xDcr1ZDU4w3423W4czWtcItiFRmEyVeQPAIvPIVNTnPb5Gi oUBv5K0awT4KrM8oGzSjwvHnJMISOg8miPL75Kn59S2UVRrHPzL4fglayhBlDnHaCJL6 ejBr7wILHBDQ+W/IuOzxgxxjpEWLAY7ITVDlDauZ2wstguuReERnp1g1hd6mLRAJ/Wd9 AY3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746537025; x=1747141825; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/Iv8onXZwEMREo5qlPvqBSmY6LEmZfGy2ZM9zSxD9OA=; b=A69yQ01oIIgEfbTINar9oeRUCI0QhRz5IDZHg/hPXUxllo/AoLMPYXkzvVwHNecfPl ukhcjYWUBbmnwZU/3SM6fFz3t1JGtFXiVQq0P88apgcxO0YDspkV821rUuU9KvYr2+/A +3yqYxH3F8+g9ahjsfmrP+jTRg3E50i6QyqJk9+AIyvXWuf4B4uC9m2dn8Gwnr5xTdou JAiM/Dbjrfx5Fzr161ClGuRM9k53UVX6lJScmoGXqWwfx9norJ9G6YMIKCP/1Tkx38PG LCi9ZZrSX3PcaZL32nqAeRtPF//BGcwJxd/nnRyNPCjw8Eb1D6FiUAcUCTlAAHNKPqTG E0Lg== X-Forwarded-Encrypted: i=1; AJvYcCWERmTkej6btZVmesk7x/Z9t8udbMttJZRGb7Zj9eYBPCmGhCY/4u7akmCfRmuTxQmcwalGd5KDkzwBV/56@vger.kernel.org X-Gm-Message-State: AOJu0YzRNddHNRmBfA/cS5M0gGpGDpFj+qcmOFbGF9OO/yr7Bh613TQq 499R1IdMJ0yhoa+zJkq7pfgqFL8M2vwHhs3YmNcsw3m+JfZ4dw1VoFu4UL1qEPY= X-Gm-Gg: ASbGncsn9jP5z1BGYLb1PG6/RMHPs4uDvhqYliGf2KBQkQozSvBN+w/kP97ECpDAZku RTBtXUW+gVvRH+5rODQAFa/wtXS43GqHe6QMy5wbPcYnC0WmuwXBEM/pVAqHernEkFZn7ox66XU qO9hIOxnQqzEGo5P7H5nKyihuIwi1AjWslb8yHwle2IazY8HAuVonDRsA2DB6x1rcCIdg1wHI6T aC/M/VvmhFdLkerVPbngBlPV4Vkl4qmwh6DY1XVsB3vBk8hlQa5dSw8eKi3mSOzczERLzeDEd9R gLXJDx4Xerw1eZKNOkC0U3BrBSgcKbv3wisSy79XdnpsM1AqPrDOsIo= X-Google-Smtp-Source: AGHT+IEHzp+5y+s2Mm6GFfK8W7K4y8+KiivNWsSPRroJGQvmgcFnvlH4/ZTzSgWez3LsluqXUbVrRQ== X-Received: by 2002:a05:600c:3b17:b0:43d:745a:5a50 with SMTP id 5b1f17b1804b1-441d0fd348dmr21279125e9.19.1746537024283; Tue, 06 May 2025 06:10:24 -0700 (PDT) Received: from [127.0.0.2] ([2a02:2454:ff21:ef41:3f93:4614:996d:f5f7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a0af3255afsm1771268f8f.66.2025.05.06.06.10.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 May 2025 06:10:23 -0700 (PDT) From: Stephan Gerhold Date: Tue, 06 May 2025 15:10:08 +0200 Subject: [PATCH 1/4] dt-bindings: mailbox: qcom,apcs: Add separate node for clock-controller Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250506-qcom-apcs-mailbox-cc-v1-1-b54dddb150a5@linaro.org> References: <20250506-qcom-apcs-mailbox-cc-v1-0-b54dddb150a5@linaro.org> In-Reply-To: <20250506-qcom-apcs-mailbox-cc-v1-0-b54dddb150a5@linaro.org> To: Jassi Brar , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, Georgi Djakov , Manivannan Sadhasivam X-Mailer: b4 0.14.2 APCS "global" is sort of a "miscellaneous" hardware block that combines multiple registers inside the application processor subsystem. Two distinct use cases are currently stuffed together in a single device tree node: - Mailbox: to communicate with other remoteprocs in the system. - Clock: for controlling the CPU frequency. These two use cases have unavoidable circular dependencies: the mailbox is needed as early as possible during boot to start controlling shared resources like clocks and power domains, while the clock controller needs one of these shared clocks as its parent. Currently, there is no way to distinguish these two use cases for generic mechanisms like fw_devlink. This is currently blocking conversion of the deprecated custom "qcom,ipc" properties to the standard "mboxes", see e.g. commit d92e9ea2f0f9 ("arm64: dts: qcom: msm8939: revert use of APCS mbox for RPM"): 1. remoteproc &rpm needs mboxes = <&apcs1_mbox 8>; 2. The clock controller inside &apcs1_mbox needs clocks = <&rpmcc RPM_SMD_XO_CLK_SRC>. 3. &rpmcc is a child of remoteproc &rpm The mailbox itself does not need any clocks and should probe early to unblock the rest of the boot process. The "clocks" are only needed for the separate clock controller. In Linux, these are already two separate drivers that can probe independently. Break up the circular dependency chain in the device tree by separating the clock controller into a separate child node. Deprecate the old approach of specifying the clock properties as part of the root node, but keep them for backwards compatibility. Signed-off-by: Stephan Gerhold --- .../bindings/mailbox/qcom,apcs-kpss-global.yaml | 169 ++++++++++++++------- 1 file changed, 118 insertions(+), 51 deletions(-) diff --git a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml index a58a018f3f7b9f8edd70d7c1bd137844ff2549df..3a0a304bb65a68b2d4a1df79b3243ddac6bf88b2 100644 --- a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml +++ b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml @@ -72,6 +72,7 @@ properties: description: phandles to the parent clocks of the clock driver minItems: 2 maxItems: 3 + deprecated: true '#mbox-cells': const: 1 @@ -82,6 +83,23 @@ properties: clock-names: minItems: 2 maxItems: 3 + deprecated: true + + clock-controller: + type: object + additionalProperties: false + properties: + clocks: + description: phandles to the parent clocks of the clock driver + minItems: 2 + maxItems: 3 + + '#clock-cells': + enum: [0, 1] + + clock-names: + minItems: 2 + maxItems: 3 required: - compatible @@ -90,6 +108,76 @@ required: additionalProperties: false +# Clocks should be specified either on the parent node or on the child node +oneOf: + - required: + - clock-controller + properties: + clocks: false + clock-names: false + '#clock-cells': false + - properties: + clock-controller: false + +$defs: + msm8916-apcs-clock-controller: + properties: + clocks: + items: + - description: primary pll parent of the clock driver + - description: auxiliary parent + clock-names: + items: + - const: pll + - const: aux + '#clock-cells': + const: 0 + + msm8939-apcs-clock-controller: + properties: + clocks: + items: + - description: primary pll parent of the clock driver + - description: auxiliary parent + - description: reference clock + clock-names: + items: + - const: pll + - const: aux + - const: ref + '#clock-cells': + const: 0 + + sdx55-apcs-clock-controller: + properties: + clocks: + items: + - description: reference clock + - description: primary pll parent of the clock driver + - description: auxiliary parent + clock-names: + items: + - const: ref + - const: pll + - const: aux + '#clock-cells': + const: 0 + + ipq6018-apcs-clock-controller: + properties: + clocks: + items: + - description: primary pll parent of the clock driver + - description: XO clock + - description: GCC GPLL0 clock source + clock-names: + items: + - const: pll + - const: xo + - const: gpll0 + '#clock-cells': + const: 1 + allOf: - if: properties: @@ -98,15 +186,10 @@ allOf: enum: - qcom,msm8916-apcs-kpss-global then: + $ref: "#/$defs/msm8916-apcs-clock-controller" properties: - clocks: - items: - - description: primary pll parent of the clock driver - - description: auxiliary parent - clock-names: - items: - - const: pll - - const: aux + clock-controller: + $ref: "#/$defs/msm8916-apcs-clock-controller" - if: properties: @@ -115,17 +198,10 @@ allOf: enum: - qcom,msm8939-apcs-kpss-global then: + $ref: "#/$defs/msm8939-apcs-clock-controller" properties: - clocks: - items: - - description: primary pll parent of the clock driver - - description: auxiliary parent - - description: reference clock - clock-names: - items: - - const: pll - - const: aux - - const: ref + clock-controller: + $ref: "#/$defs/msm8939-apcs-clock-controller" - if: properties: @@ -134,17 +210,10 @@ allOf: enum: - qcom,sdx55-apcs-gcc then: + $ref: "#/$defs/sdx55-apcs-clock-controller" properties: - clocks: - items: - - description: reference clock - - description: primary pll parent of the clock driver - - description: auxiliary parent - clock-names: - items: - - const: ref - - const: pll - - const: aux + clock-controller: + $ref: "#/$defs/sdx55-apcs-clock-controller" - if: properties: @@ -153,17 +222,10 @@ allOf: enum: - qcom,ipq6018-apcs-apps-global then: + $ref: "#/$defs/ipq6018-apcs-clock-controller" properties: - clocks: - items: - - description: primary pll parent of the clock driver - - description: XO clock - - description: GCC GPLL0 clock source - clock-names: - items: - - const: pll - - const: xo - - const: gpll0 + clock-controller: + $ref: "#/$defs/ipq6018-apcs-clock-controller" - if: properties: @@ -179,19 +241,7 @@ allOf: properties: clocks: false clock-names: false - - - if: - properties: - compatible: - contains: - enum: - - qcom,ipq6018-apcs-apps-global - then: - properties: - '#clock-cells': - const: 1 - else: - properties: + clock-controller: false '#clock-cells': const: 0 @@ -216,6 +266,23 @@ examples: }; # Example apcs with qcs404 + - | + #define GCC_APSS_AHB_CLK_SRC 1 + #define GCC_GPLL0_AO_OUT_MAIN 123 + mailbox@b011000 { + compatible = "qcom,qcs404-apcs-apps-global", + "qcom,msm8916-apcs-kpss-global", "syscon"; + reg = <0x0b011000 0x1000>; + #mbox-cells = <1>; + + apcs_clk: clock-controller { + clocks = <&apcs_hfpll>, <&gcc GCC_GPLL0_AO_OUT_MAIN>; + clock-names = "pll", "aux"; + #clock-cells = <0>; + }; + }; + + # Example apcs with qcs404 (deprecated: use clock-controller subnode) - | #define GCC_APSS_AHB_CLK_SRC 1 #define GCC_GPLL0_AO_OUT_MAIN 123 From patchwork Tue May 6 13:10:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 887874 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.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 55D4A280311 for ; Tue, 6 May 2025 13:10:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746537029; cv=none; b=XTM9es7sxW61CiqBLjDtbwVwjMGQ/yc5eebvvQ1Fvyh98kvDKKGekIk+xNarFQ7RVO9FHtYZacLHOHWJrOw1ddVa9eD28ER6W3XjQFGILbkmDMLb5x4RkQXqqbDkfwT0fdPQdzW6gS3XjNr9OTvpx26xDzcn57tJRlcfxtI7Jo4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746537029; c=relaxed/simple; bh=fK59Oou5drgQyhp0Ss+j4VYrMmVw0bDtAiWMF9Ozu5U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=L37Ym9qij4n/XlMBfspg613UKaeyYEaAJDQ1u7Svq4w0cFzMDJgbeneKSqs7/wF0CltINRuIle0sNLWObAzj19Lm2YhhGw/kxnfM8fW4K/92mtoXoCbqo5TtB+Lbyk2Y59hfeY6Bub5SQU0rQb0MvfbQcZ3LaYtqyun340iSxhA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=rgQdvIU8; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rgQdvIU8" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-3a0ac853894so647747f8f.3 for ; Tue, 06 May 2025 06:10:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746537025; x=1747141825; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=j7hjl3tAkLPYtX6/B2YAWQ6GsOIrYFPOtKZDg5lJipo=; b=rgQdvIU8Wgoph89KHmvIdRzGLA46hKnq8YNvFmQU9aFK7mKkcLsmi9PAeaSckyZz9D U0kzWXeyKmcv8uh9VdBlXIaF7SvqveE1dV4qWDXOwihJgblTSvxniE3jDMDB01W68lE/ T4Ts0SRiAKT3nNiSFeKJ3S/ET9iiUV80+tlsqfyWIQpFhspSDeo7I9F3neo0LppTRkbY Gapgm2ng1hvYfAYNbh6UVdZ/ejpADcdgtz9VbnFGmWHT12VnjHlvk653SRnEl7ECZ3Pg ic521jpizxKEEaMVvlZCCSWOOvpTz4lm3Bkf1pTh+sQd1cKTdpwCC3RWyRtF4LvFi3Bk WX+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746537025; x=1747141825; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=j7hjl3tAkLPYtX6/B2YAWQ6GsOIrYFPOtKZDg5lJipo=; b=ZJweA0nJoj0PCLWv093MvxFDfEvQrBcJXtNcpTkTGYE/cz5MwVBmDN7jG1CKlZWB7E rYLHYOoipXTckT7RMSYgP1NCJpiYRufJmMhJGtbISqrIvU5zl2zA3yXknqeyNUAbNtxN GlwzG9mAmcy8A5Y0YPrdo3Hdf+X0C61SoJekn/r0rrYVU5WxmrYVpV8yIT5vltxX2Jia l9LHryIrgEU9Hi0iawgocr4sJBj7ReGIJqNFICisrCiKBmfKAUbtuuZtx4MsRPDNk4br njYHgZ/6Zk8+ukgZ+M8S691JWPubE0VemhCTSU7DNvHkqynU4kLwzdji0V4FvvlrDZSf MAeg== X-Forwarded-Encrypted: i=1; AJvYcCXD1nSLarmjBBKZYSykloBP5ucqEn6dlxVK4aAMIn251oo2Ge06T28jrG/LT4m2Eaq/uf8LA9b5maJyVmgb@vger.kernel.org X-Gm-Message-State: AOJu0YwJfaPPtkHxjjDAbyAKwmNHzK1/8Mf2dGzZkhbt0W+fJmzD3oLZ MRe+odLCMIFb/w8Yy6man1uxbxEjp3pWygocqiA9eb0/lNvc0yGfq1aTCTtugRU= X-Gm-Gg: ASbGncsJOniC0SPFMDuRppvBbVTybGTNQta9r8YVY3FkmrFfoiDKmWFApioeeG5lK00 MPhrSkFHoP3wv6BWjOC0Vx+aaw4tfl7zw1doe0l7BzcPalWz2/gcrhXTFnrQBgOOJGvFv2lVmpo AFWcSaLG3jwHbFmcgAcrfBgTv3zIgzpS+DSqDTQ6J9w8wNLjOFEsllI9H3dCp4DPXlEt/L3uEtz R9d9PSZtV+YTSGDp8aozsKHlDty0gqFpMlLSde0Yx+zEAU0K5/HvyJ0xbyKvu/+WHZfBOa5eSSi I5t4gKQhG44QBNl/z3WDXnDb7gA2mzAQPFnCWf5M6S6+RFg5XL4JLpY= X-Google-Smtp-Source: AGHT+IEiRsxAkVrXgPCAZV3F4X2CztHeRG9ctQ5zIhdFUM3PU84EJKKoITEP995ACO1Ck8FEqkm68g== X-Received: by 2002:a05:6000:18a6:b0:39e:cbe3:17c8 with SMTP id ffacd0b85a97d-3a09fd6ce46mr7930291f8f.12.1746537025293; Tue, 06 May 2025 06:10:25 -0700 (PDT) Received: from [127.0.0.2] ([2a02:2454:ff21:ef41:3f93:4614:996d:f5f7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a0af3255afsm1771268f8f.66.2025.05.06.06.10.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 May 2025 06:10:24 -0700 (PDT) From: Stephan Gerhold Date: Tue, 06 May 2025 15:10:09 +0200 Subject: [PATCH 2/4] mailbox: qcom-apcs-ipc: Assign OF node to clock controller child device Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250506-qcom-apcs-mailbox-cc-v1-2-b54dddb150a5@linaro.org> References: <20250506-qcom-apcs-mailbox-cc-v1-0-b54dddb150a5@linaro.org> In-Reply-To: <20250506-qcom-apcs-mailbox-cc-v1-0-b54dddb150a5@linaro.org> To: Jassi Brar , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, Georgi Djakov , Manivannan Sadhasivam X-Mailer: b4 0.14.2 Currently, the child device for the clock controller inside the APCS block is created without any OF node assigned, so the drivers need to rely on the parent device for obtaining any resources. Add support for defining the clock controller inside a "clock-controller" subnode to break up circular dependencies between the mailbox and required parent clocks of the clock controller. For backwards compatibility, if the subnode is not defined, reuse the OF node from the parent device. Signed-off-by: Stephan Gerhold --- drivers/mailbox/qcom-apcs-ipc-mailbox.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/mailbox/qcom-apcs-ipc-mailbox.c b/drivers/mailbox/qcom-apcs-ipc-mailbox.c index 11c41e935a3619b74ad0f5e2d82699ca8aa05722..8b24ec0fa191efc975625d9b9270140ad1fe7b9b 100644 --- a/drivers/mailbox/qcom-apcs-ipc-mailbox.c +++ b/drivers/mailbox/qcom-apcs-ipc-mailbox.c @@ -116,10 +116,18 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev) } if (apcs_data->clk_name) { - apcs->clk = platform_device_register_data(&pdev->dev, - apcs_data->clk_name, - PLATFORM_DEVID_AUTO, - NULL, 0); + struct device_node *np = of_get_child_by_name(pdev->dev.of_node, + "clock-controller"); + struct platform_device_info pdevinfo = { + .parent = &pdev->dev, + .name = apcs_data->clk_name, + .id = PLATFORM_DEVID_AUTO, + .fwnode = of_fwnode_handle(np) ?: pdev->dev.fwnode, + .of_node_reused = !np, + }; + + apcs->clk = platform_device_register_full(&pdevinfo); + of_node_put(np); if (IS_ERR(apcs->clk)) dev_err(&pdev->dev, "failed to register APCS clk\n"); } From patchwork Tue May 6 13:10:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 888271 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 2F0E028002B for ; Tue, 6 May 2025 13:10:27 +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=1746537030; cv=none; b=WHaXd4TYTx13IbNv0vFg2/84Kwy+MpTmLRnjk1DBiQ0P5DhlF6emrWpOmAAxP6IJXv/7kTHY9SaMZjfsC51achU9fF0IjcNRtNCRnNbqKI/mwMaBLicwe9JALlS1dlxQzAiGYc8hwx6Tb9wTgTfJCzEkAOQREtJ3spkCMro8Z5M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746537030; c=relaxed/simple; bh=yxf14Ljk58+UMoTg7Yyge6qVosH5ZXrWvi6A5xwpE58=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=q6HBLMTs60NVB78RdvW0N/pmhLVu8BoTww7Gg0aF6oOSbGet8diEh5hP4SI2ykeL/aAq8HMMulqtaio70OJcPiE30AJKwC0WzhbNX6KUfiHy+hs/0yTmcdoc7+Avlumk3TS5er52i2e01cBzrfiHNt38pft/VrQ2zIjA9d/YwA0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=cptEZha7; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="cptEZha7" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-441c99459e9so18193785e9.3 for ; Tue, 06 May 2025 06:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746537026; x=1747141826; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=TgxrymKBqlMpBOa4fXvZbXrP4W9uX8YtK+8DIxg3UAo=; b=cptEZha7oz2gk4leZ3179fl5bOD1MXNRE9fZM93udsp24gxoJexzpHeE9lWgsMrf3Y blVG1y8SxyHSw0abw7cZlHaLw8c9v+6qBiFTQeuY9p/F9t9FqTarACbaCXvWQjECZQ1/ PBh2omLc6+OuxVSqM1XMzYU6ZslauQikCob2oimdrtEl0YFX/A3vBFHiU/37lvVudOWx E9yjaXKNGEDbalAquXZCCiAHl0YBcE/tPOqAxJMuMcZ+ChcLNc4pc72irqY/OE7kNWK7 LldukcY+Z7bn0Bqy8AIAV9obrgGcXfgBcYV3m36H73i6EKmHXGV2TnRiWIzQw8FGOIjB MtqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746537026; x=1747141826; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TgxrymKBqlMpBOa4fXvZbXrP4W9uX8YtK+8DIxg3UAo=; b=OhnkF2BKOXDIG1hrUAYSyjY02EW3UurT+qh8tBJhbCStNf9Jz417g7K2UGNkS0uxec VXBIK74Iicgnm0it1RKdLqmErFuRsPzbhybo7AbDfeigj2d3VgUBnIJZ4CGWbY5cUpoI YuFpIh9bR5b8qc905Y7VaaDOk0of0WGTwlPTcF6OUEIBQNz3h46l1KfH2PAMz2kr6KuR KtVQZQD+B1IPhgwmW26R+kcm9f48lIQ1TC0ZxnsGvoJ8jvSrUj4dUwB9eUFGS17jMAd6 WY6dh/7tgaAEKypbhudjU+xeNMXw18PH32WgAYsVe7+bIdllKOTCcQTTo7qA5eKMbSz0 ETtg== X-Forwarded-Encrypted: i=1; AJvYcCU43/BPaOPbTg1yNlZ2WNLHsSPw7dN0ligC2a2DNtD0Ln5yJyfeRs1lY5W6DV87V6o2FFRGSECcV0M365Jd@vger.kernel.org X-Gm-Message-State: AOJu0Ywj9vcXy+kHE52N65tCCB6j+iDkY71ljCSC12QdclJSPaj7rHHL SoaARJtXRiVfyKi8ovjrqBlY6iNQ98YjPJ9R2Lhp32dffLzJUWnfGZvZ7Gsge/g= X-Gm-Gg: ASbGncsjTFTHC9hA1kC4aVNIueOGIUCO82yFPjsBa8+mESwmcYu6GuHkTQ5XZ1yApOh rnS0OHoB814idGLnO8p3P95xqAr81Pe5FooYT3Ozed/nTZ50VnGoA5Xh8nHL6oIMvmUMMq4+lvs QSadrx9k/3ZJ/6a1cw1p2rFGHbvxvd5lA/f5fDYhc9QHuuRC7J9YuTdxWTYAMsnnutD7qp586Pd N8ol1+ofoFZserlrlxszWWbs+99hJEyunE/oXvLxQ+Ym7tifiavsFzO6zhnBm75qywbuPzEBvp8 lkbialcOS/GkxjLRQYidV49liKMVyh8dxRKFVEuHfQR8Jkq7LHl5eAfYq8CQOGf8zg== X-Google-Smtp-Source: AGHT+IH4gKCkUyIZVMKUSRcuZsuNAPJ6O+y8mkjQv/iAU3euFY+19csLb2q2NlIB4YzdYULF7KFX4w== X-Received: by 2002:a05:600c:350e:b0:43c:e478:889 with SMTP id 5b1f17b1804b1-441bbe2c815mr163710535e9.0.1746537026227; Tue, 06 May 2025 06:10:26 -0700 (PDT) Received: from [127.0.0.2] ([2a02:2454:ff21:ef41:3f93:4614:996d:f5f7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a0af3255afsm1771268f8f.66.2025.05.06.06.10.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 May 2025 06:10:25 -0700 (PDT) From: Stephan Gerhold Date: Tue, 06 May 2025 15:10:10 +0200 Subject: [PATCH 3/4] clk: qcom: apcs-msm8916: Obtain clock from own OF node Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250506-qcom-apcs-mailbox-cc-v1-3-b54dddb150a5@linaro.org> References: <20250506-qcom-apcs-mailbox-cc-v1-0-b54dddb150a5@linaro.org> In-Reply-To: <20250506-qcom-apcs-mailbox-cc-v1-0-b54dddb150a5@linaro.org> To: Jassi Brar , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, Georgi Djakov , Manivannan Sadhasivam X-Mailer: b4 0.14.2 So far we had to obtain all resources like clocks from the parent device, because the qcom-apcs-msm8916-clk platform device did not have an own OF node assigned. Now that the parent mailbox driver assigns this, obtain the resources directly from the assigned OF node to add support for describing the clock controller in a separate child node. This allows breaking up circular dependencies between the mailbox and the clock controller. Signed-off-by: Stephan Gerhold --- @Bjorn: If this looks good to you and you are fine with merging this through the mailbox subsystem, could you provide an Acked-by here? --- drivers/clk/qcom/apcs-msm8916.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/qcom/apcs-msm8916.c b/drivers/clk/qcom/apcs-msm8916.c index ef31386831ebd2404b99edaeff4c95a31eb68477..af60f3ab1f82068e5ab046ee4a2231c7fb85ff41 100644 --- a/drivers/clk/qcom/apcs-msm8916.c +++ b/drivers/clk/qcom/apcs-msm8916.c @@ -82,7 +82,7 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev) a53cc->src_shift = 8; a53cc->parent_map = gpll0_a53cc_map; - a53cc->pclk = devm_clk_get(parent, NULL); + a53cc->pclk = devm_clk_get(dev, NULL); if (IS_ERR(a53cc->pclk)) { ret = PTR_ERR(a53cc->pclk); if (ret != -EPROBE_DEFER) From patchwork Tue May 6 13:10:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 887873 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 0FFB228033C for ; Tue, 6 May 2025 13:10:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746537031; cv=none; b=Sr4EimjpVqh/WXSE1fg++xA7BRUqoxDswEaXgwByMudmemvBKAWkUycMMEWzV7IFuXl81RxtosK/jpltzNkHVaFKIRfTyH5FjDPnN4qIz98I45mFBUfu/ihFCZWxHO0uAS6i0XqjQz1zGNrzq/49nA4RiaXOzfeJiCCnPOc4sAY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746537031; c=relaxed/simple; bh=dYgm4NlH5IPfrUOXQB7Rxpf3oTIhlLONuVDqq3iAZvo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hhWfpqLA0gPvHYea9uQ9H3HIhCz6q7vnCLjEgCWxHlAGhdcBpH7cN5guid0BrGqGfK73poT/ucw+3TDYyFdF/FHi0WJkiCPaeim3RRxRUlLcC7EuxZsb8pH95Iy/VEst8S0VCuYuB5ApxA+VuI2eWqiBF2ekW1zjUwpWn/qmLd0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=h/l2YURg; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="h/l2YURg" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-43ce70f9afbso49411645e9.0 for ; Tue, 06 May 2025 06:10:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746537027; x=1747141827; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=TjTp/aG9h3L2/xPCCH1ShAi5uTe++Ief7FWXdc/5tOU=; b=h/l2YURgLeT+rf4NEzDX2p0MgKrifr0yHvBozo8IhI0tq7YA/GgReFHjp9R9c88c+q OdFNMPs/fcYQ7wBc3YSP9H1gLZecg1H/4CvgCAXwWo71igwMtX0diLJuTBPc71kL73k2 pqYMvYUd52RrcE4AAAPCyZAKwHhLaiSA/jm2Wa+Ti6efiJD/FvqlRStvOUqrkKhDutEI K/38joCVEfpXtC3wDUYd6Bi2Nwd+ME6L2nf7OdkzWHU9YY3LQUw8RUCwW6EfnWSRtDa7 qJub9sDhtCWEOIwnTYfCUmaa9Mg+TeqGcEJxCFXNatrlwmKGU+2+UWZ1eDqI6y/cDUfZ XDrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746537027; x=1747141827; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TjTp/aG9h3L2/xPCCH1ShAi5uTe++Ief7FWXdc/5tOU=; b=iWmZb/TVqAh00aJSOP+3ZZPoRawwxWUYYx5HeTi9Ww05fdxISjf4aEed/nd0TsbU5g Ub2eF8fStd+B7RuNdNabRBtB07f5Eb/B+e3PnFirJdJOF7YwaMoun6JKviik1qI+edOE yFMHk0TFvXqMQYjfQPrhomj76lXaq+DifNPJBGZuDc1XEwg4QAoASt2tjrGrcN1bM95G 0OVkqQvfNwnfjifRTKHIr5Un04Vd5bw1oNjNrlflCNM9xSCiLBD3rP887Wn7ZoF8/xc3 iG/4gtmUY/S+HJuRLTZfqeF42hMIObIgQqNCDqEXWH6ij7V3qeMC+VBISAY0e4/0yv0r HURg== X-Forwarded-Encrypted: i=1; AJvYcCXOGjWu6/Dwt8X6WIW4jttqJj1WBcVWNGKctY2vybuzkuNRVAXPAQq5bRJ9yG1JP5O66C4q6aaMeZHWBhBa@vger.kernel.org X-Gm-Message-State: AOJu0YzRozoH28Loz34h73QwnNLmPY5y55ps+Eoob9uE30PUjVFh89Ap 8ZMlVBZmATL7lsy5jmebcCM+d/zoEILQwifiMRdWb2er/8hLbf0uymU7NOJhF04= X-Gm-Gg: ASbGncvgEIS6/UDizDNxW7JHhN28CKr1zZT0BisnJj6dGocPFom0kVrejgWE8H9t/JD jG5gEC1p2GTy8OQfMcmZylWQUvQtsk8zRXw2sJJ3kdG33PPOmmS0mr0koByAmI7ownoLe3hDu3I Jrh7+Rok6zZd1wwOmS9iUXn267Yu5KLXtWS2K6cmSdca0llN60Jp/e5M8CrjKdSAiazYh5GcN/q J7TSw2zV6YPPn46QOvmLAQeTx2H3nk0mzqoohzC3ZBts4TAziEUNuPGNbTCa7ygUk+YjbDiszzI Tr4+wei9Fn3dDYtFSLME82Q07cASByLLhzuYkLN839Z9YjGtz7NFD1Y= X-Google-Smtp-Source: AGHT+IFaFB/FZezjripHyQEZgUYd+jxmBl3+AL6siEuRgHFWmNVit4blU6ZNo6pVl6a4NIiA+7gYKA== X-Received: by 2002:a05:600c:1c84:b0:43c:eeee:b713 with SMTP id 5b1f17b1804b1-441c4919f07mr78232605e9.20.1746537027193; Tue, 06 May 2025 06:10:27 -0700 (PDT) Received: from [127.0.0.2] ([2a02:2454:ff21:ef41:3f93:4614:996d:f5f7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a0af3255afsm1771268f8f.66.2025.05.06.06.10.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 May 2025 06:10:26 -0700 (PDT) From: Stephan Gerhold Date: Tue, 06 May 2025 15:10:11 +0200 Subject: [PATCH 4/4] clk: qcom: apcs-sdx55: Obtain clock from own OF node Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250506-qcom-apcs-mailbox-cc-v1-4-b54dddb150a5@linaro.org> References: <20250506-qcom-apcs-mailbox-cc-v1-0-b54dddb150a5@linaro.org> In-Reply-To: <20250506-qcom-apcs-mailbox-cc-v1-0-b54dddb150a5@linaro.org> To: Jassi Brar , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, Georgi Djakov , Manivannan Sadhasivam X-Mailer: b4 0.14.2 So far we had to obtain all resources like clocks from the parent device, because the qcom-sdx55-acps-clk platform device did not have an own OF node assigned. Now that the parent mailbox driver assigns this, obtain the resources directly from the assigned OF node to add support for describing the clock controller in a separate child node. This allows breaking up circular dependencies between the mailbox and the clock controller. Signed-off-by: Stephan Gerhold --- @Bjorn: If this looks good to you and you are fine with merging this through the mailbox subsystem, could you provide an Acked-by here? --- drivers/clk/qcom/apcs-sdx55.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/qcom/apcs-sdx55.c b/drivers/clk/qcom/apcs-sdx55.c index 76ece6c4a969266aecb32806269c791712f98804..e0e779a81f2c6b8b9cd34d839eee9aaf9fa33f03 100644 --- a/drivers/clk/qcom/apcs-sdx55.c +++ b/drivers/clk/qcom/apcs-sdx55.c @@ -79,7 +79,7 @@ static int qcom_apcs_sdx55_clk_probe(struct platform_device *pdev) a7cc->src_shift = 8; a7cc->parent_map = apcs_mux_clk_parent_map; - a7cc->pclk = devm_clk_get(parent, "pll"); + a7cc->pclk = devm_clk_get(dev, "pll"); if (IS_ERR(a7cc->pclk)) return dev_err_probe(dev, PTR_ERR(a7cc->pclk), "Failed to get PLL clk\n");