From patchwork Mon Nov 14 07:04:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 9426647 X-Patchwork-Delegate: sboyd@codeaurora.org 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 8CE4660471 for ; Mon, 14 Nov 2016 07:04:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F79F28910 for ; Mon, 14 Nov 2016 07:04:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 740F028916; Mon, 14 Nov 2016 07:04:45 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 8FB2328910 for ; Mon, 14 Nov 2016 07:04:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753440AbcKNHEm (ORCPT ); Mon, 14 Nov 2016 02:04:42 -0500 Received: from mail-sn1nam02on0067.outbound.protection.outlook.com ([104.47.36.67]:53568 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932708AbcKNHEi (ORCPT ); Mon, 14 Nov 2016 02:04:38 -0500 Received: from BN3PR0301CA0034.namprd03.prod.outlook.com (10.160.180.172) by CY1PR0301MB0748.namprd03.prod.outlook.com (10.160.159.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.721.10; Mon, 14 Nov 2016 07:04:31 +0000 Received: from BN1AFFO11FD020.protection.gbl (2a01:111:f400:7c10::151) by BN3PR0301CA0034.outlook.office365.com (2a01:111:e400:4000::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.707.6 via Frontend Transport; Mon, 14 Nov 2016 07:04:30 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=fail action=none header.from=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD020.mail.protection.outlook.com (10.58.52.80) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.721.5 via Frontend Transport; Mon, 14 Nov 2016 07:04:30 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:987; Count:10 Received: from b29397-desktop.ap.freescale.net (b29397-desktop.ap.freescale.net [10.192.242.114]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id uAE74CO6012924; Mon, 14 Nov 2016 00:04:25 -0700 From: Peter Chen To: , , CC: , , , , , , , Bai Ping , Peng Fan , Peter Chen Subject: [PATCH v3 3/3] clk: imx: clk-imx6ul: add clk support for imx6ull Date: Mon, 14 Nov 2016 15:04:22 +0800 Message-ID: <1479107062-15365-4-git-send-email-peter.chen@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479107062-15365-1-git-send-email-peter.chen@nxp.com> References: <1479107062-15365-1-git-send-email-peter.chen@nxp.com> X-IncomingHeaderCount: 10 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131235806703831300; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1109001)(1110001)(336003)(339900001)(199003)(189002)(47776003)(189998001)(7416002)(626004)(92566002)(2950100002)(50226002)(6666003)(85426001)(7846002)(4326007)(586003)(8676002)(2906002)(305945005)(5660300001)(87936001)(8666005)(356003)(77096005)(81156014)(86362001)(97736004)(104016004)(81166006)(8936002)(50986999)(76176999)(2201001)(36756003)(105606002)(33646002)(68736007)(48376002)(5003940100001)(5001770100001)(106466001)(50466002)(7059030)(32563001)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB0748; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD020; 1:XeMKhtexsgF5ra3cn8OQFtywfXy8M6537xkA9XdeHSKGPQ9hAkEpsaZdcnnB2JGbWkYhCDEZHf6naXwPNJ9G+168myzjCkBONg9fMhN91W4crCxqZ3gcH51EOzclLF6W4k8RrfBTHoaeVlfT4gxApn0rpCQ4mdMc3qZF1TZBEtO/9T5MF+6yEAXO6HyKcu9IO3URnRxGKRv5IX3oypRBCXx11I8N4wqhNnaEuVIhaWq5fptPQABH/PXnMC54203hUArKMQCYprdD1lWMs1wzh1ynQ6RGB1ON359B2Ihn34lccC2gvQ0diWMbP8Nvea0Xc0kLfO3LbC4O3oJWrVZNiW4+d1KyK50jrdeE8xPJ8vKWiwHPLFgSjq6/CvP9onmJ3y9gEg4i24JemyiJGkDgAW7lMh5J5V2uTCZwWAd5+UeKbfcj0p19Jo+hpQrKYE1tSIE+jW27zHk4BAGeWF8JpHWG559EyDXUnCjqO9ghnlkHQ7l7PYExfcAILauHCBJ9pyDwrW98VGC+dobXq8QTjTO3K5lEZDLyBg4WoYDzf1Q+oQbvzz3CfVVgofySMfNUB5IjcNVPCPgXbAcE04WvX5XYQC/saUk+679FjCXDOyiK/T2OBYShV5Ab2c4vsJKDTjJDZnJApd91Yz9Y8JMIZbjuHL3nl3jIuVO0NPne37aO6BBt+B3ulJXXfiFgftjcvVFfCqaQfcGg6230PidbNZ6E2U+rkdjFMdXSToyGwwwYSK0Ax9mDV0h8Qm3s0I52 MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0748; 2:W0EseUDci5VvFVV8f45/ReXAanesfKgD24adXMqiGzDhf2LVkImnRE/Tj4AVQDU+SRminMcIA12oVjDmO4E8ZFIf9l+vwHW9wYG69aBBAF+OgnqN5+dVmjHgkPXnRBG4gQ7Gd7ZwDj+URUuIU2E2MbTVm9BfMZRmEqqRdwtunEg=; 3:vtoT4K5WcowyjXzJoXz8GMi6+Zg4A/sW2aUQJxIvEySPe3UZ4fQyfsNvTurjEpzZY2tMJ1Ej91aJCyRU4be4Ag68L/Z3xvNZmcfF4BTz7LcBfUMdvnB6eL2Q7/ygw/4V5ZX1SRO7koL0NB3/tc7gM2c4B/8t3PP24l1Co59Ly61qX0ljdKuNLHgw9qCvJ4LujYcBsRD0T9/XKiCmTXSIoTQjXk5Ug+Wrr+oyVkvSTDp6pZjCDL9WNBv6Ik65ePjPGG0gtUd5hpofIB9W8qh/Eg== X-MS-Office365-Filtering-Correlation-Id: 4b349863-3ca5-44f1-1f5d-08d40c5c7acb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0301MB0748; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0748; 25:ROXb5Ek0y+o2r91HEGb+uCpxgv+QKZJVV32M5qy1RpLbUL5gjbYNU7D9nMoTjoT0cEePjP4cSU8vUVKiZTJwXb0fu2l0taXM+xLIQzREHUYjX4w0ROoZCnh4R1hy+14/zGMKZXVKP2wNxAlE2t3r1vA5nyuk4/v6gt8KZdLr43wfY1A8IUZIrmwRMzp0XeTygTl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k1mjGMv9qoWELQnV7di9u4XoSUNgqjbyhO36Tn0wUzp4b7fI5WtZnlOsta93RShdRbNkitkYwx/ojEyuuL3hMT8krV4iMQ6C6SA9NRHNUDoGVWc7RJ1cvov3AN4c5PK361AKUDs87qS1KK9Z5Y9yrA3sQXM1CfmR533TRynDmkNIRWiIZYO4MaMdzMMtx43uKuZHIcRXxfsZUpv6IGfGMBXqc0EG6ATvmbHxCa6h5VMq82f6unHRS4RcaU/RiFt9EPDXAVnIlDnbo5Z2uvHKSZ5jt8y965PSkqlDQr26Rrc9fWtk92Vkvu8Qa6eCHh9Tka55Efv9HmO3NogwyRyBXk/fGBhxwKD10i3PxuhJe4CLtEC3buf/xM3nsxEn/n8mzoRhW0S/B86OwRFIuMMCPa7uY8hgxp X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13023025)(13015025)(8121501046)(13024025)(13018025)(13017025)(5005006)(10201501046)(3002001)(6055026); SRVR:CY1PR0301MB0748; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB0748; X-Forefront-PRVS: 0126A32F74 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB0748; 23:m+/u576FiEHqbo8kM75n41r+kmrg4/SyQyfCBo8?= =?us-ascii?Q?oNic9mqyvkOgDLsFxtjZ4SPbO7ufSHqr4w+So7prYp5dJKS0Wa033mKzJx/E?= =?us-ascii?Q?C5Fq3UKjgGch4j2Cg0qlP+r470SHiOAsqZ8e6CnNdeJg+pV2tp67LluNz4Y0?= =?us-ascii?Q?M9OIjStf/GEyw8jtdErry3p8HyIRpKCurQEmWZSC+u6Z+9BU2O2JtkqIKkoP?= =?us-ascii?Q?yeD6NtiOANwDbQ7f/8BMHfk5tpxYigFmKcBt0KnhWwMFkL0nCsGSounAA09h?= =?us-ascii?Q?FKvaGB96bJghJs9hmnmE9YWy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v5PZMYVhYGmj9XI=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0748; 6:HLbd+Aw69hOj6U7YEGsEJRNtWJ+olm5h+ScWc43Lrj/cMkqkg3WSQfgb3FApUr7qfq4JL6Ew1tBpcLFzdIrEMuObFD53dOR+BcPOKEbzMu8kVR5wSlaE07AVlTGlefUvFcBbU8E/jDszgtuq2F3GPauFQ5qudUnmRkDryfHoTXQb6MR6wUBqD8M3He8yCf4eFsNXBmjACWXdoZUyrMPGcj07etWcZgGK3AWlEJfZ7lbg2LfkJdzjblKXmhHG692y9aJ2aInd/2n+BCyQypkeRYzSky69huRYEaZ6ywXdVKzsx0lq9DoT3l8c3PqgupkO; 5:INTRpXWEbf5r4Wz5sX/qS+EYNWmgPRrgA6O29NHtRW0TiHnrOEAnS62qh3UyY9dadD6P9Tej76CrWZJUUq/DbM589+5ajQ5pbMAfWKL/fKtSWg+PjdytPMynnHY07Don6HBPT5ygXCxdpayzoT+fY/pUpAo9RomHlkWIwrXXW5YyDbMUg0OSpzyKGm7gEXi0; 24:ShImLZ+8Ykmp2DuJrh/QBJq4nmUh576RJ4RpTmRyFa6hSRgUss1/K28Nbm/7uxLu+YYxDG7A3eWpZCR1sR+ukBUBMcxQl8ntCmD//yErHGk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0748; 7:9yaaQhxNiiNFxVrEqGDNgG/3UGyb7U5RZ1Tq1NeojAYAdSiVGVp8yB8uLX1iHf/SkIvWHiS1GNhPNpjffC0lM9gISKjkOPKNxPDV2jTYHBxPhIEdyPJkFsjCPasaFe7Jinew0gsJOc3BI22j4ahri/b9bP/q13/NiORIRf2CVzYFdEJDXqmLc0EBLXidbS7Gf8F4AQTOanP5kzsCI390z+aO+DMxd4p+9qQdY7pMsmxr0AC+xlNSHFobU92++tUWkaDR9u9FlP/PxkmuMq0bw1Is0p3vnp8cAO7n67ztOovj93H7pBM+my0ixV3QLdefN5maKUnUUBOWpDGDD1Jp9Uv4+tbq7MZTtI76JQ27pzA= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2016 07:04:30.0711 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB0748 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 From: Bai Ping imx6ull is the derived SoC from imx6ul Signed-off-by: Peng Fan Signed-off-by: Bai Ping Signed-off-by: Peter Chen --- drivers/clk/imx/clk-imx6ul.c | 72 +++++++++++++++++++++++++++----- include/dt-bindings/clock/imx6ul-clock.h | 15 ++++++- 2 files changed, 75 insertions(+), 12 deletions(-) diff --git a/drivers/clk/imx/clk-imx6ul.c b/drivers/clk/imx/clk-imx6ul.c index d1d7787..75c35fb 100644 --- a/drivers/clk/imx/clk-imx6ul.c +++ b/drivers/clk/imx/clk-imx6ul.c @@ -64,6 +64,10 @@ static const char *perclk_sels[] = { "ipg", "osc", }; static const char *lcdif_sels[] = { "lcdif_podf", "ipp_di0", "ipp_di1", "ldb_di0", "ldb_di1", }; static const char *csi_sels[] = { "osc", "pll2_pfd2_396m", "pll3_120m", "pll3_pfd1_540m", }; static const char *sim_sels[] = { "sim_podf", "ipp_di0", "ipp_di1", "ldb_di0", "ldb_di1", }; +/* epdc_pre_sels, epdc_sels, esai_sels only exists on i.MX6ULL */ +static const char *epdc_pre_sels[] = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0_352m", "pll2_pfd2_396m", "pll3_pfd2_508m", }; +static const char *esai_sels[] = { "pll4_audio_div", "pll3_pfd2_508m", "pll5_video_div", "pll3_usb_otg", }; +static const char *epdc_sels[] = { "epdc_podf", "ipp_di0", "ipp_di1", "ldb_di0", "ldb_di1", }; static struct clk *clks[IMX6UL_CLK_END]; static struct clk_onecell_data clk_data; @@ -102,6 +106,17 @@ static u32 share_count_audio; static u32 share_count_sai1; static u32 share_count_sai2; static u32 share_count_sai3; +static u32 share_count_esai; + +static inline int clk_on_imx6ul(void) +{ + return of_machine_is_compatible("fsl,imx6ul"); +} + +static inline int clk_on_imx6ull(void) +{ + return of_machine_is_compatible("fsl,imx6ull"); +} static void __init imx6ul_clocks_init(struct device_node *ccm_node) { @@ -238,12 +253,19 @@ static void __init imx6ul_clocks_init(struct device_node *ccm_node) clks[IMX6UL_CLK_QSPI1_SEL] = imx_clk_mux("qspi1_sel", base + 0x1c, 7, 3, qspi1_sels, ARRAY_SIZE(qspi1_sels)); clks[IMX6UL_CLK_PERCLK_SEL] = imx_clk_mux("perclk_sel", base + 0x1c, 6, 1, perclk_sels, ARRAY_SIZE(perclk_sels)); clks[IMX6UL_CLK_CAN_SEL] = imx_clk_mux("can_sel", base + 0x20, 8, 2, can_sels, ARRAY_SIZE(can_sels)); + if (clk_on_imx6ull()) + clks[IMX6ULL_CLK_ESAI_SEL] = imx_clk_mux("esai_sel", base + 0x20, 19, 2, esai_sels, ARRAY_SIZE(esai_sels)); clks[IMX6UL_CLK_UART_SEL] = imx_clk_mux("uart_sel", base + 0x24, 6, 1, uart_sels, ARRAY_SIZE(uart_sels)); clks[IMX6UL_CLK_ENFC_SEL] = imx_clk_mux("enfc_sel", base + 0x2c, 15, 3, enfc_sels, ARRAY_SIZE(enfc_sels)); clks[IMX6UL_CLK_LDB_DI0_SEL] = imx_clk_mux("ldb_di0_sel", base + 0x2c, 9, 3, ldb_di0_sels, ARRAY_SIZE(ldb_di0_sels)); clks[IMX6UL_CLK_SPDIF_SEL] = imx_clk_mux("spdif_sel", base + 0x30, 20, 2, spdif_sels, ARRAY_SIZE(spdif_sels)); - clks[IMX6UL_CLK_SIM_PRE_SEL] = imx_clk_mux("sim_pre_sel", base + 0x34, 15, 3, sim_pre_sels, ARRAY_SIZE(sim_pre_sels)); - clks[IMX6UL_CLK_SIM_SEL] = imx_clk_mux("sim_sel", base + 0x34, 9, 3, sim_sels, ARRAY_SIZE(sim_sels)); + if (clk_on_imx6ul()) { + clks[IMX6UL_CLK_SIM_PRE_SEL] = imx_clk_mux("sim_pre_sel", base + 0x34, 15, 3, sim_pre_sels, ARRAY_SIZE(sim_pre_sels)); + clks[IMX6UL_CLK_SIM_SEL] = imx_clk_mux("sim_sel", base + 0x34, 9, 3, sim_sels, ARRAY_SIZE(sim_sels)); + } else if (clk_on_imx6ull()) { + clks[IMX6ULL_CLK_EPDC_PRE_SEL] = imx_clk_mux("epdc_pre_sel", base + 0x34, 15, 3, epdc_pre_sels, ARRAY_SIZE(epdc_pre_sels)); + clks[IMX6ULL_CLK_EPDC_SEL] = imx_clk_mux("epdc_sel", base + 0x34, 9, 3, epdc_sels, ARRAY_SIZE(epdc_sels)); + } clks[IMX6UL_CLK_ECSPI_SEL] = imx_clk_mux("ecspi_sel", base + 0x38, 18, 1, ecspi_sels, ARRAY_SIZE(ecspi_sels)); clks[IMX6UL_CLK_LCDIF_PRE_SEL] = imx_clk_mux("lcdif_pre_sel", base + 0x38, 15, 3, lcdif_pre_sels, ARRAY_SIZE(lcdif_pre_sels)); clks[IMX6UL_CLK_LCDIF_SEL] = imx_clk_mux("lcdif_sel", base + 0x38, 9, 3, lcdif_sels, ARRAY_SIZE(lcdif_sels)); @@ -276,6 +298,10 @@ static void __init imx6ul_clocks_init(struct device_node *ccm_node) clks[IMX6UL_CLK_SAI3_PODF] = imx_clk_divider("sai3_podf", "sai3_pred", base + 0x28, 16, 6); clks[IMX6UL_CLK_SAI1_PRED] = imx_clk_divider("sai1_pred", "sai1_sel", base + 0x28, 6, 3); clks[IMX6UL_CLK_SAI1_PODF] = imx_clk_divider("sai1_podf", "sai1_pred", base + 0x28, 0, 6); + if (clk_on_imx6ull()) { + clks[IMX6ULL_CLK_ESAI_PRED] = imx_clk_divider("esai_pred", "esai_sel", base + 0x28, 9, 3); + clks[IMX6ULL_CLK_ESAI_PODF] = imx_clk_divider("esai_podf", "esai_pred", base + 0x28, 25, 3); + } clks[IMX6UL_CLK_ENFC_PRED] = imx_clk_divider("enfc_pred", "enfc_sel", base + 0x2c, 18, 3); clks[IMX6UL_CLK_ENFC_PODF] = imx_clk_divider("enfc_podf", "enfc_pred", base + 0x2c, 21, 6); clks[IMX6UL_CLK_SAI2_PRED] = imx_clk_divider("sai2_pred", "sai2_sel", base + 0x2c, 6, 3); @@ -298,9 +324,15 @@ static void __init imx6ul_clocks_init(struct device_node *ccm_node) clks[IMX6UL_CLK_APBHDMA] = imx_clk_gate2("apbh_dma", "bch_podf", base + 0x68, 4); clks[IMX6UL_CLK_ASRC_IPG] = imx_clk_gate2_shared("asrc_ipg", "ahb", base + 0x68, 6, &share_count_asrc); clks[IMX6UL_CLK_ASRC_MEM] = imx_clk_gate2_shared("asrc_mem", "ahb", base + 0x68, 6, &share_count_asrc); - clks[IMX6UL_CLK_CAAM_MEM] = imx_clk_gate2("caam_mem", "ahb", base + 0x68, 8); - clks[IMX6UL_CLK_CAAM_ACLK] = imx_clk_gate2("caam_aclk", "ahb", base + 0x68, 10); - clks[IMX6UL_CLK_CAAM_IPG] = imx_clk_gate2("caam_ipg", "ipg", base + 0x68, 12); + if (clk_on_imx6ul()) { + clks[IMX6UL_CLK_CAAM_MEM] = imx_clk_gate2("caam_mem", "ahb", base + 0x68, 8); + clks[IMX6UL_CLK_CAAM_ACLK] = imx_clk_gate2("caam_aclk", "ahb", base + 0x68, 10); + clks[IMX6UL_CLK_CAAM_IPG] = imx_clk_gate2("caam_ipg", "ipg", base + 0x68, 12); + } else if (clk_on_imx6ull()) { + clks[IMX6ULL_CLK_DCP_CLK] = imx_clk_gate2("dcp", "ahb", base + 0x68, 10); + clks[IMX6UL_CLK_ENET] = imx_clk_gate2("enet", "ipg", base + 0x68, 12); + clks[IMX6UL_CLK_ENET_AHB] = imx_clk_gate2("enet_ahb", "ahb", base + 0x68, 12); + } clks[IMX6UL_CLK_CAN1_IPG] = imx_clk_gate2("can1_ipg", "ipg", base + 0x68, 14); clks[IMX6UL_CLK_CAN1_SERIAL] = imx_clk_gate2("can1_serial", "can_podf", base + 0x68, 16); clks[IMX6UL_CLK_CAN2_IPG] = imx_clk_gate2("can2_ipg", "ipg", base + 0x68, 18); @@ -309,7 +341,10 @@ static void __init imx6ul_clocks_init(struct device_node *ccm_node) clks[IMX6UL_CLK_GPT2_SERIAL] = imx_clk_gate2("gpt2_serial", "perclk", base + 0x68, 26); clks[IMX6UL_CLK_UART2_IPG] = imx_clk_gate2("uart2_ipg", "ipg", base + 0x68, 28); clks[IMX6UL_CLK_UART2_SERIAL] = imx_clk_gate2("uart2_serial", "uart_podf", base + 0x68, 28); - clks[IMX6UL_CLK_AIPSTZ3] = imx_clk_gate2("aips_tz3", "ahb", base + 0x68, 30); + if (clk_on_imx6ul()) + clks[IMX6UL_CLK_AIPSTZ3] = imx_clk_gate2("aips_tz3", "ahb", base + 0x68, 30); + else if (clk_on_imx6ull()) + clks[IMX6UL_CLK_AIPSTZ3] = imx_clk_gate2("aips_tz3", "ahb", base + 0x80, 18); /* CCGR1 */ clks[IMX6UL_CLK_ECSPI1] = imx_clk_gate2("ecspi1", "ecspi_podf", base + 0x6c, 0); @@ -328,6 +363,11 @@ static void __init imx6ul_clocks_init(struct device_node *ccm_node) clks[IMX6UL_CLK_UART4_SERIAL] = imx_clk_gate2("uart4_serail", "uart_podf", base + 0x6c, 24); /* CCGR2 */ + if (clk_on_imx6ull()) { + clks[IMX6ULL_CLK_ESAI_EXTAL] = imx_clk_gate2_shared("esai_extal", "esai_podf", base + 0x70, 0, &share_count_esai); + clks[IMX6ULL_CLK_ESAI_IPG] = imx_clk_gate2_shared("esai_ipg", "ahb", base + 0x70, 0, &share_count_esai); + clks[IMX6ULL_CLK_ESAI_MEM] = imx_clk_gate2_shared("esai_mem", "ahb", base + 0x70, 0, &share_count_esai); + } clks[IMX6UL_CLK_CSI] = imx_clk_gate2("csi", "csi_podf", base + 0x70, 2); clks[IMX6UL_CLK_I2C1] = imx_clk_gate2("i2c1", "perclk", base + 0x70, 6); clks[IMX6UL_CLK_I2C2] = imx_clk_gate2("i2c2", "perclk", base + 0x70, 8); @@ -340,8 +380,13 @@ static void __init imx6ul_clocks_init(struct device_node *ccm_node) /* CCGR3 */ clks[IMX6UL_CLK_UART5_IPG] = imx_clk_gate2("uart5_ipg", "ipg", base + 0x74, 2); clks[IMX6UL_CLK_UART5_SERIAL] = imx_clk_gate2("uart5_serial", "uart_podf", base + 0x74, 2); - clks[IMX6UL_CLK_ENET] = imx_clk_gate2("enet", "ipg", base + 0x74, 4); - clks[IMX6UL_CLK_ENET_AHB] = imx_clk_gate2("enet_ahb", "ahb", base + 0x74, 4); + if (clk_on_imx6ul()) { + clks[IMX6UL_CLK_ENET] = imx_clk_gate2("enet", "ipg", base + 0x74, 4); + clks[IMX6UL_CLK_ENET_AHB] = imx_clk_gate2("enet_ahb", "ahb", base + 0x74, 4); + } else if (clk_on_imx6ull()) { + clks[IMX6ULL_CLK_EPDC_ACLK] = imx_clk_gate2("epdc_aclk", "axi", base + 0x74, 4); + clks[IMX6ULL_CLK_EPDC_PIX] = imx_clk_gate2("epdc_pix", "epdc_podf", base + 0x74, 4); + } clks[IMX6UL_CLK_UART6_IPG] = imx_clk_gate2("uart6_ipg", "ipg", base + 0x74, 6); clks[IMX6UL_CLK_UART6_SERIAL] = imx_clk_gate2("uart6_serial", "uart_podf", base + 0x74, 6); clks[IMX6UL_CLK_LCDIF_PIX] = imx_clk_gate2("lcdif_pix", "lcdif_podf", base + 0x74, 10); @@ -385,8 +430,10 @@ static void __init imx6ul_clocks_init(struct device_node *ccm_node) clks[IMX6UL_CLK_USBOH3] = imx_clk_gate2("usboh3", "ipg", base + 0x80, 0); clks[IMX6UL_CLK_USDHC1] = imx_clk_gate2("usdhc1", "usdhc1_podf", base + 0x80, 2); clks[IMX6UL_CLK_USDHC2] = imx_clk_gate2("usdhc2", "usdhc2_podf", base + 0x80, 4); - clks[IMX6UL_CLK_SIM1] = imx_clk_gate2("sim1", "sim_sel", base + 0x80, 6); - clks[IMX6UL_CLK_SIM2] = imx_clk_gate2("sim2", "sim_sel", base + 0x80, 8); + if (clk_on_imx6ul()) { + clks[IMX6UL_CLK_SIM1] = imx_clk_gate2("sim1", "sim_sel", base + 0x80, 6); + clks[IMX6UL_CLK_SIM2] = imx_clk_gate2("sim2", "sim_sel", base + 0x80, 8); + } clks[IMX6UL_CLK_EIM] = imx_clk_gate2("eim", "eim_slow_podf", base + 0x80, 10); clks[IMX6UL_CLK_PWM8] = imx_clk_gate2("pwm8", "perclk", base + 0x80, 16); clks[IMX6UL_CLK_UART8_IPG] = imx_clk_gate2("uart8_ipg", "ipg", base + 0x80, 14); @@ -441,7 +488,10 @@ static void __init imx6ul_clocks_init(struct device_node *ccm_node) } clk_set_parent(clks[IMX6UL_CLK_CAN_SEL], clks[IMX6UL_CLK_PLL3_60M]); - clk_set_parent(clks[IMX6UL_CLK_SIM_PRE_SEL], clks[IMX6UL_CLK_PLL3_USB_OTG]); + if (clk_on_imx6ul()) + clk_set_parent(clks[IMX6UL_CLK_SIM_PRE_SEL], clks[IMX6UL_CLK_PLL3_USB_OTG]); + else if (clk_on_imx6ull()) + clk_set_parent(clks[IMX6ULL_CLK_EPDC_PRE_SEL], clks[IMX6UL_CLK_PLL3_PFD2]); clk_set_parent(clks[IMX6UL_CLK_ENFC_SEL], clks[IMX6UL_CLK_PLL2_PFD2]); } diff --git a/include/dt-bindings/clock/imx6ul-clock.h b/include/dt-bindings/clock/imx6ul-clock.h index fd8aee8..ee9f1a5 100644 --- a/include/dt-bindings/clock/imx6ul-clock.h +++ b/include/dt-bindings/clock/imx6ul-clock.h @@ -236,6 +236,19 @@ #define IMX6UL_CLK_PLL3_120M 223 #define IMX6UL_CLK_KPP 224 -#define IMX6UL_CLK_END 225 +/* For i.MX6ULL */ +#define IMX6ULL_CLK_ESAI_PRED 225 +#define IMX6ULL_CLK_ESAI_PODF 226 +#define IMX6ULL_CLK_ESAI_EXTAL 227 +#define IMX6ULL_CLK_ESAI_MEM 228 +#define IMX6ULL_CLK_ESAI_IPG 229 +#define IMX6ULL_CLK_DCP_CLK 230 +#define IMX6ULL_CLK_EPDC_PRE_SEL 231 +#define IMX6ULL_CLK_EPDC_SEL 232 +#define IMX6ULL_CLK_EPDC_PODF 233 +#define IMX6ULL_CLK_EPDC_ACLK 234 +#define IMX6ULL_CLK_EPDC_PIX 235 +#define IMX6ULL_CLK_ESAI_SEL 236 +#define IMX6UL_CLK_END 237 #endif /* __DT_BINDINGS_CLOCK_IMX6UL_H */