From patchwork Fri Apr 27 18:56:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 10369645 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6A9B6602DC for ; Fri, 27 Apr 2018 18:57:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C38729282 for ; Fri, 27 Apr 2018 18:57:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2100629289; Fri, 27 Apr 2018 18:57:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8116029282 for ; Fri, 27 Apr 2018 18:57:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758550AbeD0S5X (ORCPT ); Fri, 27 Apr 2018 14:57:23 -0400 Received: from mail-db5eur01on0066.outbound.protection.outlook.com ([104.47.2.66]:14059 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758069AbeD0S5T (ORCPT ); Fri, 27 Apr 2018 14:57:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=5/zDGxlamtXIuu39bs3EUGSF1otXsewkdOtpnhnr+yA=; b=lfAdo8WAzeLNY2vue6I/XtNi8q4pYn6oawoUl+Rig4zDaZw3pTPXLumiJTI7MqeDw5Mqi8P3qchEMOdXLCImouldpkLgv7u3s/EvWKrDOQNXQSGEFM3OTIK/yh/06vinlgUGVcsII+UAFZmo+8E4BV3iMp2fszDxqLFzw/A2sow= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aisheng.dong@nxp.com; Received: from b29396-OptiPlex-7040.ap.freescale.net (119.31.174.66) by AM6PR04MB4213.eurprd04.prod.outlook.com (2603:10a6:209:4f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.715.18; Fri, 27 Apr 2018 18:57:13 +0000 From: Dong Aisheng To: linux-clk@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, sboyd@kernel.org, mturquette@baylibre.com, shawnguo@kernel.org, fabio.estevam@nxp.com, linux-imx@nxp.com, kernel@pengutronix.de, Dong Aisheng Subject: [PATCH 02/12] clk: imx: scu: add scu clock common part Date: Sat, 28 Apr 2018 02:56:33 +0800 Message-Id: <1524855403-15301-3-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524855403-15301-1-git-send-email-aisheng.dong@nxp.com> References: <1524855403-15301-1-git-send-email-aisheng.dong@nxp.com> MIME-Version: 1.0 X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: TYAPR01CA0025.jpnprd01.prod.outlook.com (2603:1096:404:28::13) To AM6PR04MB4213.eurprd04.prod.outlook.com (2603:10a6:209:4f::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB4213; X-Microsoft-Exchange-Diagnostics: 1; AM6PR04MB4213; 3:afPxVsPeeDoWb9XRMlp9gP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c/0fFZOxypJ0ObJ27/SxvINssfhD2iKjiGpXAPwIvT9d+CIhoTmuPlxykUekE2LLUSCY7hKCnEIrRMbZ7aG93zX75XOtyCS5Vu32hkQ554irINx/Yh3xN+d8vzMI7aDKB9H8x1Kyl2mtACgcRde09Y88vSR+2TkwMZ4FEDhWTjqmsSeLd9OeDt3FG4DmqLCl45n03rgvm2g2csLSboIAPK//2LD3hpaDKAaFvvC8huJiZE06NTj53PkggLJTfRXrx6VvntTEQV1WCKLtshixzsp3fqFlfXcaMNUVD3yxZ525NzuAt20OVR+zWFrJ9qpccn; 4:eivjb+/bzdxlEiWkZjFIqbObgOu6pVyP5ro7ZxNNK42xfiolwS5ZIHRdvJMPZ7K8jES+JAM68F/tNbGOPgQTaosE3MI4xlt1oh1NPt9c1+QAo6v+750p/jwGwRUbGAmSRGPSbHnwVvex5CJ7PVzx5W3o8c4oDRhDkBOwvQoMruJrtPu4voQUZS5e5gF/1tiYGgWu1/7wJNCT23cA4OBqbP8auNG38wsluUfPNqFkrgUHvB5sMBAxXDWDGYUY9trBrY/7RZfA+aZT+DP8sBT2p/CiEq8mwel74FPn0YYkrhSJxPrqPHlb57hTBeXyjsjQ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231232)(944501410)(52105095)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:AM6PR04MB4213; BCL:0; PCL:0; RULEID:; SRVR:AM6PR04MB4213; X-Forefront-PRVS: 0655F9F006 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(39380400002)(366004)(396003)(346002)(376002)(199004)(189003)(76176011)(97736004)(26005)(305945005)(48376002)(47776003)(16526019)(186003)(6116002)(50226002)(7736002)(16586007)(106356001)(36756003)(50466002)(2906002)(51416003)(66066001)(3846002)(52116002)(316002)(6506007)(105586002)(386003)(25786009)(8936002)(4326008)(5660300001)(81156014)(81166006)(486006)(8676002)(6916009)(11346002)(6666003)(446003)(476003)(2351001)(956004)(86362001)(2616005)(2361001)(68736007)(6486002)(6512007)(59450400001)(478600001)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB4213; H:b29396-OptiPlex-7040.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM6PR04MB4213; 23:qGFozep05cZuhEcKqTbT4dI+YALTpvAIt7qczWXNy?= =?us-ascii?Q?BihLI5aUYV+y/6utC2bKoqF9N/A93gXuf9GpYbKiIJW4H+/FCPSfjt1ogxja?= =?us-ascii?Q?c1VX6UdorbMJZuq6A7kmHS3LhnV5mrukr5wAQTd4e2YO+TOgzX6Og3cVgL14?= =?us-ascii?Q?XL2924UJmu3sw50H3COgoZFjWzOxVaQptwp847HSKC4ielplaw9Jxrb27JyR?= =?us-ascii?Q?Ext01kq7DarKGWaiuVBbKmOuxhF4PmUBYcSJ6QQn+MNEt0hxrqEbxP2GQi7z?= =?us-ascii?Q?41Fv8dZz9OiPUA/eHCo4Pgj1IQDgxXsxNezmptgmxkLkwdx8nX72u665xcke?= =?us-ascii?Q?GashAXUO6zQhhoYqOaTWZrqy4AUrU0GzWOCneTAsK2s4Fb7WXWsOuwSuGS27?= =?us-ascii?Q?NgsenStq7ZDayB1alQMZpMZXGIq2xPknZ2dGI5Gj2PjPjdtycG0zK5EMzMoy?= =?us-ascii?Q?8A8RYqXE6yrfxLZcDeePNuQXyUq4Qtzo/oPEEhOTUvnYPW2nMOE0ozKVCXIr?= =?us-ascii?Q?twUQvlwcJ9hB0boWJONl1RPqqlhShHT+v2GQ4cCvqbkz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microsoft-Exchange-Diagnostics: 1; AM6PR04MB4213; 6:Wq49S/hq1QTeSX1J77ZzQTwJA5ztfXp6ZK3AFQtKM8h7PrCdits2rU6hfzLrzsQIaL6zhrQgLn+sCbaPtz/tvnb1n38Mm6fXm5//izaNzYbYebRYL6f6Z9gYXmRZOM3jFJt7OTRA2dlyKYG1x21sLeOv8i+b2N4DnTGwU+rOIjUioGEsChiEh33BAohY1Qz0pv6/QD0ypueDetbLczyM4tHuWdmkSslFBpoV5WPA890R49zU21spLt4+bxojsjmaDmnUlXhboPLw4INi0Wro0Oi+xlu0kV7qwKilg2XozNAU/MkTV071iydwwevdnEWtXNRJ4BQ0GDUHfSFgtRLM3YMokxS4dIcrOHWgZrK8D+hbKol4GdJP63R6+g1c401hOI2WDO/uazsc/3BhjU9SlH1IZyQAZquwZnVHBOfSZ9wxY/N3os9yLMG5pPSOdsNblZzqgchrJ1Cjz8wVE0ftLg==; 5:Nr21Tt+buV2OmbOHMkFIGGtQcdAeBaLbue+2mQ4p9+tPIB92QlIZNoKMP0mI6F03kz+RbhKPah+baJYZetYv9DWdSR/p+1vgAYU2J4oEFYbiWaOWNsTmblmSf2hMLVa3+b02V3oLDIhjNfdP5+MVTuRisoonKPmuMdNiNGo6nXU=; 24:fFV2fb8hMrTJfcT7gGLizFDGvtzyNS79xR8Uvc2ciM0nIl676j5vORDWXspIKJGi81GGOzS4DfmnNCigwvdIAV1+YyvA9HZGQxjXGKQ5q54= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM6PR04MB4213; 7:jGNL5nBXs6TRbisH297i8DwuyzOL765s48VB+SMO2lv2+ijhBL7w4mokF4O+qd3R4toO2nszUIW3H2GhGckRejI4cI0Uykwi5W6RQfH4ak+RpcO9I5pOYlnyjEg9fHJCilaHpSU3Rb+zMsBwa4dA+WueGMgDRvbdGMKngQgicZFXU35pynN8feXXX+vlVH1D6pt2MK8bmQXT6n7sAyDEDXKZaBE6Wn43bwYobc6vu/AQUMJxR69pYB8/iC7YVpS3 X-MS-Office365-Filtering-Correlation-Id: cfab38b5-7946-423d-6d9c-08d5ac70b250 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2018 18:57:13.5878 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cfab38b5-7946-423d-6d9c-08d5ac70b250 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB4213 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add scu clock common part which will be used by client clock drivers. Cc: Shawn Guo Cc: Sascha Hauer Cc: Fabio Estevam Cc: Stephen Boyd Cc: Michael Turquette Signed-off-by: Dong Aisheng --- drivers/clk/imx/Kconfig | 2 ++ drivers/clk/imx/Makefile | 2 ++ drivers/clk/imx/scu/Kconfig | 5 +++++ drivers/clk/imx/scu/Makefile | 4 ++++ drivers/clk/imx/scu/clk-scu.c | 25 +++++++++++++++++++++++++ drivers/clk/imx/scu/clk-scu.h | 18 ++++++++++++++++++ 6 files changed, 56 insertions(+) create mode 100644 drivers/clk/imx/scu/Kconfig create mode 100644 drivers/clk/imx/scu/Makefile create mode 100644 drivers/clk/imx/scu/clk-scu.c create mode 100644 drivers/clk/imx/scu/clk-scu.h diff --git a/drivers/clk/imx/Kconfig b/drivers/clk/imx/Kconfig index 43a3ecc..b1599bf 100644 --- a/drivers/clk/imx/Kconfig +++ b/drivers/clk/imx/Kconfig @@ -3,3 +3,5 @@ config MXC_CLK bool depends on ARCH_MXC + +source drivers/clk/imx/scu/Kconfig diff --git a/drivers/clk/imx/Makefile b/drivers/clk/imx/Makefile index d447f8c..79b641a 100644 --- a/drivers/clk/imx/Makefile +++ b/drivers/clk/imx/Makefile @@ -13,6 +13,8 @@ obj-$(CONFIG_MXC_CLK) += \ clk-pllv3.o \ clk-pfd.o +obj-y += scu/ + obj-$(CONFIG_SOC_IMX1) += clk-imx1.o obj-$(CONFIG_SOC_IMX21) += clk-imx21.o obj-$(CONFIG_SOC_IMX25) += clk-imx25.o diff --git a/drivers/clk/imx/scu/Kconfig b/drivers/clk/imx/scu/Kconfig new file mode 100644 index 0000000..4d018fd --- /dev/null +++ b/drivers/clk/imx/scu/Kconfig @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 +# SCU based common clock support for NXP i.MX SoC family. +config MXC_CLK_SCU + bool + depends on ARCH_MXC && ARM64 diff --git a/drivers/clk/imx/scu/Makefile b/drivers/clk/imx/scu/Makefile new file mode 100644 index 0000000..7dead13 --- /dev/null +++ b/drivers/clk/imx/scu/Makefile @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-$(CONFIG_MXC_CLK_SCU) += \ + clk-scu.o diff --git a/drivers/clk/imx/scu/clk-scu.c b/drivers/clk/imx/scu/clk-scu.c new file mode 100644 index 0000000..c19cd38 --- /dev/null +++ b/drivers/clk/imx/scu/clk-scu.c @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2016 Freescale Semiconductor, Inc. + * Copyright 2017~2018 NXP + * Dong Aisheng + */ + +#include +#include "clk-scu.h" + +DEFINE_SPINLOCK(imx_ccm_lock); +sc_ipc_t ccm_ipc_handle; + +int imx_clk_scu_init(void) +{ + sc_err_t sci_err; + + sci_err = sc_ipc_get_handle(&ccm_ipc_handle); + if (sci_err != SC_ERR_NONE) { + pr_err("imx_clk_scu: failed to get sc ipc handle\n"); + return -EPROBE_DEFER; + } + + return 0; +} diff --git a/drivers/clk/imx/scu/clk-scu.h b/drivers/clk/imx/scu/clk-scu.h new file mode 100644 index 0000000..6b39e4a --- /dev/null +++ b/drivers/clk/imx/scu/clk-scu.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2016 Freescale Semiconductor, Inc. + * Copyright 2017~2018 NXP + */ + +#ifndef __IMX_CLK_SCU_H +#define __IMX_CLK_SCU_H + +#include +#include + +extern spinlock_t imx_ccm_lock; +extern sc_ipc_t ccm_ipc_handle; + +int imx_clk_scu_init(void); + +#endif