Commit 396a4ea845bc6bf55b88ed101b967c00bf22d68b

Authored by Lokesh Vutla
1 parent a3d5de9966

ARM: k2e/l: Apply WA for selecting PA clock source

On keystone2 Lamarr and Edison platforms, the PA clocksource
mux in PLL REG1, can be changed only after enabling its clock
domain.
So selecting the output of PASS PLL as input to PA only after
enabling the clockdomain.
This is as per the debug done by "Vitaly Andrianov <vitalya@ti.com>"
and based on the previous work done by "Hao Zhang <hzhang@ti.com>"

Fixes: d634a0775bcf ("ARM: keystone2: Cleanup PLL init code")
Reported-by: Vitaly Andrianov <vitalya@ti.com>
Tested-by: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>

Showing 3 changed files with 12 additions and 3 deletions Side-by-side Diff

arch/arm/mach-keystone/clock.c
... ... @@ -34,6 +34,11 @@
34 34 [UART_PLL] = {KS2_UARTPLLCTL0, KS2_UARTPLLCTL1},
35 35 };
36 36  
  37 +inline void pll_pa_clk_sel(void)
  38 +{
  39 + setbits_le32(keystone_pll_regs[PASS_PLL].reg1, CFG_PLLCTL1_PAPLL_MASK);
  40 +}
  41 +
37 42 static void wait_for_completion(const struct pll_init_data *data)
38 43 {
39 44 int i;
... ... @@ -181,9 +186,8 @@
181 186 sdelay(21000);
182 187  
183 188 /* Select the Output of PASS PLL as input to PASS */
184   - if (data->pll == PASS_PLL)
185   - setbits_le32(keystone_pll_regs[data->pll].reg1,
186   - CFG_PLLCTL1_PAPLL_MASK);
  189 + if (data->pll == PASS_PLL && cpu_is_k2hk())
  190 + pll_pa_clk_sel();
187 191  
188 192 /* Select the Output of ARM PLL as input to ARM */
189 193 if (data->pll == TETRIS_PLL)
arch/arm/mach-keystone/include/mach/clock.h
... ... @@ -126,6 +126,7 @@
126 126 int clk_set_rate(unsigned int clk, unsigned long hz);
127 127 int get_max_dev_speed(void);
128 128 int get_max_arm_speed(void);
  129 +void pll_pa_clk_sel(void);
129 130  
130 131 #endif
131 132 #endif
board/ti/ks2_evm/board.c
... ... @@ -14,6 +14,7 @@
14 14 #include <fdt_support.h>
15 15 #include <asm/arch/ddr3.h>
16 16 #include <asm/arch/psc_defs.h>
  17 +#include <asm/arch/clock.h>
17 18 #include <asm/ti-common/ti-aemif.h>
18 19 #include <asm/ti-common/keystone_net.h>
19 20  
... ... @@ -86,6 +87,9 @@
86 87 return -1;
87 88 if (psc_enable_module(KS2_LPSC_CRYPTO))
88 89 return -1;
  90 +
  91 + if (cpu_is_k2e() || cpu_is_k2l())
  92 + pll_pa_clk_sel();
89 93  
90 94 port_num = get_num_eth_ports();
91 95