Allwinner clock fixes for 4.9

Two fixes, one for the old clock code, one for the new implementation.
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABCAAGBQJYK3yMAAoJEBx+YmzsjxAgOXUP/iRJQ/ZVeEq3vcW7IyaTNpLy
 2NrmkC5b3UACSPOkjDpZAguILbP26pOQu53N9VCsZZBD5K0WtUUFgZqtQeCCCVH3
 PisdDNMuqEdEFAb5EYZj5lzUx4wvlVvCjAfFAIm1JmZ5CB873VCW1PDAuBtTjO6M
 Z/NtL7IX7v2fcIg+uvYDuPyi4mNh1ih2XMsqNx9oK/u7YUcXOCFtHnN06wWEtkYS
 gkAYNmTy5LfK+qF7ERPCP5N1HEGcuTJwxPzRJn9UfHvwIj6CXwmLDvH3Czr5k/xf
 gERF+Si+rFqY1iMFwxSxkSkGdqVlk2Tz5VSZWlDEGpDaZlQ+g5KiamUrYUcjLYvz
 uHjpTu+pvpLPznzQg5W3JyY7QCeN0tJdWGt7n900E/UoEhbqdMifwEsYy9QXVSye
 fa38SxvbCA38tYmxnbFJrTES1J709M3fkl9QWqhSh80uTNz8I+20PqqFFcJ7tWQi
 PzkG/pnAR6FthNBFjPgxOoEeE3RrkvlP4tlqoVDWIH6XuqFCZfjB8D5bTQYVpRBK
 cG7BzcRr91esHDTLaQLCO71wxVsghi1m5IvN1jJldZwY6zEx+wAc9c6XqIBlRuod
 85/VCv9PvceewDNwh7T1ysVAnJJUQLYzPYI3WqwjuokvSB0gnIPJVnUBDSS2oANe
 7qJcJ0+f1v2YZTespalM
 =MWqM
 -----END PGP SIGNATURE-----

Merge tag 'sunxi-clk-fixes-for-4.9' of https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux into clk-fixes

Pull Allwinner clock fixes from Maxime Ripard:

Two fixes, one for the old clock code, one for the new implementation.

* tag 'sunxi-clk-fixes-for-4.9' of https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux:
  clk: sunxi: Fix M factor computation for APB1
  clk: sunxi-ng: sun6i-a31: Force AHB1 clock to use PLL6 as parent
This commit is contained in:
Stephen Boyd 2016-11-16 11:10:58 -08:00
commit c8616671af
2 changed files with 13 additions and 1 deletions

View File

@ -191,6 +191,8 @@ static struct clk_div_table axi_div_table[] = {
static SUNXI_CCU_DIV_TABLE(axi_clk, "axi", "cpu",
0x050, 0, 3, axi_div_table, 0);
#define SUN6I_A31_AHB1_REG 0x054
static const char * const ahb1_parents[] = { "osc32k", "osc24M",
"axi", "pll-periph" };
@ -1230,6 +1232,16 @@ static void __init sun6i_a31_ccu_setup(struct device_node *node)
val &= BIT(16);
writel(val, reg + SUN6I_A31_PLL_MIPI_REG);
/* Force AHB1 to PLL6 / 3 */
val = readl(reg + SUN6I_A31_AHB1_REG);
/* set PLL6 pre-div = 3 */
val &= ~GENMASK(7, 6);
val |= 0x2 << 6;
/* select PLL6 / pre-div */
val &= ~GENMASK(13, 12);
val |= 0x3 << 12;
writel(val, reg + SUN6I_A31_AHB1_REG);
sunxi_ccu_probe(node, reg, &sun6i_a31_ccu_desc);
ccu_mux_notifier_register(pll_cpu_clk.common.hw.clk,

View File

@ -373,7 +373,7 @@ static void sun4i_get_apb1_factors(struct factors_request *req)
else
calcp = 3;
calcm = (req->parent_rate >> calcp) - 1;
calcm = (div >> calcp) - 1;
req->rate = (req->parent_rate >> calcp) / (calcm + 1);
req->m = calcm;