From patchwork Sun Oct 29 13:48:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 117412 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1527693qgn; Sun, 29 Oct 2017 06:49:58 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SuyK8RiEz1HraMUsdPnNx4Qrke0oImm+29wuEguEk6H5XaTb58GAd/T/eltjkqhPz7E3xS X-Received: by 10.99.7.133 with SMTP id 127mr5175893pgh.147.1509284997914; Sun, 29 Oct 2017 06:49:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509284997; cv=none; d=google.com; s=arc-20160816; b=Zg19Aboq4lDwiSH9aHPrL1iua1rbwyXHzi8Q/oKvWoAKO2FrqLK9pKhBCX8s1E1CDP Aoc8iG9Rh8PB+9yGuNEl6Afm8ju3vdhZUt9oOTAAc5g+m3d3q2B6QV8paomIAv6y5+st M3JMniUlXV+kcgJRhReH04pPisvsnkGf03r3qpos9Oqo6PuDmcjY+OLQv/tB7mwKRVOX o9Yjs8MjfdbyoW0AvYKMNsgY/2qMZLhCcrjeSj1TA03TwpYaINiv1UYj5bdecYf+jVAW 6jVHIPcki3EiSUcZR0Hcjq4y8fwbxaH4XoXUtvdDS8j1WcOESR915BHC/CHuVjZW9pKK WF/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=NH7AjqnFOxvht+/j6IGCbejh+UmZeXfmbRXwD8Y9VqI=; b=N9cts79kU0l/diTqCgCJLxFgAe1MuKUf26WGjNWtDIurg8GohAHNOOU7J+txFB8mZT pioGPZni40YVi68kBNFesaVTcidgcIb0qfl+mdtT6AFndCVNNn/NYv67qjpZQ36z8hgP VvZN+/765hOPSlu2gTNQwKrZykG9JkAv8UUll9JJWc0rukL8LeOcXKHkQadpKbXBzbeL wTwNE7MdUXNHPSmBFQ2bY1iyJ8mw2FdCDLzNYAGSHLNCa/dt5q/PmOq28fNPK/fEXAkt mZ+jp6buf57OTqbkEeDd/tp1yAyUTm7VzbNiUWGlHJBZw/zQ8TMTcU5w0teJoJxGbYBt LpWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H47t3EYy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j90si8781473pfj.47.2017.10.29.06.49.57; Sun, 29 Oct 2017 06:49:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H47t3EYy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751934AbdJ2Nt4 (ORCPT + 27 others); Sun, 29 Oct 2017 09:49:56 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:45271 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751851AbdJ2Ntk (ORCPT ); Sun, 29 Oct 2017 09:49:40 -0400 Received: by mail-pg0-f66.google.com with SMTP id b192so9120525pga.2 for ; Sun, 29 Oct 2017 06:49:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=NH7AjqnFOxvht+/j6IGCbejh+UmZeXfmbRXwD8Y9VqI=; b=H47t3EYynBj3ljlFCvz/iY24HzcGL+FL7OeCq4dFcxf0dQpziSy6kdhlprox2kLrFz 8hAz12vATzErOwu1VNcmLkwKYUmZgi0JtxcOxMNzgAsMvNTImYobe5oYQlGEEEn5mB8I mFlvOkUdVgqejM5581WCJIAnANTzmroLSzTjQ= 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:in-reply-to:references; bh=NH7AjqnFOxvht+/j6IGCbejh+UmZeXfmbRXwD8Y9VqI=; b=q5J5rrkyNsmUR5zl6hcwVihhqLU33SZebj9/X01k0KiMz7mEKxiWty52B/MYbD2HHv p4UMM8zA/TRP/26QWD50e0Y0hccXfo/8ZSTKz1M+tsd219eJcZC+wK2RI9cH4tAv5HYj w5MkA8OsCQoZ4JHMRttriNQ1VT+0lrdTcIbp5ZhpAkQ0Ml3aUYkvuEv2Sgp+J/MycVJL T44Q+XrFUhccflKg7XuUVKPaYEbPFku/7/qZm+iOvCUnix/crDpET4pexM8nuY95nZzK neIfi3QjqsTFAt8/0fG20BXwgPAwckXNZ3qYC52njcva3k3ypcnNmj/YZfNkFxLb6rFy wysw== X-Gm-Message-State: AMCzsaUyIhP1YtxiLzdHGObwKirH04F44cMsOtstrfmoLSnAMT28/mBi 8YLj+knHYIJrXejsbqFjYbkS9Q== X-Received: by 10.99.3.1 with SMTP id 1mr5274036pgd.111.1509284979451; Sun, 29 Oct 2017 06:49:39 -0700 (PDT) Received: from localhost ([122.167.161.211]) by smtp.gmail.com with ESMTPSA id r22sm23676463pfl.15.2017.10.29.06.49.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Oct 2017 06:49:38 -0700 (PDT) From: Viresh Kumar To: Greg Kroah-Hartman Cc: Viresh Kumar , Vincent Guittot , Stephen Boyd , Rajendra Nayak , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, robdclark@gmail.com, s.hauer@pengutronix.de, l.stach@pengutronix.de, shawnguo@kernel.org, fabio.estevam@nxp.com, nm@ti.com, xuwei5@hisilicon.com, robh+dt@kernel.org Subject: [PATCH V4 11/12] boot_constraint: Add support for IMX platform Date: Sun, 29 Oct 2017 19:18:59 +0530 Message-Id: <154e4d17ab6b848fb3ba240d9e2349278a16442a.1509284255.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.15.0.rc1.236.g92ea95045093 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds boot constraint support for IMX platforms. Currently only one use case is supported: earlycon. Some of the UARTs are enabled by the bootloader and are used for early console in the kernel. The boot constraint core handles them properly and removes them once the serial device is probed by its driver. This gets rid of lots of hacky code in the clock drivers. Signed-off-by: Viresh Kumar --- arch/arm/mach-imx/Kconfig | 1 + drivers/boot_constraints/Makefile | 1 + drivers/boot_constraints/imx.c | 113 ++++++++++++++++++++++++++++++++++++++ drivers/clk/imx/clk-imx25.c | 12 ---- drivers/clk/imx/clk-imx27.c | 13 ----- drivers/clk/imx/clk-imx31.c | 12 ---- drivers/clk/imx/clk-imx35.c | 10 ---- drivers/clk/imx/clk-imx51-imx53.c | 16 ------ drivers/clk/imx/clk-imx6q.c | 8 --- drivers/clk/imx/clk-imx6sl.c | 8 --- drivers/clk/imx/clk-imx6sx.c | 8 --- drivers/clk/imx/clk-imx7d.c | 14 ----- drivers/clk/imx/clk.c | 38 ------------- drivers/clk/imx/clk.h | 1 - 14 files changed, 115 insertions(+), 140 deletions(-) create mode 100644 drivers/boot_constraints/imx.c -- 2.15.0.rc1.236.g92ea95045093 diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 782699e67600..9ea1fe32b280 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig @@ -4,6 +4,7 @@ menuconfig ARCH_MXC select ARCH_SUPPORTS_BIG_ENDIAN select CLKSRC_IMX_GPT select GENERIC_IRQ_CHIP + select DEV_BOOT_CONSTRAINTS select GPIOLIB select PINCTRL select PM_OPP if PM diff --git a/drivers/boot_constraints/Makefile b/drivers/boot_constraints/Makefile index 43c89d2458e9..3b5a87fcf099 100644 --- a/drivers/boot_constraints/Makefile +++ b/drivers/boot_constraints/Makefile @@ -3,3 +3,4 @@ obj-y := clk.o deferrable_dev.o core.o pm.o serial.o supply.o obj-$(CONFIG_ARCH_HISI) += hikey.o +obj-$(CONFIG_ARCH_MXC) += imx.o diff --git a/drivers/boot_constraints/imx.c b/drivers/boot_constraints/imx.c new file mode 100644 index 000000000000..a402dfdea1bb --- /dev/null +++ b/drivers/boot_constraints/imx.c @@ -0,0 +1,113 @@ +/* + * This takes care of IMX boot time device constraints, normally set by the + * Bootloader. + * + * Copyright (C) 2017 Linaro. + * Viresh Kumar + * + * This file is released under the GPLv2. + */ + +#include +#include +#include +#include + +struct imx_machine_constraints { + struct dev_boot_constraint_of *dev_constraints; + unsigned int count; +}; + +static struct dev_boot_constraint_clk_info uart_ipg_clk_info = { + .name = "ipg", +}; + +static struct dev_boot_constraint_clk_info uart_per_clk_info = { + .name = "per", +}; + +static struct dev_boot_constraint imx_uart_constraints[] = { + { + .type = DEV_BOOT_CONSTRAINT_CLK, + .data = &uart_ipg_clk_info, + }, { + .type = DEV_BOOT_CONSTRAINT_CLK, + .data = &uart_per_clk_info, + }, +}; + +static struct dev_boot_constraint_of imx_dev_constraints[] = { + { + .compat = "fsl,imx21-uart", + .constraints = imx_uart_constraints, + .count = ARRAY_SIZE(imx_uart_constraints), + }, +}; + +static struct imx_machine_constraints imx_constraints = { + .dev_constraints = imx_dev_constraints, + .count = ARRAY_SIZE(imx_dev_constraints), +}; + +/* imx7 */ +static struct dev_boot_constraint_of imx7_dev_constraints[] = { + { + .compat = "fsl,imx6q-uart", + .constraints = imx_uart_constraints, + .count = ARRAY_SIZE(imx_uart_constraints), + }, +}; + +static struct imx_machine_constraints imx7_constraints = { + .dev_constraints = imx7_dev_constraints, + .count = ARRAY_SIZE(imx7_dev_constraints), +}; + +static const struct of_device_id machines[] __initconst = { + { .compatible = "fsl,imx25", .data = &imx_constraints }, + { .compatible = "fsl,imx27", .data = &imx_constraints }, + { .compatible = "fsl,imx31", .data = &imx_constraints }, + { .compatible = "fsl,imx35", .data = &imx_constraints }, + { .compatible = "fsl,imx50", .data = &imx_constraints }, + { .compatible = "fsl,imx51", .data = &imx_constraints }, + { .compatible = "fsl,imx53", .data = &imx_constraints }, + { .compatible = "fsl,imx6dl", .data = &imx_constraints }, + { .compatible = "fsl,imx6q", .data = &imx_constraints }, + { .compatible = "fsl,imx6qp", .data = &imx_constraints }, + { .compatible = "fsl,imx6sl", .data = &imx_constraints }, + { .compatible = "fsl,imx6sx", .data = &imx_constraints }, + { .compatible = "fsl,imx6ul", .data = &imx_constraints }, + { .compatible = "fsl,imx6ull", .data = &imx_constraints }, + { .compatible = "fsl,imx7d", .data = &imx7_constraints }, + { .compatible = "fsl,imx7s", .data = &imx7_constraints }, + { } +}; + +static int __init imx_constraints_init(void) +{ + const struct imx_machine_constraints *constraints; + const struct of_device_id *match; + struct device_node *np; + + if (!boot_constraint_earlycon_enabled()) + return 0; + + np = of_find_node_by_path("/"); + if (!np) + return -ENODEV; + + match = of_match_node(machines, np); + of_node_put(np); + + if (!match) + return 0; + + constraints = match->data; + BUG_ON(!constraints); + + dev_boot_constraint_add_deferrable_of(constraints->dev_constraints, + constraints->count); + + return 0; +} +subsys_initcall(imx_constraints_init); diff --git a/drivers/clk/imx/clk-imx25.c b/drivers/clk/imx/clk-imx25.c index 23686f756b5e..4df652cd912c 100644 --- a/drivers/clk/imx/clk-imx25.c +++ b/drivers/clk/imx/clk-imx25.c @@ -86,16 +86,6 @@ enum mx25_clks { static struct clk *clk[clk_max]; -static struct clk ** const uart_clks[] __initconst = { - &clk[uart_ipg_per], - &clk[uart1_ipg], - &clk[uart2_ipg], - &clk[uart3_ipg], - &clk[uart4_ipg], - &clk[uart5_ipg], - NULL -}; - static int __init __mx25_clocks_init(void __iomem *ccm_base) { BUG_ON(!ccm_base); @@ -241,8 +231,6 @@ static int __init __mx25_clocks_init(void __iomem *ccm_base) */ clk_set_parent(clk[cko_sel], clk[ipg]); - imx_register_uart_clocks(uart_clks); - return 0; } diff --git a/drivers/clk/imx/clk-imx27.c b/drivers/clk/imx/clk-imx27.c index cf5cf75a4848..646d2075b510 100644 --- a/drivers/clk/imx/clk-imx27.c +++ b/drivers/clk/imx/clk-imx27.c @@ -47,17 +47,6 @@ static const char *ssi_sel_clks[] = { "spll_gate", "mpll", }; static struct clk *clk[IMX27_CLK_MAX]; static struct clk_onecell_data clk_data; -static struct clk ** const uart_clks[] __initconst = { - &clk[IMX27_CLK_PER1_GATE], - &clk[IMX27_CLK_UART1_IPG_GATE], - &clk[IMX27_CLK_UART2_IPG_GATE], - &clk[IMX27_CLK_UART3_IPG_GATE], - &clk[IMX27_CLK_UART4_IPG_GATE], - &clk[IMX27_CLK_UART5_IPG_GATE], - &clk[IMX27_CLK_UART6_IPG_GATE], - NULL -}; - static void __init _mx27_clocks_init(unsigned long fref) { BUG_ON(!ccm); @@ -174,8 +163,6 @@ static void __init _mx27_clocks_init(unsigned long fref) clk_prepare_enable(clk[IMX27_CLK_EMI_AHB_GATE]); - imx_register_uart_clocks(uart_clks); - imx_print_silicon_rev("i.MX27", mx27_revision()); } diff --git a/drivers/clk/imx/clk-imx31.c b/drivers/clk/imx/clk-imx31.c index cbce308aad04..d0a720b61aca 100644 --- a/drivers/clk/imx/clk-imx31.c +++ b/drivers/clk/imx/clk-imx31.c @@ -63,16 +63,6 @@ enum mx31_clks { static struct clk *clk[clk_max]; static struct clk_onecell_data clk_data; -static struct clk ** const uart_clks[] __initconst = { - &clk[ipg], - &clk[uart1_gate], - &clk[uart2_gate], - &clk[uart3_gate], - &clk[uart4_gate], - &clk[uart5_gate], - NULL -}; - static void __init _mx31_clocks_init(void __iomem *base, unsigned long fref) { clk[dummy] = imx_clk_fixed("dummy", 0); @@ -208,8 +198,6 @@ int __init mx31_clocks_init(unsigned long fref) clk_register_clkdev(clk[sdma_gate], NULL, "imx31-sdma"); clk_register_clkdev(clk[iim_gate], "iim", NULL); - - imx_register_uart_clocks(uart_clks); mxc_timer_init(MX31_GPT1_BASE_ADDR, MX31_INT_GPT, GPT_TYPE_IMX31); return 0; diff --git a/drivers/clk/imx/clk-imx35.c b/drivers/clk/imx/clk-imx35.c index 203cad6c9aab..081aacd2335b 100644 --- a/drivers/clk/imx/clk-imx35.c +++ b/drivers/clk/imx/clk-imx35.c @@ -86,14 +86,6 @@ enum mx35_clks { static struct clk *clk[clk_max]; -static struct clk ** const uart_clks[] __initconst = { - &clk[ipg], - &clk[uart1_gate], - &clk[uart2_gate], - &clk[uart3_gate], - NULL -}; - static void __init _mx35_clocks_init(void) { void __iomem *base; @@ -247,8 +239,6 @@ static void __init _mx35_clocks_init(void) */ clk_prepare_enable(clk[scc_gate]); - imx_register_uart_clocks(uart_clks); - imx_print_silicon_rev("i.MX35", mx35_revision()); } diff --git a/drivers/clk/imx/clk-imx51-imx53.c b/drivers/clk/imx/clk-imx51-imx53.c index 7bcaf270db11..2da06f8ffae1 100644 --- a/drivers/clk/imx/clk-imx51-imx53.c +++ b/drivers/clk/imx/clk-imx51-imx53.c @@ -131,20 +131,6 @@ static const char *ieee1588_sels[] = { "pll3_sw", "pll4_sw", "dummy" /* usbphy2_ static struct clk *clk[IMX5_CLK_END]; static struct clk_onecell_data clk_data; -static struct clk ** const uart_clks[] __initconst = { - &clk[IMX5_CLK_UART1_IPG_GATE], - &clk[IMX5_CLK_UART1_PER_GATE], - &clk[IMX5_CLK_UART2_IPG_GATE], - &clk[IMX5_CLK_UART2_PER_GATE], - &clk[IMX5_CLK_UART3_IPG_GATE], - &clk[IMX5_CLK_UART3_PER_GATE], - &clk[IMX5_CLK_UART4_IPG_GATE], - &clk[IMX5_CLK_UART4_PER_GATE], - &clk[IMX5_CLK_UART5_IPG_GATE], - &clk[IMX5_CLK_UART5_PER_GATE], - NULL -}; - static void __init mx5_clocks_common_init(void __iomem *ccm_base) { clk[IMX5_CLK_DUMMY] = imx_clk_fixed("dummy", 0); @@ -325,8 +311,6 @@ static void __init mx5_clocks_common_init(void __iomem *ccm_base) clk_prepare_enable(clk[IMX5_CLK_TMAX1]); clk_prepare_enable(clk[IMX5_CLK_TMAX2]); /* esdhc2, fec */ clk_prepare_enable(clk[IMX5_CLK_TMAX3]); /* esdhc1, esdhc4 */ - - imx_register_uart_clocks(uart_clks); } static void __init mx50_clocks_init(struct device_node *np) diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c index c07df719b8a3..5af256a076a1 100644 --- a/drivers/clk/imx/clk-imx6q.c +++ b/drivers/clk/imx/clk-imx6q.c @@ -150,12 +150,6 @@ static inline int clk_on_imx6dl(void) return of_machine_is_compatible("fsl,imx6dl"); } -static struct clk ** const uart_clks[] __initconst = { - &clk[IMX6QDL_CLK_UART_IPG], - &clk[IMX6QDL_CLK_UART_SERIAL], - NULL -}; - static int ldb_di_sel_by_clock_id(int clock_id) { switch (clock_id) { @@ -918,7 +912,5 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) clk_set_parent(clk[IMX6QDL_CLK_GPU2D_CORE_SEL], clk[IMX6QDL_CLK_PLL3_USB_OTG]); } - - imx_register_uart_clocks(uart_clks); } CLK_OF_DECLARE(imx6q, "fsl,imx6q-ccm", imx6q_clocks_init); diff --git a/drivers/clk/imx/clk-imx6sl.c b/drivers/clk/imx/clk-imx6sl.c index 9642cdf0fb88..97ab67783609 100644 --- a/drivers/clk/imx/clk-imx6sl.c +++ b/drivers/clk/imx/clk-imx6sl.c @@ -185,12 +185,6 @@ void imx6sl_set_wait_clk(bool enter) imx6sl_enable_pll_arm(false); } -static struct clk ** const uart_clks[] __initconst = { - &clks[IMX6SL_CLK_UART], - &clks[IMX6SL_CLK_UART_SERIAL], - NULL -}; - static void __init imx6sl_clocks_init(struct device_node *ccm_node) { struct device_node *np; @@ -447,7 +441,5 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node) clk_set_parent(clks[IMX6SL_CLK_LCDIF_AXI_SEL], clks[IMX6SL_CLK_PLL2_PFD2]); - - imx_register_uart_clocks(uart_clks); } CLK_OF_DECLARE(imx6sl, "fsl,imx6sl-ccm", imx6sl_clocks_init); diff --git a/drivers/clk/imx/clk-imx6sx.c b/drivers/clk/imx/clk-imx6sx.c index e6d389e333d7..e38dfb855ae8 100644 --- a/drivers/clk/imx/clk-imx6sx.c +++ b/drivers/clk/imx/clk-imx6sx.c @@ -137,12 +137,6 @@ static u32 share_count_ssi3; static u32 share_count_sai1; static u32 share_count_sai2; -static struct clk ** const uart_clks[] __initconst = { - &clks[IMX6SX_CLK_UART_IPG], - &clks[IMX6SX_CLK_UART_SERIAL], - NULL -}; - static void __init imx6sx_clocks_init(struct device_node *ccm_node) { struct device_node *np; @@ -566,7 +560,5 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node) clk_set_parent(clks[IMX6SX_CLK_QSPI1_SEL], clks[IMX6SX_CLK_PLL2_BUS]); clk_set_parent(clks[IMX6SX_CLK_QSPI2_SEL], clks[IMX6SX_CLK_PLL2_BUS]); - - imx_register_uart_clocks(uart_clks); } CLK_OF_DECLARE(imx6sx, "fsl,imx6sx-ccm", imx6sx_clocks_init); diff --git a/drivers/clk/imx/clk-imx7d.c b/drivers/clk/imx/clk-imx7d.c index 2305699db467..ec919758b2ae 100644 --- a/drivers/clk/imx/clk-imx7d.c +++ b/drivers/clk/imx/clk-imx7d.c @@ -392,17 +392,6 @@ static int const clks_init_on[] __initconst = { static struct clk_onecell_data clk_data; -static struct clk ** const uart_clks[] __initconst = { - &clks[IMX7D_UART1_ROOT_CLK], - &clks[IMX7D_UART2_ROOT_CLK], - &clks[IMX7D_UART3_ROOT_CLK], - &clks[IMX7D_UART4_ROOT_CLK], - &clks[IMX7D_UART5_ROOT_CLK], - &clks[IMX7D_UART6_ROOT_CLK], - &clks[IMX7D_UART7_ROOT_CLK], - NULL -}; - static void __init imx7d_clocks_init(struct device_node *ccm_node) { struct device_node *np; @@ -893,8 +882,5 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node) /* set uart module clock's parent clock source that must be great then 80MHz */ clk_set_parent(clks[IMX7D_UART1_ROOT_SRC], clks[IMX7D_OSC_24M_CLK]); - - imx_register_uart_clocks(uart_clks); - } CLK_OF_DECLARE(imx7d, "fsl,imx7d-ccm", imx7d_clocks_init); diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c index a634b1185be3..df12b5307175 100644 --- a/drivers/clk/imx/clk.c +++ b/drivers/clk/imx/clk.c @@ -73,41 +73,3 @@ void imx_cscmr1_fixup(u32 *val) *val ^= CSCMR1_FIXUP; return; } - -static int imx_keep_uart_clocks __initdata; -static struct clk ** const *imx_uart_clocks __initdata; - -static int __init imx_keep_uart_clocks_param(char *str) -{ - imx_keep_uart_clocks = 1; - - return 0; -} -__setup_param("earlycon", imx_keep_uart_earlycon, - imx_keep_uart_clocks_param, 0); -__setup_param("earlyprintk", imx_keep_uart_earlyprintk, - imx_keep_uart_clocks_param, 0); - -void __init imx_register_uart_clocks(struct clk ** const clks[]) -{ - if (imx_keep_uart_clocks) { - int i; - - imx_uart_clocks = clks; - for (i = 0; imx_uart_clocks[i]; i++) - clk_prepare_enable(*imx_uart_clocks[i]); - } -} - -static int __init imx_clk_disable_uart(void) -{ - if (imx_keep_uart_clocks && imx_uart_clocks) { - int i; - - for (i = 0; imx_uart_clocks[i]; i++) - clk_disable_unprepare(*imx_uart_clocks[i]); - } - - return 0; -} -late_initcall_sync(imx_clk_disable_uart); diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index d54f0720afba..6fda6e1d181f 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -7,7 +7,6 @@ extern spinlock_t imx_ccm_lock; void imx_check_clocks(struct clk *clks[], unsigned int count); -void imx_register_uart_clocks(struct clk ** const clks[]); extern void imx_cscmr1_fixup(u32 *val);