From patchwork Sun Nov 17 23:06:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerhard Sittig X-Patchwork-Id: 3195101 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3F66AC045B for ; Sun, 17 Nov 2013 23:39:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 40E41205E6 for ; Sun, 17 Nov 2013 23:39:02 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 29A67205EA for ; Sun, 17 Nov 2013 23:39:01 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ViBUv-0001JL-E7; Sun, 17 Nov 2013 23:11:21 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ViBUN-0007hm-PK; Sun, 17 Nov 2013 23:10:47 +0000 Received: from mail-out.m-online.net ([212.18.0.9]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ViBTI-0007aN-EK for linux-arm-kernel@lists.infradead.org; Sun, 17 Nov 2013 23:10:11 +0000 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3dN8BG3Ht3z4KK2B; Mon, 18 Nov 2013 00:09:10 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3dN8BG35dLzbbgH; Mon, 18 Nov 2013 00:09:10 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id m1sTfj_Y115x; Mon, 18 Nov 2013 00:09:09 +0100 (CET) X-Auth-Info: Gf06lBhhtpnqQUUF4wSqYqYjESPdFXo+O9qZUgFKc7Q= Received: from localhost (host-82-135-33-74.customer.m-online.net [82.135.33.74]) by mail.mnet-online.de (Postfix) with ESMTPA; Mon, 18 Nov 2013 00:09:09 +0100 (CET) From: Gerhard Sittig To: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Anatolij Gustschin , Mike Turquette Subject: [PATCH v5 17/17] clk: mpc512x: remove migration support workarounds Date: Mon, 18 Nov 2013 00:06:17 +0100 Message-Id: <1384729577-7336-18-git-send-email-gsi@denx.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1384729577-7336-1-git-send-email-gsi@denx.de> References: <1384729577-7336-1-git-send-email-gsi@denx.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131117_181004_834571_0F3DCFF8 X-CRM114-Status: GOOD ( 14.62 ) X-Spam-Score: -1.9 (-) Cc: Scott Wood , Gerhard Sittig , Detlev Zundel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP this change removes workarounds which have become obsolete after migration to common clock support has completed - remove clkdev registration calls (compatibility clock item aliases) after all peripheral drivers were adjusted for device tree based clock lookup - remove pre-enable workarounds after all peripheral drivers were adjusted to acquire their respective clock items workarounds for these clock items get removed: FEC (ethernet), I2C, PSC (UART, SPI), PSC FIFO, USB, NFC (NAND flash), VIU (video capture), BDLC (CAN), CAN MCLK, DIU (video output) these clkdev registered names won't be provided any longer by the MPC512x platform's clock driver: "psc%d_mclk", "mscan%d_mclk", "usb%d_clk", "nfc_clk", "viu_clk", "sys_clk", "ref_clk" the pre-enable workaround for PCI remains, but depends on the presence of PCI related device tree nodes (disables the PCI clock in the absence of PCI nodes, keeps the PCI clock enabled in the presence of nodes) -- moving clock acquisition into the peripheral driver isn't possible for PCI because its initialization takes place before the platform clock driver gets initialized, thus the clock provider isn't available then Cc: Mike Turquette Cc: Anatolij Gustschin Cc: linux-arm-kernel@lists.infradead.org Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Gerhard Sittig --- arch/powerpc/platforms/512x/clock-commonclk.c | 50 ++++++++----------------- 1 file changed, 16 insertions(+), 34 deletions(-) diff --git a/arch/powerpc/platforms/512x/clock-commonclk.c b/arch/powerpc/platforms/512x/clock-commonclk.c index c1faf3a9ea1f..b1fbdcbc68b7 100644 --- a/arch/powerpc/platforms/512x/clock-commonclk.c +++ b/arch/powerpc/platforms/512x/clock-commonclk.c @@ -695,46 +695,28 @@ static void mpc5121_clk_register_of_provider(struct device_node *np) */ static void mpc5121_clk_provide_migration_support(void) { - int idx; - char name[32]; - - /* - * provide "pre-CCF" alias clock names for peripheral drivers - * which have not yet been adjusted to do OF based clock lookups - */ - clk_register_clkdev(clks[MPC512x_CLK_REF], "ref_clk", NULL); - clk_register_clkdev(clks[MPC512x_CLK_SYS], "sys_clk", NULL); - clk_register_clkdev(clks[MPC512x_CLK_VIU], "viu_clk", NULL); - clk_register_clkdev(clks[MPC512x_CLK_NFC], "nfc_clk", NULL); - clk_register_clkdev(clks[MPC512x_CLK_USB1], "usb1_clk", NULL); - clk_register_clkdev(clks[MPC512x_CLK_USB2], "usb2_clk", NULL); - for (idx = 0; idx < NR_PSCS; idx++) { - snprintf(name, sizeof(name), "psc%d_mclk", idx); - clk_register_clkdev(clks[MPC512x_CLK_PSC0_MCLK + idx], - name, NULL); - } - for (idx = 0; idx < NR_MSCANS; idx++) { - snprintf(name, sizeof(name), "mscan%d_mclk", idx); - clk_register_clkdev(clks[MPC512x_CLK_MSCAN0_MCLK + idx], - name, NULL); - } - clk_register_clkdev(clks[MPC512x_CLK_SPDIF_MCLK], "spdif_mclk", NULL); /* * pre-enable those clock items which are not yet appropriately * acquired by their peripheral driver + * + * the PCI clock cannot get acquired by its peripheral driver, + * because for this platform the driver won't probe(), instead + * initialization is done from within the .setup_arch() routine + * at a point in time where the clock provider has not been + * setup yet and thus isn't available yet + * + * so we "pre-enable" the clock here, to not have the clock + * subsystem automatically disable this item in a late init call + * + * this PCI clock pre-enable workaround only applies when there + * are device tree nodes for PCI and thus the peripheral driver + * has attached to bridges, otherwise the PCI clock remains + * unused and so it gets disabled */ - clk_prepare_enable(clks[MPC512x_CLK_PSC_FIFO]); clk_prepare_enable(clks[MPC512x_CLK_PSC3_MCLK]);/* serial console */ - clk_prepare_enable(clks[MPC512x_CLK_FEC]); /* network, NFS */ - clk_prepare_enable(clks[MPC512x_CLK_DIU]); /* display */ - clk_prepare_enable(clks[MPC512x_CLK_I2C]); /* I2C */ - for (idx = 0; idx < NR_PSCS; idx++) /* PSC ipg */ - clk_prepare_enable(clks[MPC512x_CLK_PSC0 + idx]); - clk_prepare_enable(clks[MPC512x_CLK_BDLC]); /* MSCAN ipg */ - for (idx = 0; idx < NR_MSCANS; idx++) /* MSCAN mclk */ - clk_prepare_enable(clks[MPC512x_CLK_MSCAN0_MCLK + idx]); - clk_prepare_enable(clks[MPC512x_CLK_PCI]); /* PCI */ + if (of_find_compatible_node(NULL, "pci", "fsl,mpc5121-pci")) + clk_prepare_enable(clks[MPC512x_CLK_PCI]); } /*