From patchwork Wed Oct 25 10:44:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 738430 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A56F7C25B70 for ; Wed, 25 Oct 2023 10:45:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343521AbjJYKpK (ORCPT ); Wed, 25 Oct 2023 06:45:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234661AbjJYKpH (ORCPT ); Wed, 25 Oct 2023 06:45:07 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF9391AA; Wed, 25 Oct 2023 03:45:02 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-53dd752685fso8623648a12.3; Wed, 25 Oct 2023 03:45:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698230701; x=1698835501; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=RnaK963hxwfVk8XsSeVFAewz/NSZrvVWgi/zhvvqbIQ=; b=Nch1dGK9EfE4SeAm74i8E52R+H1FsxeyUpp8G53yZ3fhld5EUD+dCTKQ+TuvarYNnk gXGyzlCw9kArYEePJWu7Q8fx0suYWC/9647261e8O5KUX8YuiZ0Cf+xe6/UyKh7aq4HU h8UeUnGBAz2flVSXd61D0yNk36GdHbf1uP7bsMmfrKasCe4+wmmCS0QBjg+jrzWd8XCx JhMwuZs1G/KN/Yz2i2bAIprIusCTKAUCrkHqauIsI6LuIB8cQtUG37uFKAC9PBi0UTMS O7/yLwFLR4scYvoae/3e4xJ8AGpnEVUvsWJLHsrAolUC4e++PLudqGpX3lYi2Ri0EDsj XN3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698230701; x=1698835501; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RnaK963hxwfVk8XsSeVFAewz/NSZrvVWgi/zhvvqbIQ=; b=D2j5W8kt/k24Z6FEc58bszYdcTVrWLGYdK8rIrXVUo4Uh9wjYmJ3TeBVxZucax+O8L DDY//cGsbJFprBMayFvZ30wMLdCE1CWZXoPEVaXsOxcFnvwiw/OmlyzWawq1ud9cAtCd ndZswE6tVO2gPXv3YzBs3bXu2GedID8ggv7sISF7d5qz/22ognihB0JOxLwvkgecDZ59 5U8iwmOQtBXe2egbC925ysYb377R4iZaynulTUAf6hctCsX05/yhzEHwJVo1TllMZiFX k42f/EXRVDbioEWg/yModJeH4zAeFiLTgjzDlcxz96gChPlyqFsPgcjqK8z3OcGr8C5q ZCNA== X-Gm-Message-State: AOJu0YxKChJc2rPfOqhx2r/1/rgCYReblRLwOB/hLsWRIqj94PrxUMNR 53m6JAdApdcoFyYhKPRLC6c= X-Google-Smtp-Source: AGHT+IGyY4iJniafG0vc/MzEsuH4vG/1+/GyQqBv+8LcWCzDCaT6FSGUJbeiCsvF3bbJ5WfbOTOFwA== X-Received: by 2002:a17:907:6d14:b0:9be:2963:5669 with SMTP id sa20-20020a1709076d1400b009be29635669mr10663773ejc.68.1698230700509; Wed, 25 Oct 2023 03:45:00 -0700 (PDT) Received: from fedora.. (dh207-97-46.xnet.hr. [88.207.97.46]) by smtp.googlemail.com with ESMTPSA id t11-20020a1709066bcb00b009be14e5cd54sm9626292ejs.57.2023.10.25.03.44.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 03:44:59 -0700 (PDT) From: Robert Marko To: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Cc: Robert Marko Subject: [PATCH 1/3] dt-bindings: clock: qcom: ipq6018: add USB GDSCs Date: Wed, 25 Oct 2023 12:44:09 +0200 Message-ID: <20231025104457.628109-1-robimarko@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add bindings for the USB GDSCs found in IPQ6018 GCC. Signed-off-by: Robert Marko --- include/dt-bindings/clock/qcom,gcc-ipq6018.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/dt-bindings/clock/qcom,gcc-ipq6018.h b/include/dt-bindings/clock/qcom,gcc-ipq6018.h index 6f4be3aa0acfc..bcd3823b74344 100644 --- a/include/dt-bindings/clock/qcom,gcc-ipq6018.h +++ b/include/dt-bindings/clock/qcom,gcc-ipq6018.h @@ -259,4 +259,7 @@ #define QDSS_STM_CLK_SRC 250 #define QDSS_TRACECLKIN_CLK_SRC 251 #define GCC_NSSNOC_ATB_CLK 252 + +#define USB0_GDSC 0 +#define USB1_GDSC 1 #endif From patchwork Wed Oct 25 10:44:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 737958 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5FA1C25B6F for ; Wed, 25 Oct 2023 10:45:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343588AbjJYKpL (ORCPT ); Wed, 25 Oct 2023 06:45:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234629AbjJYKpI (ORCPT ); Wed, 25 Oct 2023 06:45:08 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A203132; Wed, 25 Oct 2023 03:45:03 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-53f6ccea1eeso8544680a12.3; Wed, 25 Oct 2023 03:45:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698230702; x=1698835502; 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=6esSzcgffSka4qrRFDqhwYHqVtJjmpE8kipUoxPN9Z4=; b=hFEjF4nbPVd/18u1QyV+LGqIXrWWXrUxJHAgL6I9T9jmvnNWh37q/1Kr/aDTemHv9U yfiawR/Rq+lDV7xRa2ASf2vIKFAN28tqV73qvTigmDPw5IVwp9W1GIsUib2spmZZekcH Ihn/KGlOQwIWGRRusxvA4PIRBi6gVo0OyimhAOKGMU/BbcESBGrACl2zC1TSs070xOR5 rWPnum/+yGwBFDGqe6RiMxvoLQNgp5wsmH+NVpr9S9wkHA8NqIfBndlp78MNWkRmTzP4 iAkuHLvLYkggwaRAkd0h98U29vLf1j7yvFKgPj7t8bfjMytn+cQYCdnvHFfcta7Tz8Ki E0yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698230702; x=1698835502; 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=6esSzcgffSka4qrRFDqhwYHqVtJjmpE8kipUoxPN9Z4=; b=BgEWyX00WamPdniLPwLlqOMwSC9lrvaxOys55EixbQ7mZX0N5aPj19gywZBesF2PzN e4pIVOMuV/UsHBwTukoq5I4QlcWPZ1gXQU7geC7mEFNDlfnsma1LzdJMdOdAfigN0dB2 gX0znZxvcjD3I0qXuBIdjZPzy7ANq1kdtZCxor7ZBwv6GB4Q0ss1S7e/dKnTyE2NQPae d+zwCfwlgtDoGvW9znEFQk0Yhkj8r+iJsj2bPjJttv17nMDdvqAHrHpm7IwHPnUb3xJp RoTYCW4IQu+9EbpPE9cTjawqMlLG9/NmVWTT3zL14haYHESTe0W/TNa0DQ9A1Y64W4/e lH2g== X-Gm-Message-State: AOJu0YwQOGgYsJ5T0tZMHTtr5c1rx36C4MYbgJd6ijhPsqoCRaDPCxOE i3PxBFBFi5rk3eDSDanjrWA= X-Google-Smtp-Source: AGHT+IHlVSCIv2/e+AGd9vK/u4tmuy5rxvIBQ3v6CFdi9Vqs5/M/OB0Iws7GcCAwI+4bydHmrcRLgw== X-Received: by 2002:a17:907:6eaa:b0:9c4:b8c9:1bf4 with SMTP id sh42-20020a1709076eaa00b009c4b8c91bf4mr14206819ejc.19.1698230702080; Wed, 25 Oct 2023 03:45:02 -0700 (PDT) Received: from fedora.. (dh207-97-46.xnet.hr. [88.207.97.46]) by smtp.googlemail.com with ESMTPSA id t11-20020a1709066bcb00b009be14e5cd54sm9626292ejs.57.2023.10.25.03.45.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 03:45:01 -0700 (PDT) From: Robert Marko To: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Cc: Robert Marko Subject: [PATCH 2/3] clk: qcom: ipq6018: add USB GDSCs Date: Wed, 25 Oct 2023 12:44:10 +0200 Message-ID: <20231025104457.628109-2-robimarko@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231025104457.628109-1-robimarko@gmail.com> References: <20231025104457.628109-1-robimarko@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org IPQ6018 has GDSC-s for each of the USB ports, so lets define them as such and drop the curent code that is de-asserting the USB GDSC-s as part of the GCC probe. Signed-off-by: Robert Marko --- drivers/clk/qcom/Kconfig | 1 + drivers/clk/qcom/gcc-ipq6018.c | 33 ++++++++++++++++++++++++--------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig index ad1acd9b7426b..2aefa2231b51b 100644 --- a/drivers/clk/qcom/Kconfig +++ b/drivers/clk/qcom/Kconfig @@ -164,6 +164,7 @@ config IPQ_GCC_5332 config IPQ_GCC_6018 tristate "IPQ6018 Global Clock Controller" + select QCOM_GDSC help Support for global clock controller on ipq6018 devices. Say Y if you want to use peripheral devices such as UART, SPI, diff --git a/drivers/clk/qcom/gcc-ipq6018.c b/drivers/clk/qcom/gcc-ipq6018.c index cc20a16d8973c..9d5ee2ac012a1 100644 --- a/drivers/clk/qcom/gcc-ipq6018.c +++ b/drivers/clk/qcom/gcc-ipq6018.c @@ -23,6 +23,7 @@ #include "clk-alpha-pll.h" #include "clk-regmap-divider.h" #include "clk-regmap-mux.h" +#include "gdsc.h" #include "reset.h" enum { @@ -4691,6 +4692,22 @@ static struct clk_branch gcc_dcc_clk = { }, }; +static struct gdsc usb0_gdsc = { + .gdscr = 0x3e078, + .pd = { + .name = "usb0_gdsc", + }, + .pwrsts = PWRSTS_OFF_ON, +}; + +static struct gdsc usb1_gdsc = { + .gdscr = 0x3f078, + .pd = { + .name = "usb1_gdsc", + }, + .pwrsts = PWRSTS_OFF_ON, +}; + static const struct alpha_pll_config ubi32_pll_config = { .l = 0x3e, .alpha = 0x6667, @@ -5138,6 +5155,11 @@ static const struct qcom_reset_map gcc_ipq6018_resets[] = { [GCC_Q6_AXIM_ARES] = {0x59110, 4}, }; +static struct gdsc *gcc_ipq6018_gdscs[] = { + [USB0_GDSC] = &usb0_gdsc, + [USB1_GDSC] = &usb1_gdsc, +}; + static const struct of_device_id gcc_ipq6018_match_table[] = { { .compatible = "qcom,gcc-ipq6018" }, { } @@ -5160,6 +5182,8 @@ static const struct qcom_cc_desc gcc_ipq6018_desc = { .num_resets = ARRAY_SIZE(gcc_ipq6018_resets), .clk_hws = gcc_ipq6018_hws, .num_clk_hws = ARRAY_SIZE(gcc_ipq6018_hws), + .gdscs = gcc_ipq6018_gdscs, + .num_gdscs = ARRAY_SIZE(gcc_ipq6018_gdscs), }; static int gcc_ipq6018_probe(struct platform_device *pdev) @@ -5170,15 +5194,6 @@ static int gcc_ipq6018_probe(struct platform_device *pdev) if (IS_ERR(regmap)) return PTR_ERR(regmap); - /* Disable SW_COLLAPSE for USB0 GDSCR */ - regmap_update_bits(regmap, 0x3e078, BIT(0), 0x0); - /* Enable SW_OVERRIDE for USB0 GDSCR */ - regmap_update_bits(regmap, 0x3e078, BIT(2), BIT(2)); - /* Disable SW_COLLAPSE for USB1 GDSCR */ - regmap_update_bits(regmap, 0x3f078, BIT(0), 0x0); - /* Enable SW_OVERRIDE for USB1 GDSCR */ - regmap_update_bits(regmap, 0x3f078, BIT(2), BIT(2)); - /* SW Workaround for UBI Huyara PLL */ regmap_update_bits(regmap, 0x2501c, BIT(26), BIT(26)); From patchwork Wed Oct 25 10:44:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 738429 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B054EC25B6F for ; Wed, 25 Oct 2023 10:45:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343947AbjJYKpS (ORCPT ); Wed, 25 Oct 2023 06:45:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234823AbjJYKpJ (ORCPT ); Wed, 25 Oct 2023 06:45:09 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 569D2130; Wed, 25 Oct 2023 03:45:05 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-9becde9ea7bso157075466b.0; Wed, 25 Oct 2023 03:45:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698230703; x=1698835503; 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=b5Q/ILeNPwJV2QjahLVWKif6XkSVenjAn/qwU0ighgI=; b=TCeB9jmfs1mbxcE4FVTNTcSWsRrkn26YIpP/aaX0JaTb+qbjplZiRgncaL3MObP/Id e0xmWiapIHlB8kQ9O1DqJxGMBA5fFvV1oX39ipOAI5J9WtpPYD+jgXRDwEstq2ZH5pWJ kJXQaZzO2Dx/uv8XQ+wMjDoukpoYW8Dxw4W6KPAHhtqm0rHrU4vptsIUQzz5xX8KyVB6 vZ4AdHDquJT5YGSzsbtrarILRLqC5hgZ5VJjr0bssRgbcDLNN/qUKtkbeQp3RpizRaVd SYy3MZVFTtBtM3tl+ODZal9phcvDXRA3Bi9pVv3hUsfcN7gaFSeN/JK7opNGGmc9mXR/ U11g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698230703; x=1698835503; 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=b5Q/ILeNPwJV2QjahLVWKif6XkSVenjAn/qwU0ighgI=; b=fR/KHOW59I4ON2C2QygnU6r7UI2yTVuQt7LZ2QvFoCqlA6YHB7J/AzxHP83fpbh5sW 92V9Ma9IRyTo1LWNF7tlfdG8SmBByNA00a3RXGjCMnXHJmP8sTOhXtvTFH7RQ8pcTl4B gtzq8q0FvFkDV+1U0QEsNQrOlemDs7OuAwwRZ4YsbW0cbfuzGyZhafZTgjTg86i3rCdr 4+/44xsuKcJALPufyBbMQ4g8ckIpWIrEizRHDm7S6DxxziPTYk4NPpCrxXqdOzOUXEwG /hkvY54DOiFhwFtcpQZQ+R0g18EYpckvero8bxOYBc1H2tWQPNSaddzRM7B4rmgRqg2Y odkg== X-Gm-Message-State: AOJu0YwdWQhVCsNQEl7Ux2M6/8C/hlz/m2uMtoPZvz9QK/WDDw3VHimy K3fG+WRB6ZLfj0wOQqcpQFc= X-Google-Smtp-Source: AGHT+IHzKyCpvZWhaCMz6XJErxrbVu8BO1pTjJeTxOZVkEtgWaMQ1uDkJotO6VTnitq2RlPEvUYJQg== X-Received: by 2002:a17:907:7212:b0:9bd:d405:4e8a with SMTP id dr18-20020a170907721200b009bdd4054e8amr13626532ejc.17.1698230703511; Wed, 25 Oct 2023 03:45:03 -0700 (PDT) Received: from fedora.. (dh207-97-46.xnet.hr. [88.207.97.46]) by smtp.googlemail.com with ESMTPSA id t11-20020a1709066bcb00b009be14e5cd54sm9626292ejs.57.2023.10.25.03.45.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 03:45:02 -0700 (PDT) From: Robert Marko To: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Cc: Robert Marko Subject: [PATCH 3/3] arm64: dts: qcom: ipq6018: add USB power domains Date: Wed, 25 Oct 2023 12:44:11 +0200 Message-ID: <20231025104457.628109-3-robimarko@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231025104457.628109-1-robimarko@gmail.com> References: <20231025104457.628109-1-robimarko@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add USB power domains provided by GCC GDSCs. Add the required #power-domain-cells to the GCC as well. Signed-off-by: Robert Marko --- arch/arm64/boot/dts/qcom/ipq6018.dtsi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/ipq6018.dtsi b/arch/arm64/boot/dts/qcom/ipq6018.dtsi index 846cd73c7436b..720f1eeaf0443 100644 --- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi @@ -402,6 +402,7 @@ gcc: gcc@1800000 { clocks = <&xo>, <&sleep_clk>; clock-names = "xo", "sleep_clk"; #clock-cells = <1>; + #power-domain-cells = <1>; #reset-cells = <1>; }; @@ -433,6 +434,9 @@ usb2: usb@70f8800 { <&gcc GCC_USB1_MOCK_UTMI_CLK>; assigned-clock-rates = <133330000>, <24000000>; + + power-domains = <&gcc USB1_GDSC>; + resets = <&gcc GCC_USB1_BCR>; status = "disabled"; @@ -581,6 +585,8 @@ usb3: usb@8af8800 { <133330000>, <20000000>; + power-domains = <&gcc USB0_GDSC>; + resets = <&gcc GCC_USB0_BCR>; status = "disabled";