Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1622780lqs; Sat, 15 Jun 2024 18:55:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX9vlzolP9g41dwA0MeXsZUcrvJxc2YDWmlK167T4f6RxRVR7zrMFuG3tBqwCYSyyb+9IKs2d3ZxJPa/tOqSmMrlfy8X0+9nzNg5B9O5w== X-Google-Smtp-Source: AGHT+IHZYPAUHR5L8KuvxwBa5yWrbxxRqg/rHT7aOdofuhnV3RvAf5TSfoxvL+zbI02XDfoGZqwH X-Received: by 2002:a17:903:41d1:b0:1f7:21fd:aba3 with SMTP id d9443c01a7336-1f8626d1a16mr64269275ad.34.1718502947142; Sat, 15 Jun 2024 18:55:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718502947; cv=pass; d=google.com; s=arc-20160816; b=fwLKnqsa8y6GjiSm3dKoNrHGVvip0pCkAEky81Dq30qgfSpKy8xCTY06mFuJ6hxp1V Jb+F+eTeyFs3YvHSUOmk5P7tSgsvlYl1orW5RNuZLGu39gsGDHR7jUNWoL3fXnl2lSyP Wuw03LPGl/aENw5FcBoaqYiNWERomtQCAh5hhGKtzI5xAcvlCthjR3Ql+mjNRd0IoNsC +ArFsErUygrGBab50vdwzMYZnuODHT0uHwc/NTdM36H7hiQqGAltovHXIdUB7FbmtP23 qXxM5RAdk/nIf8n8N2uMEQAS3pMo45HmB4JtGeLg4Up7kObaKzpvsR03twJLHofbKNY1 b5yw== 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=vvNH5iGqBZh76l6k5VqaC65fZKHfbumS1HMa6kMl+Ww=; fh=LLPInIklgwrjrtxIOmYFteSHb0KUSXAzYWnu1/+vpS0=; b=w0iKNdv5Vm7rZTzdAQtQ9vK8Hqwdu0qU72TqRQRIjx26TVLIvB0d+cwbbCP6KqiPbI em1nq7Ph5uHcFI3jLA1DV2WSN3hL/7CsloXfOwGvtJnO73CGEVJ/zlZkyM4nvQ+iW0xi 8DLrirHS1jvWF06lHB0m25JvYE9iNldizhomCH6Q/Uf3GAvndLyfifYyuLxaOLzvy/VA gqnjoU5p/XnI0RjXre6A6NrPcF6pLbRmvlwKLJvcESf6qUp2M6FQqSQBl1z/X/4eijeC +tmUSYzkEUyOKX0dBLkEUKIA2PE3dRpJd0EyDty6SAVHEIS8ubMfIhISTMKWQDKtFD96 E+ng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tenstorrent.com header.s=google header.b=C3BWyRuc; 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-216082-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-216082-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tenstorrent.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f855efe122si65762525ad.468.2024.06.15.18.55.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jun 2024 18:55:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-216082-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@tenstorrent.com header.s=google header.b=C3BWyRuc; 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-216082-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-216082-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 576ECB217C9 for ; Sun, 16 Jun 2024 01:55:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BEAD21667D0; Sun, 16 Jun 2024 01:55:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b="C3BWyRuc" Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) (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 104C026288 for ; Sun, 16 Jun 2024 01:55:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718502924; cv=none; b=LtD9Limnt6EabvHnt3jjVjbtzOAK9Af0Ltc1tePTElG/Hp9qsWTuNJRri2GRrSjdpNDF7OKWcv2y15BqdB/KulEFGxrMxiv1U/PVRyO6SCedw5vacl1+LtghGBOOYgVQ8LsaN/f2+CUf92mO0fN5zEMkv/hGLHQy1c+bsEtPnCA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718502924; c=relaxed/simple; bh=oiQ2U4RKb1Iv2Gx0d/RSo2VuGdZEH1NgOZ9G/UGU3Zs=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=hPTMLvU/QCLTVJvtA/QiENgwKKa4fuqtVKWtUiRV2jSQOrVCWb0+j2nA8P1p0uMFrnf4VkU9QkMjGHQ7bEbeRIvOgw3Y6txjfaBhd7RD1Onv7dPMkAdrxwggDv/TgO4akNVEyc1RMs3PrpDAYF9PUClu7+IeLbi0OCUc3iDEys0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=C3BWyRuc; arc=none smtp.client-ip=209.85.215.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tenstorrent.com Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-6e7e23b42c3so2197560a12.1 for ; Sat, 15 Jun 2024 18:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1718502920; x=1719107720; 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=vvNH5iGqBZh76l6k5VqaC65fZKHfbumS1HMa6kMl+Ww=; b=C3BWyRucrGFtMrqAXJAkYaqg/nDxuoH6VfunhmOc0wqLfcXmMOp2i3FmK8fUMOE84S Q2mptahdtlnnY7PT0VqBydlJ4hAMCB4vMyFkuLx808K/cId0GnI0jqY+kqYvddY1FV/7 BEjMF8N5YM0M6M9n3VsADUqBGQaxWPX3uBaW0NxsgQ3cJ4Dk9Hlptx2uNLoj4sChql2i KgGg2Tuv6OPPqLcpWAkT62x+eu9fchr4tvU7x5fcfEznTKiK/WFYXqz08vzh1knyF1jb mdud0JjuV39Ve6pnDYaS1tdcJheC4l+m/FKipkBJWQsMTY9Fp/AnN4+gEHAbdkiF2VLY SAHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718502920; x=1719107720; 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=vvNH5iGqBZh76l6k5VqaC65fZKHfbumS1HMa6kMl+Ww=; b=BVshZIg0ksSKJaMUSJ/x4imZL0lJxpo2pSmXAwhSbC4D9wRMK/OwqRiRk1aomituua +nyeOO+rdIFEtJEdr2VC/X/3onAv4f7w9QKti/OHG4uA/Hx5f9KMeTO1DVSs3Q/U5W1n 9LkwZRb95SlX9cuhWvUvoalEUwf26M6fG9x/L2dG96lHjG4Dd+8Wld6sPWOWJuHXFTe3 eSTtopO0c6K5+L+e3QgETKDRKZD9U6ZplsSai71OhXacxMuXhxYZxlRwe012ImCJiVau ByTLv2vqdhG/yLjkf5Zzh9pb6v+ddfj5AU2Q9JqdO99y1EBDiJpse4yztSZuxhh3r5R+ KwVQ== X-Forwarded-Encrypted: i=1; AJvYcCWGfUtU3Zs3lBJMa7+NS6m7ic1hG/sho+b1wGS7Iuvtd8+x8mZvxB11LR1MdrQxcqGyUQi8HCl5qLsjuCtw+Txd5+E8tzbo+2q7yw8t X-Gm-Message-State: AOJu0YwXHNiaQnJb8UUCnRyccDUie59d83dR6iXLlmZeVR33J/YjLMnl s7To7e3jMIcdiMOxMdyC81dL41D9MKkdM2d16CgMKA9PuAVI6pVYNDSXemW5xIM= X-Received: by 2002:a05:6a20:6a0d:b0:1b6:15b2:822 with SMTP id adf61e73a8af0-1bae7f01befmr6559414637.27.1718502920190; Sat, 15 Jun 2024 18:55:20 -0700 (PDT) Received: from [127.0.1.1] ([2601:1c2:1802:170:1cea:28dd:2ee0:e8e5]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c4a769aedbsm8751201a91.43.2024.06.15.18.55.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jun 2024 18:55:19 -0700 (PDT) From: Drew Fustini Subject: [PATCH 0/6] clk: thead: Add support for TH1520 AP_SUBSYS clock controller Date: Sat, 15 Jun 2024 18:54:29 -0700 Message-Id: <20240615-th1520-clk-v1-0-3ba4978c4d6b@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=H4sIANVFbmYC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxMDM0MT3ZIMQ1MjA93knGzd5BRTC9NEC1ODFLNkJaCGgqLUtMwKsGHRsbW 1AF6JvIFcAAAA To: Jisheng Zhang , Guo Ren , Fu Wei , Yangtao Li , Thomas Bonnefille , Emil Renner Berthing , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , 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, Drew Fustini X-Mailer: b4 0.12.3 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 in v1: - Split th1520_clks into groups for gate, mux, div, pll - Convert gate clocks to devm_clk_hw_register_gate_parent_data() - Convert mux clocks to devm_clk_hw_register_mux_parent_data_table() - Split the PLL recalculation into th1520_pll_vco_recalc_rate() and th1520_pll_postdiv_recalc_rate(). Based on Emil's comments in v1, add logic to handle the fractional portion of feedback divide value when the delta-sigma modulator (DSM) is active. - Drop clock-names from the binding per Stephan to avoid relying on anything other than the cell index when describing clk_parent_data (note: I dropped Rob's Rb because I changed the binding patch) - Rename reg/reg2 to cfg0/cfg1 to match the SoC documentation - Rename struct for pll clocks from ccu_mdiv to ccu_pll - Rebase on v6.10-rc3, remove the dts node reordering patch from v3 now that it is in mainline Changes in RFC v3 [3]: - Drop redundant new line and unused clk label from the dts example in the DT binding which I failed to fix in v2. - Add patch [4] from Thomas Bonnefille that fixes dts node ordering in th1520.dtsi. Conor has already merged it into riscv-dt-for-next so the dts patches in this series are based on top of that. - Remove fixed uart clock and converted uart DT nodes to use clocks from the clock controller. - Remove fixed apb clock and converted the dma controller and timer DT nodes to use a clock from the clock controller. - Made ccu_disable_helper() and ccu_enable_helper() to static functions - Follow the advice from Stephen Boyd in Yangtao's original series to not use strings for clk tree topology. Created clk_parent_data arrays to be used with CLK_HW_INIT_PARENTS_DATA instead of parent strings. - Rebase on top of v6.9-rc7 Changes in RFC v2 [5]: - 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 Changes in RFC v1 [6] 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 Thank you, Drew [1] https://openbeagle.org/beaglev-ahead/beaglev-ahead/-/blob/main/docs/TH1520%20System%20User%20Manual.pdf [2] https://lore.kernel.org/all/20230515054402.27633-1-frank.li@vivo.com/ [3] https://lore.kernel.org/all/20240506-th1520-clk-v3-0-085a18a23a7f@tenstorrent.com/ [4] https://lore.kernel.org/all/20240425082138.374445-1-thomas.bonnefille@bootlin.com/ [5] https://lore.kernel.org/all/20240426-th1520-clk-v2-v2-0-96b829e6fcee@tenstorrent.com/ [6] https://lore.kernel.org/all/20240110-clk-th1520-v1-0-8b0682567984@tenstorrent.com/ To: Jisheng Zhang To: Guo Ren To: Fu Wei To: Yangtao Li To: Thomas Bonnefille To: Emil Renner Berthing To: Michael Turquette To: Stephen Boyd To: Rob Herring To: Krzysztof Kozlowski To: Conor Dooley To: Paul Walmsley To: Palmer Dabbelt To: Albert Ou Cc: linux-riscv@lists.infradead.org Cc: linux-clk@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Drew Fustini --- Drew Fustini (6): 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: change TH1520 uart nodes to use clock controller riscv: dts: thead: change TH1520 mmc nodes to use clock controller riscv: dts: thead: update TH1520 dma and timer nodes to use clock controller .../bindings/clock/thead,th1520-clk-ap.yaml | 58 ++ MAINTAINERS | 3 + arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts | 12 - .../boot/dts/thead/th1520-lichee-module-4a.dtsi | 12 - arch/riscv/boot/dts/thead/th1520.dtsi | 69 +- 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 | 1086 ++++++++++++++++++++ include/dt-bindings/clock/thead,th1520-clk-ap.h | 96 ++ 11 files changed, 1291 insertions(+), 61 deletions(-) --- base-commit: 83a7eefedc9b56fe7bfeff13b6c7356688ffa670 change-id: 20240614-th1520-clk-cd585a850d6c Best regards, -- Drew Fustini