Commit 892abfb
clk: thead: th1520-ap: Poll for PLL lock and wait for stability
All PLLs found on TH1520 SoC take 21250ns at maximum to lock, and their
lock status is indicated by register PLL_STS (offset 0x80 inside AP
clock controller). We should poll the register to ensure the PLL
actually locks after enabling it.
Furthermore, a 30us delay is added after enabling the PLL, after which
the PLL could be considered stable as stated by vendor clock code.
Fixes: 56a48c1 ("clk: thead: add support for enabling/disabling PLLs")
Reviewed-by: Drew Fustini <fustini@kernel.org>
Signed-off-by: Yao Zi <ziyao@disroot.org>
Signed-off-by: Drew Fustini <fustini@kernel.org>1 parent 5f35212 commit 892abfb
1 file changed
Lines changed: 32 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
26 | 36 | | |
27 | 37 | | |
28 | 38 | | |
| |||
64 | 74 | | |
65 | 75 | | |
66 | 76 | | |
| 77 | + | |
67 | 78 | | |
68 | 79 | | |
69 | 80 | | |
| |||
299 | 310 | | |
300 | 311 | | |
301 | 312 | | |
| 313 | + | |
| 314 | + | |
302 | 315 | | |
303 | | - | |
304 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
305 | 328 | | |
306 | 329 | | |
307 | 330 | | |
| |||
389 | 412 | | |
390 | 413 | | |
391 | 414 | | |
| 415 | + | |
392 | 416 | | |
393 | 417 | | |
394 | 418 | | |
| |||
401 | 425 | | |
402 | 426 | | |
403 | 427 | | |
| 428 | + | |
404 | 429 | | |
405 | 430 | | |
406 | 431 | | |
| |||
413 | 438 | | |
414 | 439 | | |
415 | 440 | | |
| 441 | + | |
416 | 442 | | |
417 | 443 | | |
418 | 444 | | |
| |||
433 | 459 | | |
434 | 460 | | |
435 | 461 | | |
| 462 | + | |
436 | 463 | | |
437 | 464 | | |
438 | 465 | | |
| |||
453 | 480 | | |
454 | 481 | | |
455 | 482 | | |
| 483 | + | |
456 | 484 | | |
457 | 485 | | |
458 | 486 | | |
| |||
469 | 497 | | |
470 | 498 | | |
471 | 499 | | |
| 500 | + | |
472 | 501 | | |
473 | 502 | | |
474 | 503 | | |
| |||
485 | 514 | | |
486 | 515 | | |
487 | 516 | | |
| 517 | + | |
488 | 518 | | |
489 | 519 | | |
490 | 520 | | |
| |||
0 commit comments