]> git.baikalelectronics.ru Git - arm-tf.git/commit
zynqmp: pm: Update flags in common clk divisor node
authorRavi Patel <ravi.patel@xilinx.com>
Tue, 18 Sep 2018 09:14:12 +0000 (02:14 -0700)
committerManish Pandey <manish.pandey2@arm.com>
Tue, 8 Dec 2020 22:24:44 +0000 (22:24 +0000)
commitc8f62536833eca49723b6360b3744e5110ae0ffe
treec46837ebee3fc80de380585aa10a4059b6fea43e
parentf2afaad0718b3a3e2b5f63ea3229933eecc6d7c2
zynqmp: pm: Update flags in common clk divisor node

Current implementation doesn't support change of div1 value if clk
has 2 divisor because div1 clk is the parent of the div2 clk and div2
clk does not have SET_RATE_PARENT flag.
This causes div1 value to be fixed and only value of div2 will be
adjusted according to required clock rate.

Example:
 Consider a case of nand_ref clock which has 2 divisor and 1 mux.
 The frequency of mux clock is 1500MHz and default value of div1 and
 div2 is 15 and 1 respectively. So the final clock will be of 100MHz.
 When driver requests 80MHz for nand_ref clock, clock framework will
 adjust the div2 value to 1 (setting div2 value 2 results final clock
 to 50MHz which is more inaccurate compare to 100Mhz) which results
 final clock to 100MHz.
 Ideally the value of div1 and div2 should be updated to 19 and 1
 respectively so that final clock goes to around 78MHz.

This patch fixes above problem by allowing change in div1 value.

Signed-off-by: Ravi Patel <ravi.patel@xilinx.com>
Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Change-Id: Ibb98f6748d28653fdd1e59bf433b6a37ce9c1a58
plat/xilinx/zynqmp/pm_service/pm_api_clock.c