aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/clock-imx6q.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-imx/clock-imx6q.c')
-rw-r--r--arch/arm/mach-imx/clock-imx6q.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/arch/arm/mach-imx/clock-imx6q.c b/arch/arm/mach-imx/clock-imx6q.c
index e0b926dfeced..039a7abb165a 100644
--- a/arch/arm/mach-imx/clock-imx6q.c
+++ b/arch/arm/mach-imx/clock-imx6q.c
@@ -1139,7 +1139,7 @@ static int _clk_set_rate(struct clk *clk, unsigned long rate)
1139 return -EINVAL; 1139 return -EINVAL;
1140 1140
1141 max_div = ((d->bm_pred >> d->bp_pred) + 1) * 1141 max_div = ((d->bm_pred >> d->bp_pred) + 1) *
1142 ((d->bm_pred >> d->bp_pred) + 1); 1142 ((d->bm_podf >> d->bp_podf) + 1);
1143 1143
1144 div = parent_rate / rate; 1144 div = parent_rate / rate;
1145 if (div == 0) 1145 if (div == 0)
@@ -1953,14 +1953,17 @@ static struct map_desc imx6q_clock_desc[] = {
1953 imx_map_entry(MX6Q, ANATOP, MT_DEVICE), 1953 imx_map_entry(MX6Q, ANATOP, MT_DEVICE),
1954}; 1954};
1955 1955
1956void __init imx6q_clock_map_io(void)
1957{
1958 iotable_init(imx6q_clock_desc, ARRAY_SIZE(imx6q_clock_desc));
1959}
1960
1956int __init mx6q_clocks_init(void) 1961int __init mx6q_clocks_init(void)
1957{ 1962{
1958 struct device_node *np; 1963 struct device_node *np;
1959 void __iomem *base; 1964 void __iomem *base;
1960 int i, irq; 1965 int i, irq;
1961 1966
1962 iotable_init(imx6q_clock_desc, ARRAY_SIZE(imx6q_clock_desc));
1963
1964 /* retrieve the freqency of fixed clocks from device tree */ 1967 /* retrieve the freqency of fixed clocks from device tree */
1965 for_each_compatible_node(np, NULL, "fixed-clock") { 1968 for_each_compatible_node(np, NULL, "fixed-clock") {
1966 u32 rate; 1969 u32 rate;
@@ -2002,6 +2005,21 @@ int __init mx6q_clocks_init(void)
2002 clk_set_rate(&asrc_serial_clk, 1500000); 2005 clk_set_rate(&asrc_serial_clk, 1500000);
2003 clk_set_rate(&enfc_clk, 11000000); 2006 clk_set_rate(&enfc_clk, 11000000);
2004 2007
2008 /*
2009 * Before pinctrl API is available, we have to rely on the pad
2010 * configuration set up by bootloader. For usdhc example here,
2011 * u-boot sets up the pads for 49.5 MHz case, and we have to lower
2012 * the usdhc clock from 198 to 49.5 MHz to match the pad configuration.
2013 *
2014 * FIXME: This is should be removed after pinctrl API is available.
2015 * At that time, usdhc driver can call pinctrl API to change pad
2016 * configuration dynamically per different usdhc clock settings.
2017 */
2018 clk_set_rate(&usdhc1_clk, 49500000);
2019 clk_set_rate(&usdhc2_clk, 49500000);
2020 clk_set_rate(&usdhc3_clk, 49500000);
2021 clk_set_rate(&usdhc4_clk, 49500000);
2022
2005 np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpt"); 2023 np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpt");
2006 base = of_iomap(np, 0); 2024 base = of_iomap(np, 0);
2007 WARN_ON(!base); 2025 WARN_ON(!base);