summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/512x/clock-commonclk.c
diff options
context:
space:
mode:
authorGerhard Sittig <gsi@denx.de>2013-11-30 23:51:37 +0100
committerAnatolij Gustschin <agust@denx.de>2014-01-12 18:53:06 +0100
commit20755f85f3937ea8773ddd149b43654e1ce7bfc9 (patch)
treecd68135f630f0e012c14b02eeab3ba0ce62df216 /arch/powerpc/platforms/512x/clock-commonclk.c
parentba2181271fc9e1ab0873299264fe7edd6e256c56 (diff)
downloadblackbird-obmc-linux-20755f85f3937ea8773ddd149b43654e1ce7bfc9.tar.gz
blackbird-obmc-linux-20755f85f3937ea8773ddd149b43654e1ce7bfc9.zip
clk: mpc512x: remove migration support workarounds
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 <mturquette@linaro.org> Cc: Anatolij Gustschin <agust@denx.de> Cc: linux-arm-kernel@lists.infradead.org Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Gerhard Sittig <gsi@denx.de> Signed-off-by: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'arch/powerpc/platforms/512x/clock-commonclk.c')
-rw-r--r--arch/powerpc/platforms/512x/clock-commonclk.c50
1 files changed, 16 insertions, 34 deletions
diff --git a/arch/powerpc/platforms/512x/clock-commonclk.c b/arch/powerpc/platforms/512x/clock-commonclk.c
index 389c0adde328..29b5fa691f37 100644
--- a/arch/powerpc/platforms/512x/clock-commonclk.c
+++ b/arch/powerpc/platforms/512x/clock-commonclk.c
@@ -696,46 +696,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]);
}
/*
OpenPOWER on IntegriCloud