From patchwork Tue Apr 2 11:28:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 192 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 265C03F078 for ; Tue, 2 Apr 2019 13:29:20 +0200 (CEST) Received: by mail-pg1-f200.google.com with SMTP id 132sf9726683pgc.18 for ; Tue, 02 Apr 2019 04:29:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1554204558; cv=pass; d=google.com; s=arc-20160816; b=mzS93vmYVTUJdnq4bQQ6EXjIcPehgSLJI0e5qLRmSNBibfRtsuBcnuUD0ooG7K04O/ Sk1+9F6Vm3OfzODE2iJEbr5vMl0V2rme8i9rvYspkXj5TssIUnnBwORZQ88hCi3+CG2n SYy6juEv0cuH/Jzse52I4NAjLB531VTVVRUTp/UbuMqgIPCLahCIKB2GK/DbeE5F2g5t 3dS13Qst/JPJff5cWL4VaI+LoWeXJVGK/Y0mMNFUjrdCbzOPZ1xMcS58dLI9Pc/+FdKl ANQVT63C/9g+JVaG7gmkIgE95kEEC2KXZff48ke0Zr1QjN3f3G+sHL77mpZ1pLqp6g9i JHLA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=LjmqfDl0cvZ0W6wfeY8zyOyucAntpc0Pj3DG8oCSMNE=; b=KojjSZmymCLpdFEthwvid42X6tk59KaaruqcMtgYzs63uOqG3V3MmLr7DM5Q3FSMF2 TQfI7SdhY0BdonwKzx0pV9GyyXhLscu2S7+c7f/JGIVJG0QTjgnP7JPJcHdUVQ6D7hDm La5PkFfnxkTRkA7/6TydygQN6xcYQ1TcisPxFCqd/7zVMjaenypwzlwovJI26hgxsdmQ IDqVWechlEx4VNqdb2oS/BqZ2N6b3jK4C9VhTbC0sR0ddW0nryCUjove78Rajx3zmEk0 Gl8+RPGVfPAOmfnk/oju/S8ar7kRoAlnuW3cCaRHlBFOqh8MEk9X/8TlMxt6n2COUwIa DnHA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=F0jWHL5m; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=LjmqfDl0cvZ0W6wfeY8zyOyucAntpc0Pj3DG8oCSMNE=; b=N5jophH6hrGHwSCb8IJd43lsuTRekyxJPI+5MJaGSdp0+6kEQEYmVtAe2ImZR+MLJw nPVJyNhM4Xsme7Jc2/z3IPw4IwQKy/k1bE0eyk2ZZxmtIwkOydv8z/xI5G7USndIJLr9 rfRjM7ogEhWHiad1Td4tgtmLoUnFY1Sc34F7s= 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=LjmqfDl0cvZ0W6wfeY8zyOyucAntpc0Pj3DG8oCSMNE=; b=MmqcrIaaNO8S46jEh/NYVtuzu6v6M7SaF9re98dsnxO1cTm8/DDWLDIe+AiFzy9UaG 46G4Pl601sll67xV+TzCLNxdS1hneLvY2NTVN6ccPMmLfjVmgPgwXkRQhpA3nlTikErY JLjtypbz6anKI7nrFcQ/dH2Qf9n2Fb7XY79Qui4X/MNX0tLZyxMCrG/TOL68CBLC8qsH Ius1NmIe+lfHYRo3nBSpuzJU12XJvAUnOFfYEv0CeEFxX+wN/+2854xmY6m457Z20MIL i9bNFjS2ueRWap5KQP6s5PAQpfffiuw2M9VmNxd7UrZz4TVAHgRhCrItFqDy6m85J4D5 gwyg== X-Gm-Message-State: APjAAAWbfTjwhCgpr7yAjnlLqFxsS1bgxYC/rh8MkosZYmHx8V9kuJUw LPvLA5LS5K8tff34GFXiAqGSoqDm X-Google-Smtp-Source: APXvYqyvv6jhp8AtfUURq97TwDSDAq+7w10WXUHepuUD2XL15G9nzXZLgDy1bcYjJPMLLtAmSx2CWA== X-Received: by 2002:a63:610f:: with SMTP id v15mr1027501pgb.37.1554204558715; Tue, 02 Apr 2019 04:29:18 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:6cc9:: with SMTP id h192ls188338pgc.3.gmail; Tue, 02 Apr 2019 04:29:18 -0700 (PDT) X-Received: by 2002:a62:604:: with SMTP id 4mr32931827pfg.38.1554204558338; Tue, 02 Apr 2019 04:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554204558; cv=none; d=google.com; s=arc-20160816; b=aGx33UrvcXGrlU6Y+alSJSudAT+u0Ym0KiQ8Zl9w6eI7jTF8fSJVPcKLJMxcoXEy6X 58Gm2VdXATxQrjDTP3Q+FaQkvOZIKQqNAmfe9oI8qAr/Do4nFn69dndyz3UC7g+q5KQQ UtpCUtpY2NVCdYitKuixbj5lE8eq1IjFi5IY0qW4R0vpihsnaaMweAXfnzRJtpCDyGNp Xi0pjTOP6o2X3q9stcPP5E0oFvo7Br0uNy5vWpAwcbKY2cevlF4EBOxRJPCoSrxKnxI3 sy0j+7b4DrmB9H/CEh0IRcgKxPasmCj4FQOtZt2A8PLplUY0lL9PRTRqn0IlxvbZzxQ0 llxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=a8AJbxAdU8389NRnR6mrBE1duz8udYI+xFOCHMOM90o=; b=Yfo8+XIxNqAIChMOFD144izbEolSQJLRR/Ei0HXC1+YdRQYD2QqCL2ZCNCra1X9gpR qaby3yclAw+flRe8W/D+Pel2DKPh6PRBBPED4GvrrYXTlgOLGXgz9sMexPsY9Ea4Y/uw 5+P9LUrTtfiL6qkvvffbBUBfcrXRhhj201TFSFX6kqTKX2a+lEvBMO2OnMyUCVzbsKAi BZ3rikeMKlZQbtgldgvkpcDwL2i6WHsjEA222a8D1mtO4mH6gPqAJM1s1gmJo1zxnuIX CY8XwmqBshfA6/LEZ57+87NDjTdH1ksWvx4FzR35bvAqHoQy7jC3tv3o9DPSwQ0QTwlT 2Iyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=F0jWHL5m; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id k75sor3509355pfb.7.2019.04.02.04.29.18 for (Google Transport Security); Tue, 02 Apr 2019 04:29:18 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a65:430a:: with SMTP id j10mr49366649pgq.143.1554204558039; Tue, 02 Apr 2019 04:29:18 -0700 (PDT) Received: from jagan-XPS-13-9350.imgcgcw.net ([147.50.13.10]) by smtp.gmail.com with ESMTPSA id u62sm23992715pfa.124.2019.04.02.04.29.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Apr 2019 04:29:16 -0700 (PDT) From: Jagan Teki To: Simon Glass , Tom Rini , Neil Armstrong , Philipp Tomsich , Marek Vasut , Stefano Babic , Fabio Estevam , Peng Fan , Maxime Ripard , Michael Trimarchi , Andre Przywara Cc: u-boot@lists.denx.de, uboot-imx@nxp.com, Shyam Saini , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v2 03/10] clk: imx: Add i.MX6UL clock driver Date: Tue, 2 Apr 2019 16:58:36 +0530 Message-Id: <20190402112843.992-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190402112843.992-1-jagan@amarulasolutions.com> References: <20190402112843.992-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=F0jWHL5m; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , i.MX6 clock control module comprise of parent clocks, gates, multiplexers, dividers, PODF, PLL, fixed rate and etc. This patch add i.MX6UL USDHC clocks via gate clock which would eventually handle enable/disable operations via imx6_clock_gate. Signed-off-by: Jagan Teki --- drivers/clk/imx/Kconfig | 7 +++++++ drivers/clk/imx/Makefile | 1 + drivers/clk/imx/clk-imx6ul.c | 37 ++++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 drivers/clk/imx/clk-imx6ul.c diff --git a/drivers/clk/imx/Kconfig b/drivers/clk/imx/Kconfig index f81903dcf4..952cec8bff 100644 --- a/drivers/clk/imx/Kconfig +++ b/drivers/clk/imx/Kconfig @@ -15,6 +15,13 @@ config CLK_IMX6Q This enables common clock driver support for platforms based on i.MX6 QDL SoC. +config CLK_IMX6UL + bool "Clock driver for i.MX6UL" + default MX6UL + help + This enables common clock driver support for platforms based + on i.MX6 UL SoC. + config CLK_IMX8 bool "Clock support for i.MX8" default ARCH_IMX8 diff --git a/drivers/clk/imx/Makefile b/drivers/clk/imx/Makefile index a4cb2bbf3b..999de1dd6f 100644 --- a/drivers/clk/imx/Makefile +++ b/drivers/clk/imx/Makefile @@ -7,4 +7,5 @@ obj-$(CONFIG_CLK_IMX) += clk-imx6-common.o endif obj-$(CONFIG_CLK_IMX6Q) += clk-imx6q.o +obj-$(CONFIG_CLK_IMX6UL) += clk-imx6ul.o obj-$(CONFIG_CLK_IMX8) += clk-imx8.o diff --git a/drivers/clk/imx/clk-imx6ul.c b/drivers/clk/imx/clk-imx6ul.c new file mode 100644 index 0000000000..f5250e8b72 --- /dev/null +++ b/drivers/clk/imx/clk-imx6ul.c @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Amarula Solutions. + * Author: Jagan Teki + */ + +#include +#include +#include +#include +#include + +static const struct imx6_clk_gate imx6ul_gates[] = { + [IMX6UL_CLK_USDHC1] = GATE(0x080, GENMASK(3, 2)), + [IMX6UL_CLK_USDHC2] = GATE(0x080, GENMASK(5, 4)), +}; + +static const struct imx6_clk_desc imx6ul_clk_desc = { + .gates = imx6ul_gates, +}; + +static const struct udevice_id clk_imx6ul_ids[] = { + { + .compatible = "fsl,imx6ul-ccm", + .data = (ulong)&imx6ul_clk_desc + }, + { /* sentinel */ } +}; + +U_BOOT_DRIVER(clk_imx6ul) = { + .name = "clk_imx6ul", + .id = UCLASS_CLK, + .of_match = clk_imx6ul_ids, + .priv_auto_alloc_size = sizeof(struct imx6_clk_priv), + .ops = &imx6_clk_ops, + .probe = imx6_clk_probe, +};