From patchwork Tue Oct 24 20:23:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 737570 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp2223469wrl; Tue, 24 Oct 2023 13:24:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEhToMilUY7KZvFRoi4IpztVbciL5suwW3q9Kucbc8Ja6nO/Huvw0raIU/CthqNHXKbVXeo X-Received: by 2002:adf:f711:0:b0:32c:eeee:d438 with SMTP id r17-20020adff711000000b0032ceeeed438mr10100196wrp.54.1698179042979; Tue, 24 Oct 2023 13:24:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698179042; cv=none; d=google.com; s=arc-20160816; b=RYzhkG/L8g3y6v4jNUkwdFwLaKRdcl/Q/GsUMSB8eB/EYtmQkHMtPgB1x9kIBKnDQj oOvzhvUK4o2/Xtt/hHk8Z68mFij0JhZ/tFPhdoiI+VQbeUs8Zqn4ey+HHlhtejMLTT0u re40LAGMTRQkSKaY8hlBkFC88Xxy6bnEmeDzQcePXdiQlaGj5bwIxj9Fch9FLgixR51V KWI+MCO5zuHyk7mdjK1F75d6DLogWnjDTUqfNro4nywiwW4d0kxW20OH6I8RqaGCfP1X K8wzZyeGSNM72s47chlumnMlJdDfWsSY5/PkRJA+lOFaVURYj6fie9tmZUGXSGHz4VwD q8zg== 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:cc:to:content-transfer-encoding :mime-version:message-id:date:subject:from:dkim-signature; bh=TCx6NtzmhP/eTO4TNNF0Blgk0MWpoVcnedzdp1BHsAg=; fh=3C8fioRQpWRLZcrzakoHsmtvwM1zU4p3z5g8HhUXsEw=; b=DD4ZPQgPTENaQYPZE8V2Xpwr1zEBQ2oGI79ZFF7L5Jl+zoMilrd96V38gaVaeJq+IL WlzqRkTxCShGXLoC9SCESCZ3UfvuN66S2+pmq5L47xiiuj32Mh7rU3lAq1i6kqBhotYg Cu2FUA4XTYVQC1KJCW505aui84mTi3zg2Asv9vuBF08mqxmipL2yhQMNdiQz/XedeoTh /ueUDFbuYuBq4i2ukLwy5t+mI+1lK/1f+iKihPcZDKSZGGk5gtaxptLP341nsSuhiDJH pB6H5qWYAd9bXNq3aVr5/6OU85xyGIq/hVntvuagXHjbn2iV9mGazF3KM/PNua1gygUa TlUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ggVztX66; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id h7-20020adf9cc7000000b00317752a13besi6516936wre.408.2023.10.24.13.24.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 13:24:02 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ggVztX66; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 B9903879BE; Tue, 24 Oct 2023 22:24:00 +0200 (CEST) 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="ggVztX66"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DAC3F8716E; Tue, 24 Oct 2023 22:23:58 +0200 (CEST) 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 autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (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 8123A874A9 for ; Tue, 24 Oct 2023 22:23:56 +0200 (CEST) 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-x32b.google.com with SMTP id 5b1f17b1804b1-40842752c6eso38925705e9.1 for ; Tue, 24 Oct 2023 13:23:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698179036; x=1698783836; darn=lists.denx.de; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=TCx6NtzmhP/eTO4TNNF0Blgk0MWpoVcnedzdp1BHsAg=; b=ggVztX662UTYYwCUwS/HC4F2+8it3fdAZ+J0ESMbsOxBUF0t+AJ+Z9NCFmC8lyk1z3 BN3+KY82Y1p7+1TKe6zO20zmZwgGR/5Swj61pQ6G7nmLOeNOWFBNDnVMpafDeHfAcxI+ A/O295HTP4Zz6Okht/NsavTNuejywYWH1IPPXdbqKBfDspEZm4/F9Sb9svVElhTD6W0i J7wS6W7+NKKvjHp5CR+TOtwacZUBmv0XjKEps4H7TfejZAae3u1S/b+AYeeSJhd5zkl7 Cm0X6XjM+27LeolQW5QY2P5hsY3qm0QqenUdy0iu3sDV/SVj6doSh3c0tF+FJqGSHOlY mLmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698179036; x=1698783836; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TCx6NtzmhP/eTO4TNNF0Blgk0MWpoVcnedzdp1BHsAg=; b=YTi0aCuLuyINHbL5OIi4Ju6CtsNF6dozBIJEXFialLhzZfax7EsvK0/pKpV3otK5NR Id4HkZSsHl1x3lV2pJHiUieVujjMMHoaIVQOGKp3KU/Cj3mwiuxJw71Nrm723mThDvQ9 myuMPgyBIoFwBp29jIRDyZ/jM3wbGbFPjBlvbxcQUe9m06UFZxI0a+N5TjaO2fJdSf+F oK63blHLrQx54NDTy7UdacrtdMwqbPZVNfVVxupORq3jJa5RQCvT2tOqTCMP7h2zk4DW UeaW4E4Ot2KXWTgz6R5L+efipF9goLifiiZ2BfT5VN2WStjmXMzlO9nJHphzDoXUAJXw Z/BA== X-Gm-Message-State: AOJu0YyChEH1Iwfd421D36lNibY0if5Lbws7ZlsZ2VwoIbqz7tyiW2Wz 6YhDxw9V2LB/o56QPILkeT4+Ug== X-Received: by 2002:a5d:518f:0:b0:32d:ad4a:bced with SMTP id k15-20020a5d518f000000b0032dad4abcedmr9418576wrv.23.1698179035865; Tue, 24 Oct 2023 13:23:55 -0700 (PDT) Received: from lion.localdomain (host-2-99-112-229.as13285.net. [2.99.112.229]) by smtp.gmail.com with ESMTPSA id l21-20020a056000023500b003198a9d758dsm10682342wrz.78.2023.10.24.13.23.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 13:23:55 -0700 (PDT) From: Caleb Connolly Subject: [PATCH 0/8] arm: mach-snapdragon: Qualcomm clock driver cleanup Date: Tue, 24 Oct 2023 21:23:51 +0100 Message-Id: <20231024-b4-qcom-clk-v1-0-9d96359b9a82@linaro.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIANcnOGUC/x2NQQrCMBAAv1L27GISQ61+RTwkcdMu2kR3RYTSv 5t6HIZhFlASJoVzt4DQh5VraWB3HaQplJGQb43BGXewxnmMHl+pzpged8z2mAffu+FkemhFDEo YJZQ0bU0VHrns56Bvks0/hTJ//7fLdV1/EmzzW30AAAA= To: Ramon Fried , Lukasz Majewski , Sean Anderson , Bharat Gooty , Rayagonda Kokatanur , Robert Marko , Bhupesh Sharma , Luka Kovacic , Luka Perkov Cc: Vladimir Zapolskiy , u-boot@lists.denx.de, Caleb Connolly , Konrad Dybcio X-Mailer: b4 0.13-dev-46309 X-Developer-Signature: v=1; a=openpgp-sha256; l=3560; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=f7R0n3TGEem50i/dIlpSVjvmIzmu2lc2qcjDhmhkecU=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhlQL9ZvZHPN+TH0b9fG+7uJfV5Z/j5q95v3tcNerrD9XV BZ/tj6zs6OUhUGQg0FWTJFF/MQyy6a1l+01ti+4ADOHlQlkCAMXpwBMhP8Mwz+jwLSlh+Z57y7Y rZs1//+RzfEZaTc2OR+QEXzSddVERuoUw/9w3YcRB2YzpSaI/9u1fc3D9L+vXt6YIeXmEm+2c2o zm2gaAA== X-Developer-Key: i=caleb.connolly@linaro.org; a=openpgp; fpr=83B24DA7FE145076BC38BB250CD904EB673A7C47 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 This series begins making some headway towards cleaning up Qualcomm platform support in u-boot. The following is a rough overview of the changes: * Move the Qualcomm clock drivers out of mach-snapdragon and into clk/qcom * Introduce per-platform clock driver configs to decouple Qualcomm platform support from mach-snapdragon targets. * Add the IPQ4019 clock driver, removing it from mach-ipq40xx and introducing the reset map. * Merge the qcom reset driver is into clk/qcom and rework it to be compatible with upstream devicetrees. * A callback model is added so that multiple clock drivers can be compiled in at once. * SDM845 gains support for enabling/disabling all gate clocks (CBC's) by way of a new "gate_clk" abstraction. * Preperatory cleanup work is done to simplify the bringup process for new platforms. Further details are included in each commit. The primary goal of this series is to prepare for enabling several new Qualcomm platforms in u-boot as well as additional peripherals, while minimising the amount of copy/pasted board-specific code. This series conflicts with a previous series introducing support for the Qualcomm RB2 board [1], I plan to resend this initial support pending acceptance of this series and several other cleanups. [1]: https://lore.kernel.org/u-boot/20230324080418.3856409-1-bhupesh.sharma@linaro.org/ --- Caleb Connolly (7): clk/qcom: move from mach-snapdragon clk/qcom: add per-platform configs clk/qcom: move ipq4019 driver from mach-ipq40xx clk/qcom: sdm845: add register map for simple gate clocks clk/qcom: use function pointers for enable and set_rate clk/qcom: add mnd_width to clk_rcg_set_rate_mnd() clk/qcom: fix rcg divider value Konrad Dybcio (1): clk/qcom: handle resets and clocks in one device arch/arm/Kconfig | 2 + arch/arm/dts/qcom-ipq4019.dtsi | 14 +- arch/arm/dts/qcs404-evb.dts | 19 +- arch/arm/mach-ipq40xx/Makefile | 1 - arch/arm/mach-ipq40xx/clock-ipq4019.c | 88 ------ arch/arm/mach-snapdragon/Kconfig | 4 + arch/arm/mach-snapdragon/Makefile | 5 - arch/arm/mach-snapdragon/clock-sdm845.c | 98 ------- arch/arm/mach-snapdragon/clock-snapdragon.c | 181 ------------ arch/arm/mach-snapdragon/clock-snapdragon.h | 48 ---- .../mach-snapdragon/include/mach/sysmap-sdm845.h | 3 + drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 1 + drivers/clk/qcom/Kconfig | 52 ++++ drivers/clk/qcom/Makefile | 10 + .../clk/qcom}/clock-apq8016.c | 41 ++- .../clk/qcom}/clock-apq8096.c | 41 ++- .../reset-qcom.c => clk/qcom/clock-ipq4019.c} | 165 ++++------- drivers/clk/qcom/clock-qcom.c | 303 +++++++++++++++++++++ drivers/clk/qcom/clock-qcom.h | 96 +++++++ .../clk/qcom}/clock-qcs404.c | 97 +++++-- drivers/clk/qcom/clock-sdm845.c | 265 ++++++++++++++++++ drivers/reset/Kconfig | 7 - drivers/reset/Makefile | 1 - 24 files changed, 938 insertions(+), 605 deletions(-) --- base-commit: 30d01b582f2274eb8c808026c5fb4c33e9f2210d // Caleb (they/them)