From patchwork Mon Sep 28 14:52:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1372687 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=g5DK8wd+; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C0QX60yhhz9s0b for ; Tue, 29 Sep 2020 00:54:14 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2A8DF823A7; Mon, 28 Sep 2020 16:53:13 +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="g5DK8wd+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BE0EE82371; Mon, 28 Sep 2020 16:52:56 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) (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 E561982294 for ; Mon, 28 Sep 2020 16:52:53 +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=seanga2@gmail.com Received: by mail-qk1-x744.google.com with SMTP id d20so1186496qka.5 for ; Mon, 28 Sep 2020 07:52:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GdDDeQuHIwps9ZrFnwDjof7F6xk3pLbiKjZ8GijAJWc=; b=g5DK8wd+9rGe914Rssk7baUZnoRz+EMwFY1X8kkujGWyUlmlj8KdcWhDWLSZJX48XQ JPoYijouyRe1MgQ8kx/ExTJQRZQvmBtrEMUFHMYFIQWTDDiGk9TiRVcepEFcUHTLRrd6 tExEB2KopTwE2K845W0WQsCbIit2SX9WyddURYu8ivMvYvUH5cwYheY24WaGUB3Lg43G k9iST45fA4E1TF833vuCZX2usBntRkGKZ0EKrq9huhqaKuunjzYlVs9uT1ASKJ7culF2 iQ1JkQ5cFqkqxL9rJzJClmx1xd81YO2ISLb9P7FOIREjhEpakRmSA4IFNnM0/f6Wbuy+ /jSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GdDDeQuHIwps9ZrFnwDjof7F6xk3pLbiKjZ8GijAJWc=; b=a3aQ9ItbLj1G2izxK7WKttJS2lXrbhVlugypMtUzl0S3NOkFshJ8UJP96wzTGLZeJv 77aK6yiztZHjeGkNTOsFU21fHXIKlNR3bZAHIWGDxvpbnxgg6XoLRoRL59xuLHU8QVlF EusVVR2ZJg+iy5dPlb2EDfe1VU4N0JeS0sw5g5juCOxBBQpxueSP0Zm0LN9F6tgFTQzl MVh7jMN8QC9ii6YeU7/sqpZm5YDRNvo9axOHiAnSKoDVrhRE1r78ILHn3pjc0QXfs7GQ z+ru2z46KFQ74wD6shjQV0s74FTfzF0th/0BrmW52XI7uO+yVmR0db7+3b/9muQ7h0uT G5lg== X-Gm-Message-State: AOAM532Nm9q1hll/lA0qWyFg+wMKz13jHkdgP6dBrSNlexe+rfRkDOzE 4j7EOwhNq64j/tlM9VwhuPAdA5oIhunMLQ== X-Google-Smtp-Source: ABdhPJzqCfpVO83OvnQKjTQ0uabg/R5AYbpw0LxiBe62wab5kbQhgeoMPIJksS4OExb5CVl4bx3sPg== X-Received: by 2002:ae9:e8c2:: with SMTP id a185mr1810024qkg.435.1601304772621; Mon, 28 Sep 2020 07:52:52 -0700 (PDT) Received: from godwin.fios-router.home (pool-108-51-35-162.washdc.fios.verizon.net. [108.51.35.162]) by smtp.gmail.com with ESMTPSA id e7sm1530651qtk.17.2020.09.28.07.52.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Sep 2020 07:52:52 -0700 (PDT) From: Sean Anderson To: u-boot@lists.denx.de Cc: Pragnesh Patel , Rick Chen , Bin Meng , Anup Patel , Sean Anderson Subject: [PATCH v6 7/9] riscv: clk: Add CLINT clock to kendryte clock driver Date: Mon, 28 Sep 2020 10:52:27 -0400 Message-Id: <20200928145229.449782-8-seanga2@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200928145229.449782-1-seanga2@gmail.com> References: <20200928145229.449782-1-seanga2@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean Another "virtual" clock (in the sense that it isn't configurable). This could possibly be done as a clock in the device tree, but I think this is a bit cleaner. Signed-off-by: Sean Anderson --- checkpatch still complains about this one, but I don't see any reason to break it up even further. It doesn't make sense to me to split the header file change from everything else. (no changes since v2) Changes in v2: - Split Kendryte binding changes into their own commit drivers/clk/kendryte/clk.c | 4 ++++ include/dt-bindings/clock/k210-sysctl.h | 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/clk/kendryte/clk.c b/drivers/clk/kendryte/clk.c index 981b3b7699..bb196961af 100644 --- a/drivers/clk/kendryte/clk.c +++ b/drivers/clk/kendryte/clk.c @@ -646,6 +646,10 @@ static int k210_clk_probe(struct udevice *dev) REGISTER_GATE(K210_CLK_RTC, "rtc", in0); #undef REGISTER_GATE + /* The MTIME register in CLINT runs at one 50th the CPU clock speed */ + clk_dm(K210_CLK_CLINT, + clk_register_fixed_factor(NULL, "clint", "cpu", 0, 1, 50)); + return 0; } diff --git a/include/dt-bindings/clock/k210-sysctl.h b/include/dt-bindings/clock/k210-sysctl.h index 0e3ed3fb9f..fe852bbd92 100644 --- a/include/dt-bindings/clock/k210-sysctl.h +++ b/include/dt-bindings/clock/k210-sysctl.h @@ -55,5 +55,6 @@ #define K210_CLK_OTP 43 #define K210_CLK_RTC 44 #define K210_CLK_ACLK 45 +#define K210_CLK_CLINT 46 #endif /* CLOCK_K210_SYSCTL_H */