From patchwork Tue Jun 11 09:41:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kongyang Liu X-Patchwork-Id: 1946208 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=dAxSaKeP; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vz3bt1SkYz20KL for ; Tue, 11 Jun 2024 19:42:02 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0CF4D878E2; Tue, 11 Jun 2024 11:41:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="dAxSaKeP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 319C487AD2; Tue, 11 Jun 2024 11:41: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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) (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 05A808752A for ; Tue, 11 Jun 2024 11:41:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seashell11234455@gmail.com Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-70255d5ddc7so785328b3a.3 for ; Tue, 11 Jun 2024 02:41:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718098913; x=1718703713; 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=2jdKyNV4bjXUOWN0er947WFNnr1/WM1v3eTrlboHlAE=; b=dAxSaKePQHokY9cvYR4wQL83ynDCPvXL83DaOFYkZWXWc8nMPjDodrR1E6w1/G1YmI w+Pman+thj/ocE0oOdJPK9ZISLzKnXWD6yQgtGTBoUZsLXOxlJBaC81tKwSgW61aIhoW kDaFLED81uT7wsBLijNhMHElKXduP3160pAz0gfaV8ea09KowbUTTuXrr9cV4sTc15Td wBN1jMzTDNvXCHZsN+MC6C2Z5ZkIEVCAIZsZNmVKRN7h3hw5KdoyttLjunqXBbnitXMJ 3duCfo2mczJndKvdCXMfaAypSlllHAhg4J31ma8HkXQE7QAFWalhtebOFudYE+HOdgO6 DjNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718098913; x=1718703713; 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=2jdKyNV4bjXUOWN0er947WFNnr1/WM1v3eTrlboHlAE=; b=Dxm85QCLSgQ3lEwsMu4cORCYeO7/i4zlxapkGDBiS3eaaHpiZyj4Z6bZ4ag5VuuDL/ G9A74vYHoj/5G0YrBPbQVVQ/i5+ZkrZpPkt1EcNw1dDtBFc+VSXl/N+Yhx4aaQJ5LNoQ nuyEWWwrEpT0cnjKV56+kGsrBQH4s4SDAqYukwvSkoMz9dHG5np74MMbnrioylH1ATwt SeT6EulX8zxoeQKG4JkdnOIkAwSIiKoq8jc1AiQq/rb3WAv+abN5uPx9aRkqnueGqIqN f9++qoekU8YwDBZ0vVvXOL3OUkjHJAEPW62QDeYHpDqMklq09u/HRlW1Gth5df3gLJ5X VRHQ== X-Gm-Message-State: AOJu0YwrUjiEbsAPgMBoOYgrYYa04XNkagbavBlZy1qqvb12NVSGDyyK Vdg6JPqL3xhVH7F45nxrt41WIgkg8120wqsBSGeZsyz8KP2EA44DRsO4j6oG X-Google-Smtp-Source: AGHT+IGhkdVt1wJ0eio42C4msZ6Ie1x/uGZedjEyp0XF7olMeuWr4WiCg/NYhnkmwrNkOI5KplU8Jw== X-Received: by 2002:a05:6a20:7484:b0:1b7:733c:d1b with SMTP id adf61e73a8af0-1b7733c0f5fmr5280621637.42.1718098913256; Tue, 11 Jun 2024 02:41:53 -0700 (PDT) Received: from localhost.localdomain ([117.135.90.188]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6d859ea3csm76873555ad.178.2024.06.11.02.41.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 02:41:52 -0700 (PDT) From: Kongyang Liu To: u-boot@lists.denx.de Cc: Andre Przywara , Arturs Artamonovs , Caleb Connolly , Greg Malysa , Leo , Lukasz Majewski , Marek Vasut , Michal Simek , Nathan Barrett-Morrison , Rick Chen , Samuel Holland , Sean Anderson , Sumit Garg , Tom Rini , Utsav Agarwal , Vasileios Bimpikas Subject: [PATCH v2 0/4] clk: sophgo: milkv_duo: Add and enable clock controller driver Date: Tue, 11 Jun 2024 17:41:12 +0800 Message-ID: <20240611094134.18868-1-seashell11234455@gmail.com> X-Mailer: git-send-email 2.41.0 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 This series of patches introduces the clock controller driver for the Sophgo CV1800B SoC, updates the device tree sources to use the new clock controller, and enables the clock controller in the configuration for the Milk-V Duo board. Changes in v2: - Fix compilation error - Remove unused code Kongyang Liu (4): dt-bindings: clk: import header for clock controller of sophgo CV1800B clk: sophgo: cv1800b: Add clock controller driver for cv1800b SoC configs: milkv_duo: Enable clock controller riscv: dts: sophgo: Replace device clocks with real clocks. arch/riscv/dts/cv18xx.dtsi | 40 +- configs/milkv_duo_defconfig | 9 +- drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 1 + drivers/clk/sophgo/Kconfig | 14 + drivers/clk/sophgo/Makefile | 6 + drivers/clk/sophgo/clk-common.h | 74 +++ drivers/clk/sophgo/clk-cv1800b.c | 754 ++++++++++++++++++++++ drivers/clk/sophgo/clk-cv1800b.h | 123 ++++ drivers/clk/sophgo/clk-ip.c | 594 +++++++++++++++++ drivers/clk/sophgo/clk-ip.h | 288 +++++++++ drivers/clk/sophgo/clk-pll.c | 275 ++++++++ drivers/clk/sophgo/clk-pll.h | 74 +++ include/dt-bindings/clock/sophgo,cv1800.h | 176 +++++ 14 files changed, 2401 insertions(+), 28 deletions(-) create mode 100644 drivers/clk/sophgo/Kconfig create mode 100644 drivers/clk/sophgo/Makefile create mode 100644 drivers/clk/sophgo/clk-common.h create mode 100644 drivers/clk/sophgo/clk-cv1800b.c create mode 100644 drivers/clk/sophgo/clk-cv1800b.h create mode 100644 drivers/clk/sophgo/clk-ip.c create mode 100644 drivers/clk/sophgo/clk-ip.h create mode 100644 drivers/clk/sophgo/clk-pll.c create mode 100644 drivers/clk/sophgo/clk-pll.h create mode 100644 include/dt-bindings/clock/sophgo,cv1800.h