From patchwork Fri Mar 1 15:00:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 777046 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1404720wrn; Fri, 1 Mar 2024 07:07:21 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWXYDQB0sUTNgjRTyaffC7PGS6A7aBt3PiLX/bM2c/Yg++iHMb6JsVGmkeqVA2jHU8LYMP3soHy4hCmCM3quFU8 X-Google-Smtp-Source: AGHT+IFb4nt2dyXhWuz6XO+JZ0NEc3RTJUKSptq8/34pYnJTN6zgGOPthyKeNSxczE6mONjFF0DS X-Received: by 2002:adf:b610:0:b0:33d:754c:70fc with SMTP id f16-20020adfb610000000b0033d754c70fcmr2501548wre.14.1709305641237; Fri, 01 Mar 2024 07:07:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709305641; cv=none; d=google.com; s=arc-20160816; b=JNxjM+/SPSjMPMoX068jvXvXolTxsxVHpbmnPgRuidK1tSnc8YcAte9jUFt8Sat16y J20TnfrPP1qR/yqHq1h2ktVuNZr96TxFj9WqJ/MdNiqmQOeY9AzxyIUUnX8p5oiyESaG AimK1TlpHVXIlfIBNNCuw1mHhdbP31G0R/Cw++MEkEGIJRgT6LeB6V78xRsfV97vc731 U9sO7V5CjP6y6zXohQx3aPexMbr57CwgfXJfwUJ2udcYnoZnjHBQ3xLIC3OCvbPRDlrD ckYHGx1/KhFK/CCxi5G39WoT44q4ZPaJTEhpkajsTq9SLdjiQ6RVitz05aZOTyOFFbRq evcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=UorTf1gyoKpk6eLMIM9vRw1AESuTeaYz0UGhxwG9BDY=; fh=1Tg2bjjNWPzTxBRya94nTPNBJJAwT1IykjRiokOE2BE=; b=yh4O8KdIRLnr5T4bna+CkkI4QE6sr/QHrRjs9MIB1mzN5Y9DAXvrbKdiLkc+cGQKQJ bzdGOfjvKzvnDCDBBQk/myx75AsZKi4qrpU7/PGrta4A57rqWTG+6EfsfK8D7EcXRx8/ //hWNZeX1v0aOqKEAAEOPjeKDmVWrcH9XV8MSKDqeCO3ns1CXwcixQD93eRcnclkG+qM /rIASQUUHPlagQPMAv6UTg/iyf+YtTpGTzlIPiACIRIRJLLUzJf20/oa6ITZSOYQLL8C sqnuLpdOFP18RTfWU8GjEHSpXXpi37R3+qVvSzWeLxAH8MsXQYa454Nu/VxVIVzqkbVY 1aGg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GUUkwFkA; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id t1-20020adfd001000000b0033df5238937si2255198wrh.125.2024.03.01.07.07.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 07:07:21 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GUUkwFkA; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BE71B87D31; Fri, 1 Mar 2024 16:07:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="GUUkwFkA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 04C7687D06; Fri, 1 Mar 2024 16:07:18 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BB26F87DED for ; Fri, 1 Mar 2024 16:07:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-412ce4f62d9so737315e9.1 for ; Fri, 01 Mar 2024 07:07:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709305634; x=1709910434; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=UorTf1gyoKpk6eLMIM9vRw1AESuTeaYz0UGhxwG9BDY=; b=GUUkwFkAZWO0KXWW2MEawRQCWHpRp9D/XRLmAmeWq/8GtlwqMwO7bzHwQ0wdFT5Pe/ UYWHhfizOBRGBLCLUi/6CvXabe1N0BvIJpkeAoc91OaZ/qMjiJ2YcSnDzN5qnJJ7RWZp QO2mwCd5ccqQs3zSUa88He4K3iBbHk76t4Tp179EZJxq2sPGamqmB2yJNPdV4F60iGUn AzvWZPJgl4qlDbGQSZO2q+pG1vkev9vAXEG9u2ql3V3VqROqK2/3iMd/pF7SeTyDfVtJ T/AT3pwMzOmjy+UVV6sdGqiwi5qB6UrLwJi/0g8TZrouwOm2iRwObswpwjplcDEMjcxS ts4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709305634; x=1709910434; 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=UorTf1gyoKpk6eLMIM9vRw1AESuTeaYz0UGhxwG9BDY=; b=rtdpycP/EPQPgGrf+8YGY+tqnObYWliKZihlMlTpWja62Lc8F1UFpWhMCc2Em3W27E 0D5xvC1YYqmMofZ2Eu3nAp2l+nZ7RGdFJHTm/xvrl3mqvonOQEbdsnum33rXofv9YpYk Anntake+ylC9ooD9bWrJfJRq8Hw4R1vOBhpt4/k0y4kZOLMqGFDLLzZz6iUT3EiRS3FQ JvRnSiOnMhSYo+NVlLpzcduCy0SwdBl7CHC/oW4dvK2+zhRqQ8xRKKPv+uK892C+P/D5 ShlrF1zlikN8h7MuSgdxYEtFookxJHNrQVJ6u/QGCgH2Sv9t+fARDsCsDZ/FdJMhI+ZM 5Cfw== X-Gm-Message-State: AOJu0Yzbns2vAVM92big7HI1K+bK4mTN36RmetEY7YgWOxAm4s8stGQV O+vjXYRjrzoJOiO9CCyBrsIvrPdN6qBYEyenbhyziShu0csJOFQBecMNLy3gQcY= X-Received: by 2002:a05:600c:1d8d:b0:412:a436:e5d2 with SMTP id p13-20020a05600c1d8d00b00412a436e5d2mr1672886wms.9.1709305634100; Fri, 01 Mar 2024 07:07:14 -0800 (PST) Received: from lion.caleb.rex.connolly.tech (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id z9-20020a05600c114900b00410bca333b7sm8601636wmz.27.2024.03.01.07.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 07:07:13 -0800 (PST) From: Caleb Connolly To: Tom Rini , Neil Armstrong , Sumit Garg , Lukasz Majewski , Sean Anderson Cc: u-boot@lists.denx.de, Caleb Connolly Subject: [PATCH] clk/qcom: apq8016: allow apq8016_clk_init_uart() to be called externally Date: Fri, 1 Mar 2024 15:00:24 +0000 Message-ID: <20240301150651.4181574-1-caleb.connolly@linaro.org> X-Mailer: git-send-email 2.43.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean When U-Boot as running as the first stage bootloader on MSM8916 devices, early debug UART requires turning on the clocks (for some reason the pre-loader turns them off?!). To simplify developing for this platform, allow the apq8016_clk_init_uart() function to be called externally. Developers can call this from the serial_msm debug uart driver to configure the clocks before the driver model is available. As it is only possible to enable early debug UART in custom builds of U-Boot, this solution at least gives developers the option. Signed-off-by: Caleb Connolly --- This patch was meant to be in v5 of my Qualcomm generic board support series[1], but got lost somewhere in the mix. [1]: https://lore.kernel.org/u-boot/CAFA6WYNXE3x8sKRB8BBpODCfXbZeeVpKPu0-qt7ezsY-R7unQQ@mail.gmail.com/ --- drivers/clk/qcom/clock-apq8016.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/clk/qcom/clock-apq8016.c b/drivers/clk/qcom/clock-apq8016.c index 9de0ad5ed32d..e6647f7c41dd 100644 --- a/drivers/clk/qcom/clock-apq8016.c +++ b/drivers/clk/qcom/clock-apq8016.c @@ -102,22 +102,22 @@ static const struct bcr_regs uart2_regs = { .D = BLSP1_UART2_APPS_D, }; /* UART: 115200 */ -static int clk_init_uart(struct msm_clk_priv *priv) +int apq8016_clk_init_uart(phys_addr_t base) { /* Enable AHB clock */ - clk_enable_vote_clk(priv->base, &gcc_blsp1_ahb_clk); + clk_enable_vote_clk(base, &gcc_blsp1_ahb_clk); /* 7372800 uart block clock @ GPLL0 */ - clk_rcg_set_rate_mnd(priv->base, &uart2_regs, 1, 144, 15625, + clk_rcg_set_rate_mnd(base, &uart2_regs, 1, 144, 15625, CFG_CLK_SRC_GPLL0, 16); /* Vote for gpll0 clock */ - clk_enable_gpll0(priv->base, &gpll0_vote_clk); + clk_enable_gpll0(base, &gpll0_vote_clk); /* Enable core clk */ - clk_enable_cbc(priv->base + BLSP1_UART2_APPS_CBCR); + clk_enable_cbc(base + BLSP1_UART2_APPS_CBCR); return 0; } @@ -132,9 +132,9 @@ static ulong apq8016_clk_set_rate(struct clk *clk, ulong rate) case GCC_SDCC2_APPS_CLK: /* SDC2 */ return clk_init_sdc(priv, 1, rate); break; case GCC_BLSP1_UART2_APPS_CLK: /* UART2 */ - return clk_init_uart(priv); + return apq8016_clk_init_uart(priv->base); break; default: return 0; }