Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp122686lqa; Fri, 26 Apr 2024 17:11:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVvRRVUupdb7Hfo8y/F0CbV+/S142TmUG3NBuTMc5Q3sJNmiC4oRMPkSi93SYSoFz6WTv/Idp5aKbrPkQacDGPONfjwc6a9u1Dtd3swfA== X-Google-Smtp-Source: AGHT+IHRFo/5kC6XZlOfo1ecKCwZjGYKcywnjsh45UNkWOLRfN2DgRTDKQnfN2cmsfpJPpJOm+qB X-Received: by 2002:a05:6808:23c5:b0:3c6:d15:c3d9 with SMTP id bq5-20020a05680823c500b003c60d15c3d9mr5324650oib.34.1714176666905; Fri, 26 Apr 2024 17:11:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714176666; cv=pass; d=google.com; s=arc-20160816; b=ZUNtHnSZxbnP9ebQHCsWy5OImxfB9zVoi+owxbieeLqB2R+RrpwjyshJ0J5HFYVZTq K8P4PdxypPVt7X61c+J2qau2S5/2lYjuF3V5CJbT3zi6CVuSovyR5eKgKYsHDWdw0wfc O6gk8eVcMke8g5TEtu9oPGXoOsLDVcnjUcpVv9m4HDk5baalarCH7hU1OSKomyCaL0pH u5n4plJkrIu7tKsVXgo1zWACn7ESV8WjYWTJ7lIPOu5LidOAraG9JN0qg5pqOFcMokxK eb25HfDN9KDeWgrIw8gbBSRIvEH70opkDCtE+HsdfAqjaj8JqOp+DmKbA4Y2o8Pl5Ikg wBwQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=0X+wom0kXrBkkWPdMk9ez0NtFShVE5HcObxG7YQSUEM=; fh=EM7PQk6w5FBWV+9E7vXQ14viSOGh4kYKlBitWe58ppk=; b=rTX8uyGoYgPPon7ABnhF2ulvIgfvkUGQZvQMWhPhjW0jmbFDDnc1uYj5DPw0erRrWi STC0awuNcgkZOZhlFr7cWnQrSxgQmzaBJAPVMYBAPjM1Oz1CZ7nuQGjcpAqZYjrsK9mI OPaUC3YdNiS3v6FeD/9qk9Ny2qYKnY7U88mxhaX8iHRs+bHMCbE+o8sEUw6wERT1QfJV C1BURfYTrcy3Pw5vOfwxQ5FFoKABNUSzYuuJU14dRaXbb36Whr7KIw1VTJbx/UGhN8d8 TTVu2E7WLz6xKkPpUpgin9cYnh5kxtSOJEYwCKswRq9X7T0D6kLNh8Pm/Vqgb2Gco1T+ PZaA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tenstorrent.com header.s=google header.b="Cy8eTFD/"; arc=pass (i=1 spf=pass spfdomain=tenstorrent.com dkim=pass dkdomain=tenstorrent.com dmarc=pass fromdomain=tenstorrent.com); spf=pass (google.com: domain of linux-kernel+bounces-160803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160803-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tenstorrent.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id cz4-20020a05620a36c400b0078edf0afdecsi19974077qkb.78.2024.04.26.17.11.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 17:11:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@tenstorrent.com header.s=google header.b="Cy8eTFD/"; arc=pass (i=1 spf=pass spfdomain=tenstorrent.com dkim=pass dkdomain=tenstorrent.com dmarc=pass fromdomain=tenstorrent.com); spf=pass (google.com: domain of linux-kernel+bounces-160803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160803-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tenstorrent.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8F8321C229E5 for ; Sat, 27 Apr 2024 00:11:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC15C6FB2; Sat, 27 Apr 2024 00:10:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b="Cy8eTFD/" Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (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 798BF4C99 for ; Sat, 27 Apr 2024 00:10:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714176658; cv=none; b=EcnwZ3fE4SBVj7KTK6LF0H2LJA0+rcrY7LWCuwT3h6uLChntaRva6i4Gq6aQ0XGCuXqVc/8k6NBzeZ7Eqj0aJuQdn47Jt5DMyTe/qGKcpzZZn2viRYATvw17bJAhTzcsfdcRExB5De+uaJry2vjsaUMYZE0EDPN1hAHKA+XRUjc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714176658; c=relaxed/simple; bh=1J4s5WkWi0yLsfAU04plHcZTJmipLje1WXfb8fgGcxc=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=e/Iz91lFDzaaMDneNHgDAe3nK/kbruzLGbvKwA8zZ45OgreDji76aJwHraBS+uKZTI1drPj/6bjmqil+aLSvDHAQRoEl+pGfUBg6sbQrf44MYeI26vHmXHSqhTRjTQ5Tkusv7lZTl5O5vfb+4UdXsb/tZqYZmhue1WAyrwotBmQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=tenstorrent.com; spf=pass smtp.mailfrom=tenstorrent.com; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b=Cy8eTFD/; arc=none smtp.client-ip=209.85.210.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tenstorrent.com Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-6eff2be3b33so2628794b3a.2 for ; Fri, 26 Apr 2024 17:10:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1714176656; x=1714781456; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=0X+wom0kXrBkkWPdMk9ez0NtFShVE5HcObxG7YQSUEM=; b=Cy8eTFD/FEoAkS25A5xZLRFggXIjlGWkaYvwFPIs1Net4uSzDwvrNHxai53MuNxAil h7CJueS3uvs20mNK9nUZZC7ZJU2zqvUA83II2h14nZNRfIxYfOJF7C3s6XnY1nVobbr1 dgE92UCjwACYt+Zqj/UvTYrNGKJihqNkQEXZnCMDlQ+P35LPE/2euXMZkqPiKO62jErZ 9D+vTcUPMVaYBnJhINp5Cn/6rOYMRjzQ/hltDeKl09B3EjcPU1wNG2QsojLgV6pfiJF+ RohBdtbXeaFH6LA7yh+SxwCIj3PjY8tQWIDA/mK58lbjau0159mAYxp/aCM0CgvMbFCM D8vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714176656; x=1714781456; 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=0X+wom0kXrBkkWPdMk9ez0NtFShVE5HcObxG7YQSUEM=; b=vNiOQwSNTmEsNWIKdtJ6czcWw86jXHteNHg4ui6NPiSaGfW0bVmw5uupQkYjz9AZUn +lJSJAfbV9M2AA+HShGTXB7lbACDw3GTfZt5xWNSgvtUN7tR8k5Z+6N4PSgIPPvispQN ZS6M78K4eXwG6TMjZxADZgxHaNvBj3wCMTDurnMHjGR8fZ8kbOefcip06UUgQ8rAEVX3 ut9sNZz9QcbHydw4A1C0JgQF95/ZUTJfVwFbJpjbAQG9rOjseJV+wqjy54wrH51KH1H4 FFgy7M58G5uqt9BCqkcWmloulCEhvaS18LMjitbrbatL1efpsnsLx04H45Py4WyFHP1r 6j/A== X-Forwarded-Encrypted: i=1; AJvYcCX4uKwO/t7+lgrf5khoO/pE4EuFqYbK3ZfTMErW1kKd2ITXf+zov6aN5C9R8X+a/oplG2AdEy+s8sQdjDRykLy8VsxYJ/8t1T7RqJOv X-Gm-Message-State: AOJu0YyG1fCmyca7NmZWLxaJ+67j12MyVSE2bm7icGBsKBsI//TTEFGJ tp0l433miBWLwq6VtgrLKzSzYq5rzPyU5Krq8LyOHi/DiZcA6bv+GEoOU9Gu71I= X-Received: by 2002:a05:6a20:d80a:b0:1ad:22bd:d6d8 with SMTP id iv10-20020a056a20d80a00b001ad22bdd6d8mr6019864pzb.4.1714176655738; Fri, 26 Apr 2024 17:10:55 -0700 (PDT) Received: from [127.0.1.1] ([2601:1c2:1802:170:3569:7ce4:94b8:1691]) by smtp.gmail.com with ESMTPSA id w1-20020a6556c1000000b005f3d54c0a57sm6061883pgs.49.2024.04.26.17.10.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 17:10:55 -0700 (PDT) From: Drew Fustini Subject: [PATCH RFC v2 0/4] clk: thead: Add support for TH1520 AP_SUBSYS clock controller Date: Fri, 26 Apr 2024 17:10:33 -0700 Message-Id: <20240426-th1520-clk-v2-v2-0-96b829e6fcee@tenstorrent.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAHlCLGYC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyjHQUlJIzE vPSU3UzU4B8JSMDIxMDEyMz3ZIMQ1MjA93knGzdMiNdQ2OTpLRky6SUlCRDJaCegqLUtMwKsHn RSkFuzkqxtbUA48+/pmQAAAA= To: Jisheng Zhang , Guo Ren , Fu Wei , Yangtao Li , Thomas Bonnefille , Emil Renner Berthing , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Drew Fustini , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1714176654; l=3100; i=dfustini@tenstorrent.com; s=20230430; h=from:subject:message-id; bh=1J4s5WkWi0yLsfAU04plHcZTJmipLje1WXfb8fgGcxc=; b=16J/aGmQTihk3ouk4xY9w2E0cZ7vJ10E2613HxJBuwgVbWNSdlKeA297VRG2X2bxYYqhOPTFB RTLq0s2TI/CAKc6fCIJa2p7mV/aGGNK+RMCY6OK3Lv3pbwdj8KTczZC X-Developer-Key: i=dfustini@tenstorrent.com; a=ed25519; pk=p3GKE9XFmjhwAayAHG4U108yag7V8xQVd4zJLdW0g7g= This series adds support for the AP sub-system clock controller in the T-Head TH1520 [1]. Yangtao Li originally submitted this series in May 2023 [2]. Jisheng made additional improvements and then passed on the work in progress to me. Changes I made from the original series: - corrected the npu_clk enable bit - deduplicated CLK_NPU and CLK_NPU_AXI number in header - fixed c910_i0_clk reg typo - fixed checkpatch and dt_binding_check warnings - rebased on v6.9-rc5 - revised commit descriptions Changes since my RFC v1 [4]: - squash the header file patch into the DT schema patch - describe the changes I made to original series in the cover letter instead of the individual patches - fix my typo in my email address TODO: I am again marking this as an RFC because there is feedback from v1 that I have not yet addressed. I am posting what I currently have as other patch series like the TH1520 I2C driver [4] could use the clk driver. Emil commented that the input predivider is not handled correctly in ccu_mdiv_recalc_rate(). The PLL multiplies the input frequency and outputs "Foutvco". This is followed by a post divider to produce "Foutpostdiv". However, some clocks derive directly from the "Foutvco" Emil suggested this should really be modeled as two different clocks. Emil aslo suggested that the rest of the clocks in this driver seem to be generic gate and mux implementations that should probably be replaced with devm_clk_hw_register_gate*() and devm_clk_hw_register_mux*(). I'll look to address the above issues in the next revision. Thank you, Drew [1] https://openbeagle.org/beaglev-ahead/beaglev-ahead/-/blob/main/docs/TH1520%20System%20User%20Manual.pdf [2] https://lore.kernel.org/linux-riscv/20230515054402.27633-1-frank.li@vivo.com/ [3] https://lore.kernel.org/lkml/20240110-clk-th1520-v1-0-8b0682567984@tenstorrent.com/ [4] https://lore.kernel.org/linux-riscv/20240425082138.374445-1-thomas.bonnefille@bootlin.com/ --- Drew Fustini (4): dt-bindings: clock: Document T-Head TH1520 AP_SUBSYS controller clk: thead: Add support for T-Head TH1520 AP_SUBSYS clocks riscv: dts: thead: Add TH1520 AP_SUBSYS clock controller riscv: dts: thead: Add clock to TH1520 mmc controllers .../bindings/clock/thead,th1520-clk-ap.yaml | 65 ++ MAINTAINERS | 3 + arch/riscv/boot/dts/thead/th1520.dtsi | 15 +- drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 1 + drivers/clk/thead/Kconfig | 12 + drivers/clk/thead/Makefile | 2 + drivers/clk/thead/clk-th1520-ap.c | 1018 ++++++++++++++++++++ include/dt-bindings/clock/thead,th1520-clk-ap.h | 96 ++ 9 files changed, 1210 insertions(+), 3 deletions(-) --- base-commit: 14396a29c3cfbd42b4ea5cd0a528264831524062 change-id: 20240426-th1520-clk-v2-134bfc9bddb1 Best regards, -- Drew Fustini