From patchwork Sat Nov 14 13:50:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Palmer X-Patchwork-Id: 11905619 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE075C55ABD for ; Sat, 14 Nov 2020 13:54:05 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A25B122252 for ; Sat, 14 Nov 2020 13:54:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZUauQZTG"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=0x0f.com header.i=@0x0f.com header.b="l5FsBr48" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A25B122252 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=0x0f.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qNMEv3hVm/MHsmEI4Ygmwhk/iScsjrr47Hqauru7VYo=; b=ZUauQZTGGlw5f9KqEiehSmMXI RKYAsw/dETfqlCcUjSGnZR+miehnYz0wbKmjebTKmbsV3SR2/K0gEWRUT/kEbuPYlnL4/cTETpgxi jkkkx8tHi2jljsnwuIFvo/3hPOmKu12MjxcXRo1pmrrxnwoS1lJPLl2rYaL92mVRfCZEzvfM4eSFv AS+B9BX4vMNG+d8FT1IOkuB7wlXFX87WL4USsx+lovQpLAv5B2At+mtXNHaNZBauP2xsTBmGpGDp9 I6DBI5RO/nPeiSOxTCFFjNA63MUXA87dc0B/PA0wjBcS3W4qcRO2b0B8AMF7cuohFzY/srgPO7dmA VDAcmnECA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdvyc-0008DX-LA; Sat, 14 Nov 2020 13:52:26 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdvyZ-0008CR-Hb for linux-arm-kernel@lists.infradead.org; Sat, 14 Nov 2020 13:52:24 +0000 Received: by mail-pf1-x442.google.com with SMTP id y7so9741347pfq.11 for ; Sat, 14 Nov 2020 05:52:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=0x0f.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=F/nq3JnunleBEPmOqQ59JVNiFyN2h6AIwG//l7PiMiQ=; b=l5FsBr48D12H3HK8mLGUuPcnIWvJp1vzinlvLgFfovlMFugm7gKec4ctCEOoBdkoDz fSuT4W75rbTt7t2WFPTCG2GevKdL2TeqeE6PJhpx2Iy4vFvvncr6EhL35l37w+6Fe+G6 oV//uwgXt1OunaaouRB1KY7CSrhOl2eeo93qo= 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=F/nq3JnunleBEPmOqQ59JVNiFyN2h6AIwG//l7PiMiQ=; b=USrIHWmiPvSnWVDJWd8z+xqtAQ3auYNzbxuSWjXfMemPgaPoJvLz1yzDHyJEg6nqN4 IkD718pXRqCW3n27TuwMWwirof0HxZQ+d6OL54cGegfKDu/nf4tuy7FFQR/AfRJ1LMjo EXUDgYPU5UczFdh3rxXXBTQ26VjvsnquMK+BlrASgEB3gS3UXwSXqDMtzrVB7YFgKQqi 0gjWoZiQg/s0BR9V0ek7O8hyzHvyoCRvFse+BN05lxN8o/pb4HVBJNkyEG2709ZbqJdk +EwTI45Md5TbvqSnDkl9xGpw5FcftgVAT04R+ihAo5kIRJiR/F9Acju1YI3+LZZ3l7oA +UvQ== X-Gm-Message-State: AOAM533nK1ha0N9dOja6lmkRwIWaD2EZvnqAAXfvwBzBDrObwa41jWde +TSZxc8O0ijNGC7sOB3FEiI0Mg== X-Google-Smtp-Source: ABdhPJzq4Ydud7WeDfpMytkX7tslUBQ49azEQ7XkLoSKZEyI0EoGIy2e/XTGLLSPG5v8hRo5NIhAKw== X-Received: by 2002:aa7:8b12:0:b029:18c:7b88:d7fc with SMTP id f18-20020aa78b120000b029018c7b88d7fcmr6241210pfd.53.1605361941458; Sat, 14 Nov 2020 05:52:21 -0800 (PST) Received: from shiro.work (p1268123-ipngn200803sizuokaden.shizuoka.ocn.ne.jp. [118.13.124.123]) by smtp.googlemail.com with ESMTPSA id r205sm13008023pfr.25.2020.11.14.05.52.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Nov 2020 05:52:21 -0800 (PST) From: Daniel Palmer To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 1/6] dt-bindings: clk: mstar msc313 mpll binding header Date: Sat, 14 Nov 2020 22:50:39 +0900 Message-Id: <20201114135044.724385-2-daniel@0x0f.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201114135044.724385-1-daniel@0x0f.com> References: <20201114135044.724385-1-daniel@0x0f.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201114_085223_618324_A4933CB7 X-CRM114-Status: GOOD ( 14.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Palmer , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, w@1wt.eu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Simple header to document the relationship between the MPLL outputs and which divider they come from. Output 0 is missing because it should not be consumed. Signed-off-by: Daniel Palmer Acked-by: Rob Herring --- MAINTAINERS | 1 + include/dt-bindings/clock/mstar-msc313-mpll.h | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 include/dt-bindings/clock/mstar-msc313-mpll.h diff --git a/MAINTAINERS b/MAINTAINERS index a3f0aa46d0d8..1e874fda810e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2135,6 +2135,7 @@ F: Documentation/devicetree/bindings/gpio/mstar,msc313-gpio.yaml F: arch/arm/boot/dts/mstar-* F: arch/arm/mach-mstar/ F: drivers/gpio/gpio-msc313.c +F: include/dt-bindings/clock/mstar-* F: include/dt-bindings/gpio/msc313-gpio.h ARM/NEC MOBILEPRO 900/c MACHINE SUPPORT diff --git a/include/dt-bindings/clock/mstar-msc313-mpll.h b/include/dt-bindings/clock/mstar-msc313-mpll.h new file mode 100644 index 000000000000..1b30b02317b6 --- /dev/null +++ b/include/dt-bindings/clock/mstar-msc313-mpll.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */ +/* + * Output definitions for the MStar/SigmaStar MPLL + * + * Copyright (C) 2020 Daniel Palmer + */ + +#ifndef _DT_BINDINGS_CLOCK_MSTAR_MSC313_MPLL_H +#define _DT_BINDINGS_CLOCK_MSTAR_MSC313_MPLL_H + +#define MSTAR_MSC313_MPLL_DIV2 1 +#define MSTAR_MSC313_MPLL_DIV3 2 +#define MSTAR_MSC313_MPLL_DIV4 3 +#define MSTAR_MSC313_MPLL_DIV5 4 +#define MSTAR_MSC313_MPLL_DIV6 5 +#define MSTAR_MSC313_MPLL_DIV7 6 +#define MSTAR_MSC313_MPLL_DIV10 7 + +#endif From patchwork Sat Nov 14 13:50:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Palmer X-Patchwork-Id: 11905625 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79FC5C55ABD for ; Sat, 14 Nov 2020 13:54:11 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2D24622252 for ; Sat, 14 Nov 2020 13:54:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="z8SdvEbB"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=0x0f.com header.i=@0x0f.com header.b="Uu7hY/Wd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2D24622252 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=0x0f.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=37QreLNy66ykTYSlHFWXZqMJOzibhTmue7oCI7SmUDs=; b=z8SdvEbBzlAK+dd5BhgMXu62M Rvsh/vk1Arf3P6uLGwWM6UBUAVN6mWoGYTMQt/hM05Ae6OuofWvhxFpdOQ37p68eQCwMuAq3mfUoj bKU6SHdfFXO/zDIEw4W/mhncZQi+CyZWzR7TGMaDL4T5aooHPk9tTomWoOjRxafj2QvUbbbe/J8iE UysWz7wvEBlpdTKYSNWfwjxeWhGX5CL87S5R7HvXWXYB/DzE/SXqEU7zLxP+hFFPECAxqG5DFFH7r NHTBchUpuxx00o256+3WFe71CKmxJj5vjxpGg0FMRlR4wZuiHhLJhFbAAxkI0ov2VXv7WGPfC5td7 z2j5PymsA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdvyl-0008Fh-UA; Sat, 14 Nov 2020 13:52:35 +0000 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdvyb-0008Cz-Ob for linux-arm-kernel@lists.infradead.org; Sat, 14 Nov 2020 13:52:26 +0000 Received: by mail-pg1-x535.google.com with SMTP id f27so9179808pgl.1 for ; Sat, 14 Nov 2020 05:52:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=0x0f.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pQB8wgB7xeIzH4jYM33Ni/91/CZjY/s5lPEIdcq3mCs=; b=Uu7hY/WdqQASdhCOaP1aQEOiIjN5oC5jyTXW4bN0uyIfzp/ctO8WPQlZ/O0BY7gkKQ PVQRjcB2ShZ50gUFqHusQ8U4utYtgZr9ijG9dp54JAlRHUaDUw2gY1bwmmSMgaUjky3a XDUusT4Y9e9PJtJYcXwkuvvhDOny98vTjOUBw= 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=pQB8wgB7xeIzH4jYM33Ni/91/CZjY/s5lPEIdcq3mCs=; b=cypaKCdLQk7i0X8RNUBSpnWq4Ao0z8HqlL++YsLD2wVrfwssf6k0OIkMZahaJIrCcQ Ds0FCYDV8wutjVgkZB1HIVgWddbtJ4u4f+I7yF/KnDXwYyD+IwoE3/UZv5dH7R97y6oI 68ZMDjgpgTHnv7r/1ubLanwSNi5mwHtCO5Gr4w7UYSXUxcm37iTPm5nqI786emG8jSS1 brQUpHN+vfQ86mD3sKUGVxkdupVxR3cXZ7GpF5nAclaExd7gR7IMe31EaxXRMtCG65RM MQvKIlk/LzrqPwW5xVetMPPYSrrUM32U9ZkoK+qRr6bU8WBqqM0dRvAd+vDJt0EhFGXV x8cg== X-Gm-Message-State: AOAM533oTwNWHlqyHaFSP7KdmQbDcMoS+u9MUCCfyuDnlqq/2bP11GYc czJmLNbuJGA03o8xoZRBCucBBvPSpG2pNw== X-Google-Smtp-Source: ABdhPJybgsuJ2MR9afC4TvV1wuAq0kjAHSEVh7bgfL3c5ZOBk5Ui3Qqzj6j2VtFir9Yr6HaMI/hg/w== X-Received: by 2002:aa7:9414:0:b029:18c:23f6:bc6d with SMTP id x20-20020aa794140000b029018c23f6bc6dmr6451830pfo.21.1605361943642; Sat, 14 Nov 2020 05:52:23 -0800 (PST) Received: from shiro.work (p1268123-ipngn200803sizuokaden.shizuoka.ocn.ne.jp. [118.13.124.123]) by smtp.googlemail.com with ESMTPSA id r205sm13008023pfr.25.2020.11.14.05.52.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Nov 2020 05:52:23 -0800 (PST) From: Daniel Palmer To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 2/6] dt-bindings: clk: mstar msc313 mpll binding description Date: Sat, 14 Nov 2020 22:50:40 +0900 Message-Id: <20201114135044.724385-3-daniel@0x0f.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201114135044.724385-1-daniel@0x0f.com> References: <20201114135044.724385-1-daniel@0x0f.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201114_085225_832073_DF6378B9 X-CRM114-Status: GOOD ( 16.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Palmer , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, w@1wt.eu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add a binding description for the MStar/SigmaStar MPLL clock block. Signed-off-by: Daniel Palmer Reviewed-by: Rob Herring --- .../bindings/clock/mstar,msc313-mpll.yaml | 58 +++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 59 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/mstar,msc313-mpll.yaml diff --git a/Documentation/devicetree/bindings/clock/mstar,msc313-mpll.yaml b/Documentation/devicetree/bindings/clock/mstar,msc313-mpll.yaml new file mode 100644 index 000000000000..9ddc1163b31b --- /dev/null +++ b/Documentation/devicetree/bindings/clock/mstar,msc313-mpll.yaml @@ -0,0 +1,58 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/mstar,msc313-mpll.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MStar/Sigmastar MSC313 MPLL + +maintainers: + - Daniel Palmer + +description: | + The MStar/SigmaStar MSC313 and later ARMv7 chips have an MPLL block that + takes the external xtal input and multiplies it to create a high + frequency clock and divides that down into a number of clocks that + peripherals use. + +properties: + compatible: + const: mstar,msc313-mpll + + "#clock-cells": + const: 1 + + clocks: + maxItems: 1 + + clock-output-names: + minItems: 8 + maxItems: 8 + description: | + This should provide a name for the internal PLL clock and then + a name for each of the divided outputs. + + reg: + maxItems: 1 + +required: + - compatible + - "#clock-cells" + - clocks + - clock-output-names + - reg + +additionalProperties: false + +examples: + - | + mpll@206000 { + compatible = "mstar,msc313-mpll"; + reg = <0x206000 0x200>; + #clock-cells = <1>; + clocks = <&xtal>; + clock-output-names = "mpll", "mpll_div_2", + "mpll_div_3", "mpll_div_4", + "mpll_div_5", "mpll_div_6", + "mpll_div_7", "mpll_div_10"; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 1e874fda810e..d1c98a6f9f24 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2131,6 +2131,7 @@ L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) S: Maintained W: http://linux-chenxing.org/ F: Documentation/devicetree/bindings/arm/mstar/* +F: Documentation/devicetree/bindings/clock/mstar,msc313-mpll.yaml F: Documentation/devicetree/bindings/gpio/mstar,msc313-gpio.yaml F: arch/arm/boot/dts/mstar-* F: arch/arm/mach-mstar/ From patchwork Sat Nov 14 13:50:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Palmer X-Patchwork-Id: 11905603 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CF51C5519F for ; Sat, 14 Nov 2020 13:53:12 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3F3D722252 for ; Sat, 14 Nov 2020 13:53:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gdyLFs0Q"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=0x0f.com header.i=@0x0f.com header.b="SbO8pQ/g" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F3D722252 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=0x0f.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DVG4BlENVEAuWsvaLigcnRrlGpFLX9B4haV4DXOnQBM=; b=gdyLFs0QQ4AlkgPm743fuEFS9 1chZnocbIWekPZbg1vZpvNFgSGupmIG50gHPm1Di+lDPXBpoGOIXT71DN/fL+3IflzPqHraOGORJy AufU1SIx6Ckhp2hHs3fnkYHbxcBq4axTQtGhLNkv9HGUkykqOuoQKHgAbrJS2b+ZTHIxP4cKlNoVb 24GvPldLsjXlsr09cKxMja8v+rU/sZipWUh4nSCanrC/4JWJ8lVQNjU8++oV87DkjJ9DwQDhQhROA 6ddPr55tRFSYhyEBJiIhhHV5GHbd3HiXp9KiF24G31uJXm5e5dMuubJtvGKbVVBEi/dd1Prd0gwRI E63vQ9ekA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdvyn-0008G1-NK; Sat, 14 Nov 2020 13:52:37 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdvyd-0008DY-V2 for linux-arm-kernel@lists.infradead.org; Sat, 14 Nov 2020 13:52:29 +0000 Received: by mail-pl1-x643.google.com with SMTP id y22so5867451plr.6 for ; Sat, 14 Nov 2020 05:52:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=0x0f.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3nC/ASffZrZM9zs9m0ATeAZTVaoD2XE5WP6BHRrg/xw=; b=SbO8pQ/gY4wRQdYv4tE4m/XLDgp8tEQ0rtE3Gy0VKC4RKgUDWj8u90VG/CciDvdixi FXU1SiTEyUizW6LcGLjNEuCkRGVPgYNm9Pz9aLe31WRBBa2N/2oiLuNwCGBuy2O8xCZO UaNJwTAGyNYHeUuWXVY/zk7SejunR5HudVfd4= 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=3nC/ASffZrZM9zs9m0ATeAZTVaoD2XE5WP6BHRrg/xw=; b=HSgoOjTxPOkx8y0yK+oCtCIGeNxiUYYmtM9BJD9zN41yn5vOm5fzp8vWjUdPgF3e9A tJrl2zxhIx1wOgGqnwrU+D5YPPQ2MfLmL09djKOtOxKZlqOa5bfSWuL3R0kBfQYi22mq 2KJPpc+Wy2O+PLgAGwQW98CfOcuCZNTcegWLQyVZMf9z5GQsnSZtSdwzrLfO2WT8vD5/ ldURmDUTIS6pPN0BkLwCkwJidYK7XXB4o1ry+CX+zpLTUdY6jPKfImorqwB6hHybTHcJ 5BKbmW+UjqavqCM1/w76d5Ot6yZMKEoMkO+g5hqrmQhiDLshINwOyKN3csZWfjyFLGrB 3Ejw== X-Gm-Message-State: AOAM533vYc7zBdfqHt4REMBQNKnHPabZl1CaLUzCozz2Qr+R9g8ozVac H7xshYDfENKElPKTrqlKe71wAA== X-Google-Smtp-Source: ABdhPJzo4WnfBW8T74aUdNFHlKWgPe6EU0rXrC0MGV1dleCfuuuz0baztnTEguyRqTxRujX/reV0qA== X-Received: by 2002:a17:90a:aa13:: with SMTP id k19mr2206164pjq.145.1605361945873; Sat, 14 Nov 2020 05:52:25 -0800 (PST) Received: from shiro.work (p1268123-ipngn200803sizuokaden.shizuoka.ocn.ne.jp. [118.13.124.123]) by smtp.googlemail.com with ESMTPSA id r205sm13008023pfr.25.2020.11.14.05.52.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Nov 2020 05:52:25 -0800 (PST) From: Daniel Palmer To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 3/6] clk: mstar: MStar/SigmaStar MPLL driver Date: Sat, 14 Nov 2020 22:50:41 +0900 Message-Id: <20201114135044.724385-4-daniel@0x0f.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201114135044.724385-1-daniel@0x0f.com> References: <20201114135044.724385-1-daniel@0x0f.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201114_085228_072132_78A16B57 X-CRM114-Status: GOOD ( 25.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Palmer , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, w@1wt.eu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This adds a basic driver for the MPLL block found in MStar/SigmaStar ARMv7 SoCs. Currently this driver is only good for calculating the rates of it's outputs and the actual configuration must be done before the kernel boots. Usually this is done even before u-boot starts. This driver targets the MPLL block found in the MSC313/MSC313E but there is no documentation this chip so the register descriptions for the another MStar chip the MST786 were used as they seem to match. Signed-off-by: Daniel Palmer --- MAINTAINERS | 1 + drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 1 + drivers/clk/mstar/Kconfig | 5 + drivers/clk/mstar/Makefile | 6 + drivers/clk/mstar/clk-msc313-mpll.c | 177 ++++++++++++++++++++++++++++ 6 files changed, 191 insertions(+) create mode 100644 drivers/clk/mstar/Kconfig create mode 100644 drivers/clk/mstar/Makefile create mode 100644 drivers/clk/mstar/clk-msc313-mpll.c diff --git a/MAINTAINERS b/MAINTAINERS index d1c98a6f9f24..1783022b4aa8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2135,6 +2135,7 @@ F: Documentation/devicetree/bindings/clock/mstar,msc313-mpll.yaml F: Documentation/devicetree/bindings/gpio/mstar,msc313-gpio.yaml F: arch/arm/boot/dts/mstar-* F: arch/arm/mach-mstar/ +F: drivers/clk/mstar/ F: drivers/gpio/gpio-msc313.c F: include/dt-bindings/clock/mstar-* F: include/dt-bindings/gpio/msc313-gpio.h diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index c715d4681a0b..a002f2605fa3 100644 --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig @@ -370,6 +370,7 @@ source "drivers/clk/ingenic/Kconfig" source "drivers/clk/keystone/Kconfig" source "drivers/clk/mediatek/Kconfig" source "drivers/clk/meson/Kconfig" +source "drivers/clk/mstar/Kconfig" source "drivers/clk/mvebu/Kconfig" source "drivers/clk/qcom/Kconfig" source "drivers/clk/renesas/Kconfig" diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index da8fcf147eb1..b758aae17ab8 100644 --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile @@ -124,3 +124,4 @@ endif obj-$(CONFIG_ARCH_ZX) += zte/ obj-$(CONFIG_ARCH_ZYNQ) += zynq/ obj-$(CONFIG_COMMON_CLK_ZYNQMP) += zynqmp/ +obj-$(CONFIG_ARCH_MSTARV7) += mstar/ diff --git a/drivers/clk/mstar/Kconfig b/drivers/clk/mstar/Kconfig new file mode 100644 index 000000000000..23765edde3af --- /dev/null +++ b/drivers/clk/mstar/Kconfig @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only +config MSTAR_MSC313_MPLL + bool + select REGMAP + select REGMAP_MMIO diff --git a/drivers/clk/mstar/Makefile b/drivers/clk/mstar/Makefile new file mode 100644 index 000000000000..f8dcd25ede1d --- /dev/null +++ b/drivers/clk/mstar/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Makefile for mstar specific clk +# + +obj-$(CONFIG_MSTAR_MSC313_MPLL) += clk-msc313-mpll.o diff --git a/drivers/clk/mstar/clk-msc313-mpll.c b/drivers/clk/mstar/clk-msc313-mpll.c new file mode 100644 index 000000000000..c1e2fe0fc412 --- /dev/null +++ b/drivers/clk/mstar/clk-msc313-mpll.c @@ -0,0 +1,177 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * MStar MSC313 MPLL driver + * + * Copyright (C) 2020 Daniel Palmer + */ + +#include +#include +#include +#include +#include +#include +#include + +#define REG_CONFIG1 0x8 +#define REG_CONFIG2 0xc + +static const struct regmap_config msc313_mpll_regmap_config = { + .reg_bits = 16, + .val_bits = 16, + .reg_stride = 4, +}; + +static const struct reg_field config1_loop_div_first = REG_FIELD(REG_CONFIG1, 8, 9); +static const struct reg_field config1_input_div_first = REG_FIELD(REG_CONFIG1, 4, 5); +static const struct reg_field config2_output_div_first = REG_FIELD(REG_CONFIG2, 12, 13); +static const struct reg_field config2_loop_div_second = REG_FIELD(REG_CONFIG2, 0, 7); + +static const unsigned int output_dividers[] = { + 2, 3, 4, 5, 6, 7, 10 +}; + +#define NUMOUTPUTS (ARRAY_SIZE(output_dividers) + 1) + +struct msc313_mpll { + struct clk_hw clk_hw; + struct regmap_field *input_div; + struct regmap_field *loop_div_first; + struct regmap_field *loop_div_second; + struct regmap_field *output_div; + struct clk_hw_onecell_data *clk_data; +}; + +#define to_mpll(_hw) container_of(_hw, struct msc313_mpll, clk_hw) +#define to_divider_hw(_mpll, _which) _mpll->clk_data->hws[_which + 1] + +static unsigned long msc313_mpll_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct msc313_mpll *mpll = to_mpll(hw); + unsigned int input_div, output_div, loop_first, loop_second; + unsigned long output_rate; + + regmap_field_read(mpll->input_div, &input_div); + regmap_field_read(mpll->output_div, &output_div); + regmap_field_read(mpll->loop_div_first, &loop_first); + regmap_field_read(mpll->loop_div_second, &loop_second); + + output_rate = parent_rate / (1 << input_div); + output_rate *= (1 << loop_first) * max(loop_second, 1U); + output_rate /= max(output_div, 1U); + + return output_rate; +} + +static const struct clk_ops msc313_mpll_ops = { + .recalc_rate = msc313_mpll_recalc_rate, +}; + +static int msc313_mpll_probe(struct platform_device *pdev) +{ + void __iomem *base; + struct msc313_mpll *mpll; + struct clk_init_data clk_init; + struct device *dev = &pdev->dev; + struct regmap *regmap; + const char *parents[1], *outputnames[NUMOUTPUTS]; + const int numparents = ARRAY_SIZE(parents); + int ret, i; + + if (of_clk_parent_fill(dev->of_node, parents, numparents) != numparents) + return -EINVAL; + + if (of_property_read_string_array(pdev->dev.of_node, "clock-output-names", + outputnames, NUMOUTPUTS) != NUMOUTPUTS) + return -EINVAL; + + mpll = devm_kzalloc(dev, sizeof(*mpll), GFP_KERNEL); + if (!mpll) + return -ENOMEM; + + base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(base)) + return PTR_ERR(base); + + regmap = devm_regmap_init_mmio(dev, base, &msc313_mpll_regmap_config); + if (IS_ERR(regmap)) + return PTR_ERR(regmap); + + mpll->input_div = devm_regmap_field_alloc(dev, regmap, config1_input_div_first); + if (IS_ERR(mpll->input_div)) + return PTR_ERR(mpll->input_div); + mpll->output_div = devm_regmap_field_alloc(dev, regmap, config2_output_div_first); + if (IS_ERR(mpll->output_div)) + return PTR_ERR(mpll->output_div); + mpll->loop_div_first = devm_regmap_field_alloc(dev, regmap, config1_loop_div_first); + if (IS_ERR(mpll->loop_div_first)) + return PTR_ERR(mpll->loop_div_first); + mpll->loop_div_second = devm_regmap_field_alloc(dev, regmap, config2_loop_div_second); + if (IS_ERR(mpll->loop_div_second)) + return PTR_ERR(mpll->loop_div_second); + + mpll->clk_data = devm_kzalloc(dev, struct_size(mpll->clk_data, hws, + ARRAY_SIZE(output_dividers)), GFP_KERNEL); + if (!mpll->clk_data) + return -ENOMEM; + + clk_init.name = outputnames[0]; + clk_init.ops = &msc313_mpll_ops; + clk_init.num_parents = 1; + clk_init.parent_names = parents; + mpll->clk_hw.init = &clk_init; + + ret = devm_clk_hw_register(dev, &mpll->clk_hw); + if (ret) + return ret; + + mpll->clk_data->num = NUMOUTPUTS; + mpll->clk_data->hws[0] = &mpll->clk_hw; + + for (i = 0; i < ARRAY_SIZE(output_dividers); i++) { + to_divider_hw(mpll, i) = clk_hw_register_fixed_factor(dev, + outputnames[i + 1], outputnames[0], 0, 1, output_dividers[i]); + if (IS_ERR(to_divider_hw(mpll, i))) { + ret = PTR_ERR(to_divider_hw(mpll, i)); + goto unregister_dividers; + } + } + + platform_set_drvdata(pdev, mpll); + + return devm_of_clk_add_hw_provider(&pdev->dev, of_clk_hw_onecell_get, + mpll->clk_data); + +unregister_dividers: + for (i--; i >= 0; i--) + clk_hw_unregister_fixed_factor(to_divider_hw(mpll, i)); + return ret; +} + +static int msc313_mpll_remove(struct platform_device *pdev) +{ + struct msc313_mpll *mpll = platform_get_drvdata(pdev); + int i; + + for (i = 0; i < ARRAY_SIZE(output_dividers); i++) + clk_hw_unregister_fixed_factor(to_divider_hw(mpll, i)); + + return 0; +} + +static const struct of_device_id msc313_mpll_of_match[] = { + { .compatible = "mstar,msc313-mpll", }, + {} +}; +MODULE_DEVICE_TABLE(of, msc313_mpll_of_match); + +static struct platform_driver msc313_mpll_driver = { + .driver = { + .name = "mstar-msc313-mpll", + .of_match_table = msc313_mpll_of_match, + }, + .probe = msc313_mpll_probe, + .remove = msc313_mpll_remove, +}; +builtin_platform_driver(msc313_mpll_driver); From patchwork Sat Nov 14 13:50:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Palmer X-Patchwork-Id: 11905623 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1834C63697 for ; Sat, 14 Nov 2020 13:54:06 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A9CF922252 for ; Sat, 14 Nov 2020 13:54:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XgRJcKUF"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=0x0f.com header.i=@0x0f.com header.b="tabb1NqY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A9CF922252 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=0x0f.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Y62ARN2Si1go8YaxXkXmY8aRYH4RESsJWIsQhznCpnU=; b=XgRJcKUFTtxXMWwc4z3Q/Xh34 jFJQ3mqQiF4vwjFY9NK8nd2lz0/uUpIl4DfgWlZOhV3mQq7owLug5WIlAn/0AC27FOOefYI7wul++ 7LluDSBhWubZphpYoKInmT6u/twNMR/uKzmpWVHN7pcPk5l5IltSbvlelBxa3212WWWDq8gOR1iQs PUtOjUKLErgoiwOnMxVZ4jayFGWGanJnOHHdMn4ZT+fB6fJB203rFeV6BH5akka4oQopptGByUFaw JPL7fQtALp/11xVoZidehXnIkg4OtoCt9Adhalb3dALeZhdUy59VddXkO+ZfiRua3/qBONOG+nEXf lLWWwlbiw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdvyp-0008GI-O2; Sat, 14 Nov 2020 13:52:39 +0000 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdvyf-0008EA-WA for linux-arm-kernel@lists.infradead.org; Sat, 14 Nov 2020 13:52:31 +0000 Received: by mail-pj1-x1044.google.com with SMTP id h12so448778pjv.2 for ; Sat, 14 Nov 2020 05:52:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=0x0f.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=knRDqUwLArt/cH+Tqwve+3iR/MhGzrnefGMWYKE+wNE=; b=tabb1NqYQxtCKgmPgxtbaPibihWkntu6RSY0c673ZnyqaahjS+4MnWiuuX10n5/SgT mZfVST1yb3XP3hfgOEkzK/A82wgXwWiDxXPefad6bsPcyA18i4McOgNvjHmUdOimTOma tYeawHrRe82fPXLEYCIOoh6hWTEaYh3Tbtfeo= 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=knRDqUwLArt/cH+Tqwve+3iR/MhGzrnefGMWYKE+wNE=; b=X+C8DUUHo2AgPr7PE+3DCz/5CE9n6oEm+2/1fVOy0JSuUmtR8Q/Bn+o43fIme7yfbL GYTXnv6dROImWnC6BzaWz07Dz+9yJnvfKWjqTOuP/sBSEFBpPxYIzp4eZPuEGNgv71QM FopNR2rozeFjJ7Ujkc6Wgbvtc/fSX7C7VMhjOZxmkkjHwgBoQoGCaa7Fwc/3nmye6JAd TWFJPaaPXSDcmPnbJ3A9Kik/k2kivsVVa7Z9i6KwSTTphHNMmx3VjOKnQqDxlMhGz1Pk WE04SMzaNYatC0lNztxxamlDOvBVs61jAL7L+Ajd2xv4N+g4SvKdP7MmdbAKaRulHyqq CGlA== X-Gm-Message-State: AOAM533elfePbeQv8nHWhuOUUSMr832EAzvtbJ3m/fS5RcpIvJvqw5Bk 9qsDFcavh2b7dIXuN3Fd91cTPg== X-Google-Smtp-Source: ABdhPJzMSVAnooVmia8Cb5+VWp9XK6kfgXDWdqNR6ykSsQtis1fYeAAxs6GOyE6QtsRdesLRuivNzw== X-Received: by 2002:a17:90a:4802:: with SMTP id a2mr8323284pjh.22.1605361948045; Sat, 14 Nov 2020 05:52:28 -0800 (PST) Received: from shiro.work (p1268123-ipngn200803sizuokaden.shizuoka.ocn.ne.jp. [118.13.124.123]) by smtp.googlemail.com with ESMTPSA id r205sm13008023pfr.25.2020.11.14.05.52.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Nov 2020 05:52:27 -0800 (PST) From: Daniel Palmer To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 4/6] ARM: mstar: Select MSTAR_MSC313_MPLL Date: Sat, 14 Nov 2020 22:50:42 +0900 Message-Id: <20201114135044.724385-5-daniel@0x0f.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201114135044.724385-1-daniel@0x0f.com> References: <20201114135044.724385-1-daniel@0x0f.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201114_085230_086767_BCF9FD39 X-CRM114-Status: GOOD ( 12.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Palmer , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, w@1wt.eu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org All of the ARCH_MSTARV7 chips have an MPLL as the source for peripheral clocks so select MSTAR_MSC313_MPLL. Signed-off-by: Daniel Palmer --- arch/arm/mach-mstar/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-mstar/Kconfig b/arch/arm/mach-mstar/Kconfig index 576d1ab293c8..cd300eeedc20 100644 --- a/arch/arm/mach-mstar/Kconfig +++ b/arch/arm/mach-mstar/Kconfig @@ -4,6 +4,7 @@ menuconfig ARCH_MSTARV7 select ARM_GIC select ARM_HEAVY_MB select MST_IRQ + select MSTAR_MSC313_MPLL help Support for newer MStar/Sigmastar SoC families that are based on Armv7 cores like the Cortex A7 and share the same From patchwork Sat Nov 14 13:50:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Palmer X-Patchwork-Id: 11905601 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A60A6C5519F for ; Sat, 14 Nov 2020 13:53:10 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4CC8E22252 for ; Sat, 14 Nov 2020 13:53:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CTJqES4+"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=0x0f.com header.i=@0x0f.com header.b="mg0e+Lsq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4CC8E22252 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=0x0f.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=88hYmxX4zqwClxmjbRVIaGwQFy7Kj6ENjvtbImD28OY=; b=CTJqES4+pRgrNwwdB99naWVCr iDPpHJvhIRY5wgaylBLCx3YdI1bvQ6y+V6UGIY/Ycvo4c0XNdk4KQ8wLDCWUtsA/+LbsabCckQKqI +WSBeJkPpzkln3iTVqxMgTHPG67hR7HDSOdLg3iRm34MKgA1k/7QWhQLE2aumX7PoUQNI3oOeRXZt QatNg4+ulkoSKmh5sEnKJDhP+3mQ8JDmXW5c8TWZ3y8deXAJL39bXQN2Tn8LvMaz6g6F5kkXmzxV1 gdt/VzYv8akRqoGFMdzwiaQJzRuJJTPxRqQ8AQugFmprxXL56NrL6CQd3oUYTwkW2X1yWRKJgIAmo kuSJ9cvYA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdvys-0008H0-Ew; Sat, 14 Nov 2020 13:52:42 +0000 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdvyi-0008Em-AV for linux-arm-kernel@lists.infradead.org; Sat, 14 Nov 2020 13:52:33 +0000 Received: by mail-pj1-x1042.google.com with SMTP id w20so1739645pjh.1 for ; Sat, 14 Nov 2020 05:52:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=0x0f.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7zw/uZzxvI3UePDC2yxEHCw/8K7dNDmlYTPIl068JGQ=; b=mg0e+Lsq9YBtl68lnopxGRDi8ylTs8lx0VoMPRqPwAEwR0QdW0KbXa1TdF8we1ikSe GVAzhcyNhOtFjqwg8nkvTrp8SZwsWGZuqVDcW58kHzOtub60XF2D7Il2NicDXmVumvK4 iHtllgespAnnBNAXFTOBu3U5C3BjVl1oQiszA= 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=7zw/uZzxvI3UePDC2yxEHCw/8K7dNDmlYTPIl068JGQ=; b=sOrwRFsvjad86ejxR7LxPhgiToRpnB5hPw9yoATkwWjH7Q6p65iZX347aGzdRzVo4e zrjwCLvFp2F3E8b2JuVSxMX4zfetQJVp0HCsxf5/ksElFSCZLACOfaeWcJaTr2ccJ/Wy PoN1lFK05ws6iwhd6q7yb6KGfjFBpkR4WB18Lc3B3XNmJb5+AdlXYdxPVcGRrzn8ufbx ylTwQQ/UW6fklu5kEPmjLQFrm7sjQu4V9v+w3TwXXVR8s6CcCXEljzDMIfOQZaanvc3j +uxY4AVmEaqN7YaYBv6OKYvNjYds9Btb9jC4XzOPHOWFrDbdzIYiRRv+vDHH9BniM4dR gUPg== X-Gm-Message-State: AOAM530YL9ea7BRRicEfiQ7k0pW2aM5k0NwFrLTilwm9BoakZJ7t2ELa uas69C3oRuIkj58snkkFJDi3Von4ZyYmYA== X-Google-Smtp-Source: ABdhPJyDJ55HiTcpPgKtU/DqaqSzQFSOJX7ii1TD1oASOYYXg6/75aNAlX05C72x7GfTj7cjMhhM9g== X-Received: by 2002:a17:902:c113:b029:d6:e921:bfc7 with SMTP id 19-20020a170902c113b02900d6e921bfc7mr6082374pli.19.1605361950160; Sat, 14 Nov 2020 05:52:30 -0800 (PST) Received: from shiro.work (p1268123-ipngn200803sizuokaden.shizuoka.ocn.ne.jp. [118.13.124.123]) by smtp.googlemail.com with ESMTPSA id r205sm13008023pfr.25.2020.11.14.05.52.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Nov 2020 05:52:29 -0800 (PST) From: Daniel Palmer To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 5/6] ARM: mstar: Add the external clocks to the base dsti Date: Sat, 14 Nov 2020 22:50:43 +0900 Message-Id: <20201114135044.724385-6-daniel@0x0f.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201114135044.724385-1-daniel@0x0f.com> References: <20201114135044.724385-1-daniel@0x0f.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201114_085232_393752_BC2B8DB3 X-CRM114-Status: GOOD ( 14.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Palmer , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, w@1wt.eu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org All of the currently known MStar/SigmaStar ARMv7 SoCs have an "xtal" clock input that is usually 24MHz and an "RTC xtal" that is usually 32KHz. The xtal input has to be connected to something so it's enabled by default. The MSC313 and MSC313E do not bring the RTC clock input out to the pins so it's impossible to connect it. The SSC8336 does bring the input out to the pins but it's not always actually connected to something. The RTC node needs to always be present because in the future the nodes for the clock muxes will refer to it even if it's not usable. The RTC node is disabled by default and should be enabled at the board level if the RTC input is wired up. Signed-off-by: Daniel Palmer --- arch/arm/boot/dts/mstar-v7.dtsi | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm/boot/dts/mstar-v7.dtsi b/arch/arm/boot/dts/mstar-v7.dtsi index 81369bc07f78..6749d421dbf4 100644 --- a/arch/arm/boot/dts/mstar-v7.dtsi +++ b/arch/arm/boot/dts/mstar-v7.dtsi @@ -46,6 +46,21 @@ pmu: pmu { interrupt-affinity = <&cpu0>; }; + clocks: clocks { + xtal: xtal { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <24000000>; + }; + + rtc_xtal: rtc_xtal { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <32768>; + status = "disabled"; + }; + }; + soc: soc { compatible = "simple-bus"; #address-cells = <1>; From patchwork Sat Nov 14 13:50:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Palmer X-Patchwork-Id: 11905621 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9E84C5519F for ; Sat, 14 Nov 2020 13:54:07 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7795A22252 for ; Sat, 14 Nov 2020 13:54:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="vXF/i3DI"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=0x0f.com header.i=@0x0f.com header.b="GPsXkawF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7795A22252 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=0x0f.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BjL/fqlM96bhi+0ErQAsjOGOlofNMkgRkMgdhieKdO4=; b=vXF/i3DIIlMmM5Q1xscxWrYh5 fRmm3P758zc6+Ro029ukA1pwPTT09HACXxmd9IYNASiHO9RVLypJFsxGuSc6lxTDDJKxf/pm9YAsG vq4Qg1dv9wNYxVtKBnlwaw+GCIO6AVUBZXIA6ok4HXSp3TgtAQO1D5BFUr55SoU+0aP90dKWaswa/ 9v8W+r4bJwYKfcL0J18dVc0pes7vZxfdlEpXAfkdf5UoIgymeYdcNRgLpfUv9xViqD9B/tg9d9gE4 FNBIC2yjB4zLTLkxudbCvSBE82aDjdL92RB/eYMokthtaKUNVLXBeQH2/PNfsiAFDLj2VymMxuNS1 +rB2A9r3A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdvyy-0008Hy-D0; Sat, 14 Nov 2020 13:52:48 +0000 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdvyj-0008FG-Rv for linux-arm-kernel@lists.infradead.org; Sat, 14 Nov 2020 13:52:35 +0000 Received: by mail-pj1-x1042.google.com with SMTP id b23so1734857pju.5 for ; Sat, 14 Nov 2020 05:52:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=0x0f.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TmJn3hr+RLmmQX5ys3w8ADM69QUXZfzE0ScMjrcJoEw=; b=GPsXkawFTCiDfm+G3kS88/otci7zITPY/HBy1frTfqrJAhPeexLAqopi8TX6GAjVh/ vMFACaUFE5CcgE4QCFfAbWqgjJmIltVetaVuoxaI5n7j/iQMtTEGI7uFbXYkgAq0fm2O C0cGyoLTSOk6YX25cSks4LovwTWiCBrKv0CwE= 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=TmJn3hr+RLmmQX5ys3w8ADM69QUXZfzE0ScMjrcJoEw=; b=eRx6GP63NlAAtZu4xHNsvngPQ94DXFLXHTKfsV6sQFq0mWtddEabVGWe5G8M4Q4BuC xQIAc/L85v45LVE26UheLWG65vFhRjPM3pdReC82KFOk6iqFUnL/Sh5qZGkc8rv3dWuR Q93sFSMRkuaLwRQEcKLY7D0JtKSVhDYJv3hzdkVL7vWzCtxoxMvucICP9t/4qzwDXpF8 AWtSjBJQZUcb/h9+PvnYiIDK/P2w9lIkhybdUhySJvULgK08RG67x67GddXnhBnVAMn9 8XjGnRzcrzWNAQuPVSxsnZxJ7igB8rsnaC5vMHwcHNlPweHUS78y9o87O3W0anE5NFo2 S2gg== X-Gm-Message-State: AOAM5311MkwvEgMl8DUR1GNBdLjyQzBIUEbjDDz7v1fX2NIMZ0hndwuI CkxaGulNNOz9g8TZ4QaiBeabSA== X-Google-Smtp-Source: ABdhPJy/eSal4uffFJZ0hVxw0r5qNnxSAm+4AoDTcudEaAoHz5Js3Cpkohoc+aovNShf/PnXEoWXKg== X-Received: by 2002:a17:90b:368e:: with SMTP id mj14mr8034823pjb.109.1605361952265; Sat, 14 Nov 2020 05:52:32 -0800 (PST) Received: from shiro.work (p1268123-ipngn200803sizuokaden.shizuoka.ocn.ne.jp. [118.13.124.123]) by smtp.googlemail.com with ESMTPSA id r205sm13008023pfr.25.2020.11.14.05.52.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Nov 2020 05:52:31 -0800 (PST) From: Daniel Palmer To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 6/6] ARM: mstar: Add mpll to base dtsi Date: Sat, 14 Nov 2020 22:50:44 +0900 Message-Id: <20201114135044.724385-7-daniel@0x0f.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201114135044.724385-1-daniel@0x0f.com> References: <20201114135044.724385-1-daniel@0x0f.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201114_085234_676652_C10ED475 X-CRM114-Status: GOOD ( 12.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Palmer , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, w@1wt.eu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org All of the currently known MStar/SigmaStar ARMv7 SoCs have at least one MPLL and it seems to always be at the same place so add it to the base dtsi. Signed-off-by: Daniel Palmer --- arch/arm/boot/dts/mstar-v7.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/boot/dts/mstar-v7.dtsi b/arch/arm/boot/dts/mstar-v7.dtsi index 6749d421dbf4..07fc46c7b4d4 100644 --- a/arch/arm/boot/dts/mstar-v7.dtsi +++ b/arch/arm/boot/dts/mstar-v7.dtsi @@ -6,6 +6,7 @@ #include #include +#include / { #address-cells = <1>; @@ -124,6 +125,17 @@ l3bridge: l3bridge@204400 { reg = <0x204400 0x200>; }; + mpll: mpll@206000 { + compatible = "mstar,msc313-mpll"; + #clock-cells = <1>; + reg = <0x206000 0x200>; + clocks = <&xtal>; + clock-output-names = "mpll", "mpll_div_2", + "mpll_div_3", "mpll_div_4", + "mpll_div_5", "mpll_div_6", + "mpll_div_7", "mpll_div_10"; + }; + gpio: gpio@207800 { #gpio-cells = <2>; reg = <0x207800 0x200>;