@@ -91,7 +91,7 @@ static int rkclk_set_pll(struct rk3188_cru *cru, enum rk_clk_id clk_id,
uint vco_hz = OSC_HZ / 1000 * div->nf / div->nr * 1000;
uint output_hz = vco_hz / div->no;
- debug("PLL at %x: nf=%d, nr=%d, no=%d, vco=%u Hz, output=%u Hz\n",
+ printf("PLL at %x: nf=%d, nr=%d, no=%d, vco=%u Hz, output=%u Hz\n",
(uint)pll, div->nf, div->nr, div->no, vco_hz, output_hz);
assert(vco_hz >= VCO_MIN_HZ && vco_hz <= VCO_MAX_HZ &&
output_hz >= OUTPUT_MIN_HZ && output_hz <= OUTPUT_MAX_HZ &&
@@ -105,8 +105,12 @@ static int rkclk_set_pll(struct rk3188_cru *cru, enum rk_clk_id clk_id,
((div->nr - 1) << CLKR_SHIFT) | (div->no - 1));
rk_clrsetreg(&pll->con1, CLKF_MASK, div->nf - 1);
- if (has_bwadj)
+ if (has_bwadj) {
+ printf("before: %p: con2=%x, clr=%x, set=%x\n",
+ &pll->con2, readl(&pll->con2), PLL_BWADJ_MASK, (div->nf >> 1) - 1);
rk_clrsetreg(&pll->con2, PLL_BWADJ_MASK, (div->nf >> 1) - 1);
+ printf("after: %p: con2=%x\n", &pll->con2, readl(&pll->con2));
+ }
udelay(10);
@@ -552,7 +556,9 @@ static int rk3188_clk_probe(struct udevice *dev)
priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
if (IS_ERR(priv->grf))
return PTR_ERR(priv->grf);
- priv->has_bwadj = (type == RK3188A_CRU) ? 1 : 0;
+ printf("type %d\n", type);
+ //priv->has_bwadj = (type == RK3188A_CRU) ? 1 : 0;
+ priv->has_bwadj = 1;
?????????????????????
type 0
PLL at 20000030: nf=64, nr=1, no=2, vco=1536000000 Hz, output=768000000 Hz