From patchwork Wed Nov 21 14:12:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 10692611 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DBCF515A7 for ; Wed, 21 Nov 2018 14:12:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C69882BD44 for ; Wed, 21 Nov 2018 14:12:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B9A642BD64; Wed, 21 Nov 2018 14:12:42 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0DE4A2BD3E for ; Wed, 21 Nov 2018 14:12:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References: List-Owner; bh=1XNLu/HiQQ3UDy9x9iayOfzBzS6HP1Ejo/24lJbuHdU=; b=UEVQxjJVDycj+r /t8FpbPBl65qqBtD+o986a8mf7KgbrfMRIJYGgB+OGy24c0OuW8TaxfeufZD15In/D6l03x5/Ay6p f54mS0oqN1ECD7S89bGDInfDTgoBDDCEiamC7AbodL7tSHNdr7w3HB+8mEn+qOUaI4kxIpRUM0wDR GpAVWWQ84ZAjiXZW4j2Nb2Sn+bAVaWVbq0yDBXKcYISOsZYLV9TqClLI36cvMNiRJ/QCIPIYwjF8J 63xzifyQUSuVQHfnlUIHnghueF/nWI+gPzeKN28ZQ4U7u6tQwciVXMzUU3HoaN6mfnfrU+gotQcBE 0f/G25xE3q3q/ziOjzdg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gPTF8-0002oP-U8; Wed, 21 Nov 2018 14:12:38 +0000 Received: from mail-eopbgr00088.outbound.protection.outlook.com ([40.107.0.88] helo=EUR02-AM5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gPTF5-0002nT-6o for linux-arm-kernel@lists.infradead.org; Wed, 21 Nov 2018 14:12:37 +0000 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:X-MS-Exchange-SenderADCheck; bh=eTcdbAqVSiuVE/e6am9mVTdIXouobANxOz9mIqFg0ew=; b=LHHfW80j3tyf1HU2XEl+4jNx7ijgxoIzT48BvbQtGg8cE95gg0ZRA8aWLW63ppavE7nf+WXbN7PvR2wnXpQhyuWPN+S2t4VUalTh7BVZ/CcBsEoyt08ipCwXk5xlmcaWAnwferAol99vNsbA4n28b62yHguZAKn0sFpvWDHUh88= Received: from AM0PR04MB4211.eurprd04.prod.outlook.com (52.134.126.21) by AM0PR04MB4081.eurprd04.prod.outlook.com (52.134.125.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1339.23; Wed, 21 Nov 2018 14:12:16 +0000 Received: from AM0PR04MB4211.eurprd04.prod.outlook.com ([fe80::31e3:2aa6:8d93:9927]) by AM0PR04MB4211.eurprd04.prod.outlook.com ([fe80::31e3:2aa6:8d93:9927%2]) with mapi id 15.20.1339.027; Wed, 21 Nov 2018 14:12:16 +0000 From: Aisheng DONG To: "linux-clk@vger.kernel.org" Subject: [PATCH V8 0/7] clk: imx: add imx8qxp clock support Thread-Topic: [PATCH V8 0/7] clk: imx: add imx8qxp clock support Thread-Index: AQHUgaQ07UOrlEn65UOyxxVfjCE+ww== Date: Wed, 21 Nov 2018 14:12:16 +0000 Message-ID: <1542809234-539-1-git-send-email-aisheng.dong@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HK2PR02CA0178.apcprd02.prod.outlook.com (2603:1096:201:21::14) To AM0PR04MB4211.eurprd04.prod.outlook.com (2603:10a6:208:66::21) authentication-results: spf=none (sender IP is ) smtp.mailfrom=aisheng.dong@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM0PR04MB4081; 6:LbNMVeP3jDXiAKW0r5ZygjVwsDjds1aPBqX4nWw4for2pCyqt6Hnnqt3jkPJPdxlC7d+I1sYu5gHKJtAkl9IlbZLfjdPzL6MKRI4+lc24LOKrqdy0RDM3s17NMTNpS8M4h4p0DxTmezNMooVpDdeZufDfuhAh7PhE5J7KJDKdzDwnraqGxjnyFMgS4Q7pTVffMw+xB/uqcGS8AniYYKHD+cMSFKGtd1tyFofd1mPHiK3MskH8tvo8If7+KDPCyuCKfzc/RoqZ5aG99LjLpFo2Ju+YbQ8btIaw9vVvMQIzjGOPYZgypVbGzA9V8bRUJ9x9AA4eioWnrjTWzuyVsxsi/RmjPAIxrLWP3MmwEpkASrjeEkziJyoSFOpqZNg7CnCtv8JhpXUoMdnNvivdXa9Zo98q0pjcVk2ztkApZHkRIyyWdsXbpaQoimR/lNeZKgX+zcXMrkQCFC6QmLJboqBpQ==; 5:3NP6TR19+lzfy+vY9m3UDJpqkgP3hUgvIayhuNDDOMg9nkgrQ7XeIAWDH2q2iCLcJD2yrDLhYPy3XoRCn8aQ/MelgUH3iGgusMq+AR4TFsfuz4Gu+3Eo7iLKle6AsTExIm5Fa5Y8lB7yGYuwlxMk6P5hf2vofoXwzfwYw1RF3bE=; 7:ShXH4wIfBPHNcKIHDQPp/yvWOl57PyR3CRDIhbg4vG8v6/CO4Yd/OPGkzGdE2azsXTlxCN6kNv6m88QowBnf4XORdo8oKLSGpy93X9w80gCMKbmqv1WxMaQoyMKvjMxiiXpPl2i2bp33sNGIgpQ/cw== x-ms-office365-filtering-correlation-id: e2ca6ce3-8cbb-45d0-743f-08d64fbb56e4 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4081; x-ms-traffictypediagnostic: AM0PR04MB4081: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231442)(944501410)(52105112)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:AM0PR04MB4081; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4081; x-forefront-prvs: 08635C03D4 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(346002)(396003)(376002)(39860400002)(366004)(199004)(189003)(54534003)(6506007)(386003)(54906003)(2900100001)(105586002)(66066001)(50226002)(26005)(3846002)(102836004)(2501003)(186003)(6486002)(305945005)(7736002)(4326008)(8676002)(478600001)(68736007)(52116002)(106356001)(2351001)(5660300001)(316002)(14454004)(6916009)(5640700003)(81156014)(25786009)(2906002)(81166006)(2616005)(476003)(486006)(86362001)(6436002)(6116002)(97736004)(71190400001)(14444005)(99286004)(53936002)(6512007)(256004)(8936002)(71200400001)(36756003)(32563001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4081; H:AM0PR04MB4211.eurprd04.prod.outlook.com; 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-antispam-message-info: V5AmbHNGQf4zReTX4R7WR0yOt8u80DfCpu4RYCLlEdBYERZKltdBjojsHXHThwvwlWTkikiU8nW9Dv22uNMh6XORaSt+Ad3McB8Y50++2VKlvaOdSIk3h93MuwL332P6V+JPu28SRG4+TrxgZ9ov7Akxlm5vxYcebQSWUmVpQd0xJUdcLaR+SJNHsqtvqWToeM5to/x5R9LZy5M5mR5FrDHTuD8jzWkLQVG1zDF+q6/mFUXqsqVj5kaBrTvlr9n2TQUoqHrILW0OEJ+TVlW0J69lsGL225ACN9IsPYj9QsQeMMY2/zeLX9irJNx02lxa3/SAUqpM693DpVj8vLvIrbOGm8K4Ru/GOciw5SMfliA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e2ca6ce3-8cbb-45d0-743f-08d64fbb56e4 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2018 14:12:16.1357 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4081 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181121_061235_245571_1FFA943B X-CRM114-Status: GOOD ( 15.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aisheng DONG , "sboyd@kernel.org" , "mturquette@baylibre.com" , dl-linux-imx , "kernel@pengutronix.de" , Fabio Estevam , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch series adds i.MX8QXP clock support which is based on the clock service provided by SCU firmware. Note: It depends on SCU driver which has already been merged by Shawn. So this patch series could go through Shawn's tree as well. ChangeLog: v7->v8: * add more kernel doc for lpcg and scu clock structures * remove one unneccessry reg checking v6->v7: * use struct_size() * remove MODULE_ macros * add more kernel docs/code comments * other small improvements * update reviewed-by tags * add the missing PATCH 1 in V6 v5->v6: * simply the driver a lot by re-orgnizing the driver into a few clock types: scu clock (merge scu divider/gate/mux) and scu gpr lock which accessing is through SCU protocol and LPCG clock which is directly accessible by CPU. * LPCG clock is separate from SCU clock, gpr clock is still not used and will be added later. * remove old year license as the code is totally rewritten * scu mux support will be added later as it's also still not used. v4->v5: Address all Stephen and Sascha's review comments, see details in each patch v3->v4: * scu headfile path update * no functionality change v2->v3: * structures/enums name update with imx_sc prefix * no functionality change v1->v2: * structure and enums name update * api usage update due to api change * no functionality change Dong Aisheng (7): clk: imx: add configuration option for mmio clks clk: imx: add scu clock common part dt-bindings: clock: imx8qxp: add SCU clock IDs clk: imx: add imx8qxp clk driver dt-bindings: clock: add imx8qxp lpcg clock binding clk: imx: add lpcg clock support clk: imx: add imx8qxp lpcg driver .../devicetree/bindings/clock/imx8qxp-lpcg.txt | 51 ++++ arch/arm/mach-imx/Kconfig | 11 + drivers/clk/Kconfig | 1 + drivers/clk/imx/Kconfig | 9 + drivers/clk/imx/Makefile | 8 +- drivers/clk/imx/clk-imx8qxp-lpcg.c | 216 +++++++++++++++ drivers/clk/imx/clk-imx8qxp-lpcg.h | 102 ++++++++ drivers/clk/imx/clk-imx8qxp.c | 153 +++++++++++ drivers/clk/imx/clk-lpcg-scu.c | 113 ++++++++ drivers/clk/imx/clk-scu.c | 267 +++++++++++++++++++ drivers/clk/imx/clk-scu.h | 24 ++ include/dt-bindings/clock/imx8qxp-clock.h | 289 +++++++++++++++++++++ 12 files changed, 1243 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/clock/imx8qxp-lpcg.txt create mode 100644 drivers/clk/imx/Kconfig create mode 100644 drivers/clk/imx/clk-imx8qxp-lpcg.c create mode 100644 drivers/clk/imx/clk-imx8qxp-lpcg.h create mode 100644 drivers/clk/imx/clk-imx8qxp.c create mode 100644 drivers/clk/imx/clk-lpcg-scu.c create mode 100644 drivers/clk/imx/clk-scu.c create mode 100644 drivers/clk/imx/clk-scu.h create mode 100644 include/dt-bindings/clock/imx8qxp-clock.h