From patchwork Thu Sep 9 07:39:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kavyasree Kotagiri X-Patchwork-Id: 508477 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=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, 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 BC94FC433F5 for ; Thu, 9 Sep 2021 07:40:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A434861101 for ; Thu, 9 Sep 2021 07:40:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352734AbhIIHlV (ORCPT ); Thu, 9 Sep 2021 03:41:21 -0400 Received: from esa.microchip.iphmx.com ([68.232.154.123]:17114 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352725AbhIIHlU (ORCPT ); Thu, 9 Sep 2021 03:41:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1631173211; x=1662709211; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=8Z/q9u6J6X9odZyZgZS3kh3rN7rE+HIwG/tPx58z6YY=; b=bM+HdsXGRC9FVi4RN82hoXECumHtXBMjVWrCUQHMZ0ywhiFq/rUxjd3J 0Ek+dMTEJS4GnnCd75MgDsw5g08ryUEiJ5//9IkzJVcqIIG/ACGOdlOeO S2h5GTSvKOfLmZxTDaWwWB6dXx9WXncb8nOe7QUidQQ4BLG9wmpqMpCUJ FUOGMlOJhN8vxwOVGdJ5QSbwZdyrvdPYFtWDntOfypIiJPlaabPZZmFVN IT+S9LKspi59QeER8jl6ZqpwMT25wFaCYwo2PUxrhiat1eQAbtp90eVhS xtHJM46pkmb7O9Ur3J+mJemgGPpZ68wt4GHfB8kLrqd+04J7cbJRTRwe1 g==; IronPort-SDR: yLbLj7c0NsXqAmtS2BPMOGjHLmkKu0vsVZa8mG2CGMDkRPBc/YfNy0rMsRXunNo8PhPgb1bnSy 88+leyqACG2mVPvQ4LB0ZTIQVya1SUgRlACJKcXwk7q0qyugJ2o1fMwb/ORqrNDiKU/RaFFvK3 wMNYYwkNwRis0BMrtlumCftvEEBz3gXkP8l1RF5eLiqQQWRg1x6fnor2/5L/0NZPGt8GgiYYVR R5ZsfcNMGpZLIBJmBsjlKTK0W/bslqfotJVs4+g1LN85kB4iSev+AMsXgpr/X8tACsnxECYD6L TFFVBlKEZrDmoAsF63iMs9Pu X-IronPort-AV: E=Sophos;i="5.85,279,1624345200"; d="scan'208";a="128724859" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 09 Sep 2021 00:40:09 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 9 Sep 2021 00:40:09 -0700 Received: from kavya-HP-Compaq-6000-Pro-SFF-PC.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 9 Sep 2021 00:40:05 -0700 From: Kavyasree Kotagiri To: , , CC: , , , , , , Subject: [PATCH v3 1/3] dt-bindings: clock: lan966x: Add binding includes for lan966x SoC clock IDs Date: Thu, 9 Sep 2021 13:09:45 +0530 Message-ID: <20210909073947.17438-2-kavyasree.kotagiri@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210909073947.17438-1-kavyasree.kotagiri@microchip.com> References: <20210909073947.17438-1-kavyasree.kotagiri@microchip.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org LAN966X supports 14 clock outputs for its peripherals. This include file is introduced to use identifiers for clocks. Signed-off-by: Kavyasree Kotagiri --- v2 -> v3: - No changes. v1 -> v2: - Updated license. include/dt-bindings/clock/microchip,lan966x.h | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 include/dt-bindings/clock/microchip,lan966x.h diff --git a/include/dt-bindings/clock/microchip,lan966x.h b/include/dt-bindings/clock/microchip,lan966x.h new file mode 100644 index 000000000000..fe36ed6d8b5f --- /dev/null +++ b/include/dt-bindings/clock/microchip,lan966x.h @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ +/* + * Copyright (c) 2021 Microchip Inc. + * + * Author: Kavyasree Kotagiri + */ + +#ifndef _DT_BINDINGS_CLK_LAN966X_H +#define _DT_BINDINGS_CLK_LAN966X_H + +#define GCK_ID_QSPI0 0 +#define GCK_ID_QSPI1 1 +#define GCK_ID_QSPI2 2 +#define GCK_ID_SDMMC0 3 +#define GCK_ID_PI 4 +#define GCK_ID_MCAN0 5 +#define GCK_ID_MCAN1 6 +#define GCK_ID_FLEXCOM0 7 +#define GCK_ID_FLEXCOM1 8 +#define GCK_ID_FLEXCOM2 9 +#define GCK_ID_FLEXCOM3 10 +#define GCK_ID_FLEXCOM4 11 +#define GCK_ID_TIMER 12 +#define GCK_ID_USB_REFCLK 13 + +#define N_CLOCKS 14 + +#endif From patchwork Thu Sep 9 07:39:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kavyasree Kotagiri X-Patchwork-Id: 508911 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=-13.7 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, 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 D3C7EC433EF for ; Thu, 9 Sep 2021 07:40:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B69E4610C8 for ; Thu, 9 Sep 2021 07:40:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352747AbhIIHl0 (ORCPT ); Thu, 9 Sep 2021 03:41:26 -0400 Received: from esa.microchip.iphmx.com ([68.232.153.233]:1044 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352727AbhIIHlZ (ORCPT ); Thu, 9 Sep 2021 03:41:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1631173216; x=1662709216; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=pXQ+1kH3Nj3W10QLxAYlywu4tFXYqhf4Ir1l3JGyc+A=; b=YF7FAa9J+Qj0bxaWHbX7RJrPsMNxF7404kOdgbScKWZcravWRsU/CtDV PQgRFghtwsR7yPccB6cetX+8qKCNU5YiFXHUq3PhH8HxGAjdSWA/vXBJ1 VpsucGfe1xaI/lOQiC+HIvoOD6XCoCBSOfbw7WEsFS6wVMMPed+1bkrtL j4XexOcn46+h38K7MbtIvn+fGQK4lKb/kMQA5RY2quYNnB2bhCohURK+o IREuCyVJX0AREZyE57grzceUHG2FwO+82wlgD7tFKpWsR09skWgUmkwQ9 NHO/2kg99DW2a6DtTKpnCfvOt6n0LMFUIHM+iwqANBqnh0RUgfr90M5XS A==; IronPort-SDR: Tr2/HUAyFHOx5EioK24aaYowd40bI5Qc0JdRHV8+1Y466J0N+YDt3vzytMasRaah9g4GVx3SJa ARQk6taAJ6qmhYOihGDNglYI0v6gJEO5E/cVjySWz2HauDEnMuNVosNG3nc1GY7ZmRjdIdzN7o KRWtf7NaPCFl5+oSWS4vYXUX7wB6Oj+AfLTTBaOcTpJH1syKRX55nngB6hTZWozFCNxmzvMZdI ooYn/97MPq9e7DagQ1imG+C1MW9ecDmHeRbVGF7zJqwEAqaHFLIm1LjKivycVZSfRm2P5xC/+I TK9SZGk89GfPhxE9Z1Oyp/uP X-IronPort-AV: E=Sophos;i="5.85,279,1624345200"; d="scan'208";a="135905491" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 09 Sep 2021 00:40:15 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 9 Sep 2021 00:40:15 -0700 Received: from kavya-HP-Compaq-6000-Pro-SFF-PC.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 9 Sep 2021 00:40:11 -0700 From: Kavyasree Kotagiri To: , , CC: , , , , , , Subject: [PATCH v3 2/3] clk: lan966x: Add lan966x SoC clock driver Date: Thu, 9 Sep 2021 13:09:46 +0530 Message-ID: <20210909073947.17438-3-kavyasree.kotagiri@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210909073947.17438-1-kavyasree.kotagiri@microchip.com> References: <20210909073947.17438-1-kavyasree.kotagiri@microchip.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This adds Generic Clock Controller driver for lan966x SoC. Lan966x clock controller contains 3 PLLs - cpu_clk, ddr_clk and sys_clk. It generates and supplies clock to various peripherals within SoC. Register settings required to provide GCK clocking to a peripheral is as below: GCK_SRC_SEL = Select clock source. GCK_PRESCALER = Set divider value. GCK_ENA = 1 - Enable GCK clock. Signed-off-by: Kavyasree Kotagiri Signed-off-by: Horatiu Vultur Co-developed-by: Horatiu Vultur --- v2 -> v3: - No changes. v1 -> v2: - No changes. drivers/clk/clk-lan966x.c | 235 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 235 insertions(+) create mode 100644 drivers/clk/clk-lan966x.c diff --git a/drivers/clk/clk-lan966x.c b/drivers/clk/clk-lan966x.c new file mode 100644 index 000000000000..4492be90cecf --- /dev/null +++ b/drivers/clk/clk-lan966x.c @@ -0,0 +1,235 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Microchip LAN966x SoC Clock driver. + * + * Copyright (C) 2021 Microchip Technology, Inc. and its subsidiaries + * + * Author: Kavyasree Kotagiri + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define GCK_ENA BIT(0) +#define GCK_SRC_SEL GENMASK(9, 8) +#define GCK_PRESCALER GENMASK(23, 16) + +static const char *clk_names[N_CLOCKS] = { + "qspi0", "qspi1", "qspi2", "sdmmc0", + "pi", "mcan0", "mcan1", "flexcom0", + "flexcom1", "flexcom2", "flexcom3", + "flexcom4", "timer", "usb_refclk", +}; + +struct lan966x_gck { + struct clk_hw hw; + void __iomem *reg; +}; +#define to_lan966x_gck(hw) container_of(hw, struct lan966x_gck, hw) + +static struct clk_init_data init; +static void __iomem *base; + +static int lan966x_gck_enable(struct clk_hw *hw) +{ + struct lan966x_gck *gck = to_lan966x_gck(hw); + u32 val = readl(gck->reg); + + val |= GCK_ENA; + writel(val, gck->reg); + + return 0; +} + +static void lan966x_gck_disable(struct clk_hw *hw) +{ + struct lan966x_gck *gck = to_lan966x_gck(hw); + u32 val = readl(gck->reg); + + val &= ~GCK_ENA; + writel(val, gck->reg); +} + +static int lan966x_gck_set_rate(struct clk_hw *hw, + unsigned long rate, + unsigned long parent_rate) +{ + struct lan966x_gck *gck = to_lan966x_gck(hw); + u32 div, val = readl(gck->reg); + + if (rate == 0 || parent_rate == 0) + return -EINVAL; + + /* Set Prescalar */ + div = parent_rate / rate; + val &= ~GCK_PRESCALER; + val |= FIELD_PREP(GCK_PRESCALER, (div - 1)); + writel(val, gck->reg); + + return 0; +} + +static long lan966x_gck_round_rate(struct clk_hw *hw, unsigned long rate, + unsigned long *parent_rate) +{ + unsigned int div; + + if (rate == 0 || *parent_rate == 0) + return -EINVAL; + + if (rate >= *parent_rate) + return *parent_rate; + + div = DIV_ROUND_CLOSEST(*parent_rate, rate); + + return *parent_rate / div; +} + +static unsigned long lan966x_gck_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct lan966x_gck *gck = to_lan966x_gck(hw); + u32 div, val = readl(gck->reg); + + div = FIELD_GET(GCK_PRESCALER, val); + + return parent_rate / (div + 1); +} + +static int lan966x_gck_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) +{ + struct clk_hw *parent; + int i; + + for (i = 0; i < clk_hw_get_num_parents(hw); ++i) { + parent = clk_hw_get_parent_by_index(hw, i); + if (!parent) + continue; + + if (clk_hw_get_rate(parent) / req->rate < 254) { + req->best_parent_hw = parent; + req->best_parent_rate = clk_hw_get_rate(parent); + + return 0; + } + } + + return -EINVAL; +} + +static u8 lan966x_gck_get_parent(struct clk_hw *hw) +{ + struct lan966x_gck *gck = to_lan966x_gck(hw); + u32 val = readl(gck->reg); + + return FIELD_GET(GCK_SRC_SEL, val); +} + +static int lan966x_gck_set_parent(struct clk_hw *hw, u8 index) +{ + struct lan966x_gck *gck = to_lan966x_gck(hw); + u32 val = readl(gck->reg); + + val &= ~GCK_SRC_SEL; + val |= FIELD_PREP(GCK_SRC_SEL, index); + writel(val, gck->reg); + + return 0; +} + +static const struct clk_ops lan966x_gck_ops = { + .enable = lan966x_gck_enable, + .disable = lan966x_gck_disable, + .set_rate = lan966x_gck_set_rate, + .round_rate = lan966x_gck_round_rate, + .recalc_rate = lan966x_gck_recalc_rate, + .determine_rate = lan966x_gck_determine_rate, + .set_parent = lan966x_gck_set_parent, + .get_parent = lan966x_gck_get_parent, +}; + +static struct clk_hw *lan966x_gck_clk_register(struct device *dev, int i) +{ + struct lan966x_gck *priv; + int ret; + + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return ERR_PTR(-ENOMEM); + + priv->reg = base + (i * 4); + priv->hw.init = &init; + ret = devm_clk_hw_register(dev, &priv->hw); + if (ret) + return ERR_PTR(ret); + + return &priv->hw; +}; + +static int lan966x_clk_probe(struct platform_device *pdev) +{ + struct clk_hw_onecell_data *hw_data; + struct device *dev = &pdev->dev; + const char *parent_names[3]; + int i, ret; + + hw_data = devm_kzalloc(dev, sizeof(*hw_data), GFP_KERNEL); + if (!hw_data) + return -ENOMEM; + + base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(base)) + return PTR_ERR(base); + + init.ops = &lan966x_gck_ops; + init.num_parents = 3; + + for (i = 0; i < init.num_parents; ++i) { + parent_names[i] = of_clk_get_parent_name(pdev->dev.of_node, i); + if (!parent_names[i]) + return -EINVAL; + } + + init.parent_names = parent_names; + hw_data->num = N_CLOCKS; + + for (i = 0; i < N_CLOCKS; i++) { + init.name = clk_names[i]; + hw_data->hws[i] = lan966x_gck_clk_register(dev, i); + if (IS_ERR(hw_data->hws[i])) { + dev_err(dev, "failed to register %s clock\n", + init.name); + return ret; + } + } + + return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, hw_data); +} + +static const struct of_device_id lan966x_clk_dt_ids[] = { + { .compatible = "microchip,lan966x-gck", }, + { } +}; +MODULE_DEVICE_TABLE(of, lan966x_clk_dt_ids); + +static struct platform_driver lan966x_clk_driver = { + .probe = lan966x_clk_probe, + .driver = { + .name = "lan966x-clk", + .of_match_table = lan966x_clk_dt_ids, + }, +}; +builtin_platform_driver(lan966x_clk_driver); + +MODULE_AUTHOR("Kavyasree Kotagiri "); +MODULE_DESCRIPTION("LAN966X clock driver"); +MODULE_LICENSE("GPL v2"); From patchwork Thu Sep 9 07:39:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kavyasree Kotagiri X-Patchwork-Id: 508476 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=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, 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 C5F1BC433FE for ; Thu, 9 Sep 2021 07:40:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B338961132 for ; Thu, 9 Sep 2021 07:40:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352727AbhIIHlg (ORCPT ); Thu, 9 Sep 2021 03:41:36 -0400 Received: from esa.microchip.iphmx.com ([68.232.154.123]:1546 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352768AbhIIHld (ORCPT ); Thu, 9 Sep 2021 03:41:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1631173224; x=1662709224; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=mldQ2ZtpurxzxxUnfSFvo7AgruO4s1DAL8f7MWFvmx8=; b=vgQwP2n83cAmC0FVuwWU+GhvQ/GXbH9y7zoRS2E407f1kX3E+0UngZWO kLQfwTr87T9XPu6WVrSJYgUFqsLvgnLZ9V+frhM1eyklwrN8jRo1bX0lB Bn1xBYPIiBfqxnH5ex8bFa5DZKXa5e1TilEYvGrAjDmInUEP5DdyCYfdb STqHtV3a7cK+9sIiGhS6s1gLTea7CdlKughDbRbKKDaROJCg2FGJavaA1 r/fXx9QOc7M84PmRhh2fGkM96wPvKGHAm0uPfLQAXfjXh15CgXKHMg3MN sBl1XtxRUvqBWhDFq+feJkww7JZA01u9FAmn7u+IxcvOPtg1O1oG5ccc6 g==; IronPort-SDR: vDiTPCFEeexK/ieHcYgdk+B3VbPDhFXlIMS+3a1vE9aoRpDdqaKnFBa2ORzG+f1jSeK1MAkgWP BKe/5xXDiLa3s49OqOZydBoiFtQyeJPzCBH8PDpIG4N9dn1w4i2L9HZhS+pnbdWWY19lut1M2m PnzL2Mfbrs69f7LelmZgd2umnc3yI1tARuNMgQ/zqv0qritTcumDY3cKeZ8QdaYrFw8Y+D615B qnOk2IrG7Kjrv6EpEyAkKPEVkJbYxBFd68f/wfAeAKLA+blSDuPCP7cpVKKIdMTDf1FhdkbOA3 LE3M5JYsbNDPY06y3ToWu0yx X-IronPort-AV: E=Sophos;i="5.85,279,1624345200"; d="scan'208";a="131213230" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 09 Sep 2021 00:40:24 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 9 Sep 2021 00:40:22 -0700 Received: from kavya-HP-Compaq-6000-Pro-SFF-PC.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 9 Sep 2021 00:40:18 -0700 From: Kavyasree Kotagiri To: , , CC: , , , , , , Subject: [PATCH v3 3/3] dt-bindings: clock: lan966x: Add LAN966X Clock Controller Date: Thu, 9 Sep 2021 13:09:47 +0530 Message-ID: <20210909073947.17438-4-kavyasree.kotagiri@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210909073947.17438-1-kavyasree.kotagiri@microchip.com> References: <20210909073947.17438-1-kavyasree.kotagiri@microchip.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This adds the DT bindings documentation for lan966x SoC generic clock controller. Signed-off-by: Kavyasree Kotagiri --- v2 -> v3: - Fixed dt_binding_check errors. v1 -> v2: - Updated example provided for clk controller DT node. .../bindings/clock/microchip,lan966x-gck.yaml | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/microchip,lan966x-gck.yaml diff --git a/Documentation/devicetree/bindings/clock/microchip,lan966x-gck.yaml b/Documentation/devicetree/bindings/clock/microchip,lan966x-gck.yaml new file mode 100644 index 000000000000..d353d42c3dc8 --- /dev/null +++ b/Documentation/devicetree/bindings/clock/microchip,lan966x-gck.yaml @@ -0,0 +1,64 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/microchip,lan966x-gck.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip LAN966X Generic Clock Controller + +maintainers: + - Kavyasree Kotagiri + +description: | + The LAN966X Generic clock controller contains 3 PLLs - cpu_clk, + ddr_clk and sys_clk. This clock controller generates and supplies + clock to various peripherals within the SoC. + +properties: + compatible: + const: microchip,lan966x-gck + + reg: + maxItems: 1 + + clocks: + maxItems: 3 + + '#clock-cells': + const: 1 + +required: + - compatible + - reg + - clocks + - '#clock-cells' + +additionalProperties: false + +examples: + - | + cpu_clk: cpu_clk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <600000000>; + }; + + ddr_clk: ddr_clk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <300000000>; + }; + + sys_clk: sys_clk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <162500000>; + }; + + clks: clock-controller@e00c00a8 { + compatible = "microchip,lan966x-gck"; + #clock-cells = <1>; + clocks = <&cpu_clk>, <&ddr_clk>, <&sys_clk>; + reg = <0xe00c00a8 0x38>; + }; +...