From patchwork Tue Nov 1 03:02:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 9406847 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 EFE17600C8 for ; Tue, 1 Nov 2016 03:17:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E361F29435 for ; Tue, 1 Nov 2016 03:17:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1F4129439; Tue, 1 Nov 2016 03:17:31 +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=unavailable 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 E893929435 for ; Tue, 1 Nov 2016 03:17:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965418AbcKADRa (ORCPT ); Mon, 31 Oct 2016 23:17:30 -0400 Received: from mail-sn1nam02on0058.outbound.protection.outlook.com ([104.47.36.58]:54150 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965416AbcKADRa (ORCPT ); Mon, 31 Oct 2016 23:17:30 -0400 X-Greylist: delayed 891 seconds by postgrey-1.27 at vger.kernel.org; Mon, 31 Oct 2016 23:17:29 EDT Received: from BN6PR03CA0008.namprd03.prod.outlook.com (10.168.230.146) by CO2PR03MB2373.namprd03.prod.outlook.com (10.166.93.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12; Tue, 1 Nov 2016 03:02:42 +0000 Received: from BY2FFO11FD011.protection.gbl (2a01:111:f400:7c0c::112) by BN6PR03CA0008.outlook.office365.com (2603:10b6:404:23::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12 via Frontend Transport; Tue, 1 Nov 2016 03:02:41 +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 BY2FFO11FD011.mail.protection.outlook.com (10.1.14.129) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.693.6 via Frontend Transport; Tue, 1 Nov 2016 03:02:40 +0000 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 uA132NuV024320; Mon, 31 Oct 2016 20:02:36 -0700 From: Peter Chen To: , , CC: , , , , , , , Bai Ping , Peng Fan , Peter Chen Subject: [PATCH 3/3] clk: imx: clk-imx6ul: add clk support for imx6ull Date: Tue, 1 Nov 2016 11:02:23 +0800 Message-ID: <1477969343-19887-4-git-send-email-peter.chen@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477969343-19887-1-git-send-email-peter.chen@nxp.com> References: <1477969343-19887-1-git-send-email-peter.chen@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131224429610844461; (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)(1110001)(1109001)(339900001)(199003)(189002)(50466002)(48376002)(85426001)(2201001)(105606002)(81166006)(2950100002)(36756003)(7416002)(229853001)(106466001)(33646002)(86362001)(87936001)(19580405001)(92566002)(8666005)(7846002)(305945005)(356003)(5660300001)(19580395003)(8676002)(81156014)(77096005)(47776003)(104016004)(189998001)(2906002)(586003)(5001770100001)(76176999)(97736004)(50986999)(68736007)(5003940100001)(8936002)(6666003)(50226002)(626004)(4326007)(7059030)(32563001)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2373; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD011; 1:Tx+NyYYsCREKtTzsngwFxwskNifFXDD2IChOgv1CawXgJezqLgV+BMjbTSokwgxaOehyIxBi56xLz098VTuND8NFL/caW5Fv9tLjDXjG/CeUodCDWX+156oov3rRiV5s5Lb0T7LowbPoP7FD/wt5RNxgEorAmzR+gwxRGuRj9FXtYDzOCb+ndsNp6a4bifqItUDXktj4RJauRHzdI9lYH6qikJTnsNUeVHeJQMK2K6XuhOyN0Ry0Y62CkcPd5jv7EkbMrpUmRFTLt1uSDfJxz3narfkR++9LjkLOs+HSR5qb8fp3hd2vnJ4Uxbqc3JzIQ0tuvkdqRAHu4vbRSD7OA2n/UCjAN8oe9AZtfGNv5ZF30OfdcVIb4JNeSgtKmI4t5et7wbJT8Y4HYCM3fEOeXdaYxaEA54gJNfM/glNPH6LnrzswXCOlsnR5CpTCui/86w2FDY89jZMqahS4thhol5Xxy1SGosHeW03aDL1q+HAFcuq3r/ZrHR+JfTkkLiqtpvlKICi6BL1FOfLy8eI2keLiYsHO9Pi3DABI9SIQY4JGefW2DaMcWTtWk1JIOERP89qG8nX8BHbUZXFSx8RogflvKHqAYr6MiooZIzkLDA1Grb03ldJRksDURC2KhDxawTb5uMQL++fsE0AT8pzpwcMK5nzzyvFYi3TqA8e87oIYVZT4C/ndcNuL2lYZf98WjRWhJBf5FSh0A0OMugeBlULdPU23kFjR7LCvyVAIaDmjDaI6haCWlUTAKrphAT2n MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 591868b7-eec5-401c-54c4-08d402038b30 X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2373; 2:lgSOVA5Z5K4vbU+eWWaC9V7fqDI/qxvj8taPHh37x8njX2aIy9zJ+f1/FuQMh3AHBdq8004x7FDkAhq3tezSwhePpkT0S4jJt2KD/ai15EMUHnhQncUFo5RvsV+6/9WTcjYty90bSG+o4OqwsIzUIrDHzx1Y1k08xz8W+PoFkxh3m0RqanJVyEzWOgIl7e2XVroFKoPWdIwaSeVgZqDEXw==; 3:m8qlMbjvVFNcp+uh251tWPoQiuIsHfzAmf5bYOu4ZqacxEq2gcWJQFP/HVjLuMRp9KAB6lzBO9cWNU2YJ5B+gGiJiL1T0fgQvHAuLj/Du5SnoC8P4PDisJnuYQJ4xHfShf5qiXmNeZ3AkLty7T9i2qypvQh8wXkRn5mqp+Bpf5XqyNkk06C+m3K72rn4vMMQjF+zyU1fB1tZjhYIQRmMRJDFNgP51bps6ANJLRIv5DzBlhMwC71TzbiEMP1uJeWx X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR03MB2373; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2373; 25:08QDcfocxVRoIcZGSNuU2NUSa7TEZMLsZDl8BuyR5C5EZ8Cucwl8LffZ38B18QSuXnkZyFOTf93xQCe0EJElvUSIFpPPsh20Zkr2jQlDOQP2aULq/oLf6c8XUkUf3BPzvvxXbKVYlQ3z83AVC+WeFUh+ZOB0gJENF2XaErKD+GPsnAuxoKabc2vye6K4dv4NnNnc+12R89rV2zw5h2DVeqvnrB5uW4xlVGjZBIipMQvzk7/+mvC2JoBzSc+Rv24fQ5XfwYpEQCP5dLxqKb2IHy8LTXSuUc8AS05kO837wxTZv4vhYxLSvXE0gckrKcO+LSPuxfq/sA7AHzbLi5P2msvx7naQFVQ9qowC7C5kwRrlkTRkmDSP4uY5jgbSk7xMLUNPrVRbgCU0S2kL5pChylZl131P6PI6OV6anF77gUzL0wl4fhN9S3q569lBQgslFC9xxPTUBnoESHGGI/hR/A==; 31:87Kpur56jBHByXFUYMuy/ZJYXVWpc/591BjL943eHINKWoK/q60UHV6a1xnjR0qXbJ/hDYB9kCmf+UAS1hsrKPJ1nGWEoyCCWnzg5oZfsFFnMF5+tVRuWlYu19tsXXFTiSe6+ZALX9fETrZ+ryGLImVK0mQ8WQUeumP4mrcidYjI743ogEhV9UbsmHyyvwT1Z8zXw+sB7/PnaRtE0DnAcLnhUcv7fWDaQ25C1cO2eqhSc8AyxlrJGyK70XfgxyQa6YnGDN/kPaEkTt/0g5siFhLsMIhUOtOip8GkgG6LHik= 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)(8121501046)(5005006)(13018025)(13017025)(13015025)(13023025)(13024025)(10201501046)(3002001)(6055026); SRVR:CO2PR03MB2373; BCL:0; PCL:0; RULEID:(400006); SRVR:CO2PR03MB2373; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2373; 4:ctwiesptmN+i+Pn11pjiMkEgRiOnBFeMwDA90eKTGMzSmHkfB158yqi9TFlkIuTpQvut29hkLJ/0Ko6PCdXEfmxKLBiqbBcS6NveslQr4Vqe/APRYr4aJ0tirI+MpJDN2/JLflrHGKFzuZmIBhFFfEbgRwdLNchRkfGMIXioS8SkbnjNNFNz1s+kd0hxeYwY09Fc1QrAWhmO070jN2MB9Rot1mcr+e62791ntMCRxQH80PNljxYpoVdJ8vrzLrLnlVPLI4VwKH9WdYtv1xuFF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koI6FI/kPgg3LbGhCnsq+reoQCPeS1cxotXqkF6Hva9kcl8dAJUc9aHHiXjQj2rlb1IF8+F0gLlGChPN2LMx8P6gRwOLQOr8AVBjhIWZ008XGq; 5:5d3rkPujzoJEe9Lvu1bM55GTyJmvtrKnV3HzM5aORKNNxRzumnAOZ0jZKAJNmnUgza/Ov0kBPWJtj4pmJBfTYAGyn8+XH+eD4k467xDF/YbBiBLFgE7U4aYksH4eAxFu6IHdvUOPe23hwEeW6V00CTHvmdpmNP2qqMMvwfuCmyaZ4WV2YcDqlNe86r+NneKg; 24:wmT7JbpaSvkj85A8I2DahhRkK8Hh29UltmUS0g/TNL/FaF7kmB9yWWZQsLVZCwCuxa8lDatfZ+uULzcA/vqryabLDKGI6qv7eRmtdw81tF0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2373; 7:iuWGA7voeuRm3FPP/RP2JuCOio2K0j2GWVcSTdtfb/8SzgngVL0JtufqdaMZtC1t1mo7+c7AmtTBxC5/njWWKfrjZZ9tBRJDBOv9MiEFt7GWT4KO7m9BhIZuYM8NbJ4gOrV3FHCnrfSsJlTBKeKlyE4PR5P1t0QBlunImEoaU5OX/9HPSPavjr8/zYLjhxTdoV16YOjMqok99jtAIYDqgdFZvhSIUygWEhN4a1ZYSVG+0Jtpl6rp1t3mrjehPnvdTNBAJS/gRN/0YJVsPHRQvjw5QRUomeDnP/fkUwCMgDC+qaAZ6BgZzPRkwLG+aGNfJ7tZ0fUH6lJ0MU8lw/5wdtKYv5GBQD9GlPoqOcCQojo= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2016 03:02:40.7412 (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: CO2PR03MB2373 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 Cc: Michael Turquette Cc: Stephen Boyd Signed-off-by: Peng Fan Signed-off-by: Bai Ping Signed-off-by: Peter Chen --- drivers/clk/imx/clk-imx6ul.c | 74 +++++++++++++++++++++++++++----- include/dt-bindings/clock/imx6ul-clock.h | 15 ++++++- 2 files changed, 77 insertions(+), 12 deletions(-) diff --git a/drivers/clk/imx/clk-imx6ul.c b/drivers/clk/imx/clk-imx6ul.c index d1d7787..ceb99a7 100644 --- a/drivers/clk/imx/clk-imx6ul.c +++ b/drivers/clk/imx/clk-imx6ul.c @@ -64,6 +64,11 @@ 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 +107,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 +254,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[IMX6UL_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[IMX6UL_CLK_EPDC_PRE_SEL] = imx_clk_mux("epdc_pre_sel", base + 0x34, 15, 3, epdc_pre_sels, ARRAY_SIZE(epdc_pre_sels)); + clks[IMX6UL_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 +299,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[IMX6UL_CLK_ESAI_PRED] = imx_clk_divider("esai_pred", "esai_sel", base + 0x28, 9, 3); + clks[IMX6UL_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 +325,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[IMX6UL_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 +342,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 +364,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[IMX6UL_CLK_ESAI_EXTAL] = imx_clk_gate2_shared("esai_extal", "esai_podf", base + 0x70, 0, &share_count_esai); + clks[IMX6UL_CLK_ESAI_IPG] = imx_clk_gate2_shared("esai_ipg", "ahb", base + 0x70, 0, &share_count_esai); + clks[IMX6UL_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 +381,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[IMX6UL_CLK_EPDC_ACLK] = imx_clk_gate2("epdc_aclk", "axi", base + 0x74, 4); + clks[IMX6UL_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 +431,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); @@ -430,6 +478,7 @@ static void __init imx6ul_clocks_init(struct device_node *ccm_node) clk_set_rate(clks[IMX6UL_CLK_ENET_REF], 50000000); clk_set_rate(clks[IMX6UL_CLK_ENET2_REF], 50000000); clk_set_rate(clks[IMX6UL_CLK_CSI], 24000000); + clk_set_rate(clks[IMX6UL_CLK_PLL3_PFD2], 320000000); /* keep all the clks on just for bringup */ for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) @@ -441,7 +490,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[IMX6UL_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..563fd5b 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 IMX6UL_CLK_ESAI_PRED 225 +#define IMX6UL_CLK_ESAI_PODF 226 +#define IMX6UL_CLK_ESAI_EXTAL 227 +#define IMX6UL_CLK_ESAI_MEM 228 +#define IMX6UL_CLK_ESAI_IPG 229 +#define IMX6UL_CLK_DCP_CLK 230 +#define IMX6UL_CLK_EPDC_PRE_SEL 231 +#define IMX6UL_CLK_EPDC_SEL 232 +#define IMX6UL_CLK_EPDC_PODF 233 +#define IMX6UL_CLK_EPDC_ACLK 234 +#define IMX6UL_CLK_EPDC_PIX 235 +#define IMX6UL_CLK_ESAI_SEL 236 +#define IMX6UL_CLK_END 237 #endif /* __DT_BINDINGS_CLOCK_IMX6UL_H */