Repository navigation
Commit 4486842
amba_pl011: Round input clock up
The UART clock is initialised to be as close to the requested
frequency as possible without exceeding it. Now that there is a
clock manager that returns the actual frequencies, an expected
48MHz clock is reported as 47999625. If the requested baudrate
== requested clock/16, there is no headroom and the slight
reduction in actual clock rate results in failure.
Detect cases where it looks like a "round" clock was chosen and
adjust the reported clock to match that "round" value. As the
code comment says:
/*
* If increasing a clock by less than 0.1% changes it
* from ..999.. to ..000.., round up.
*/
Signed-off-by: Phil Elwell <phil@raspberrypi.org>1 parent c21182f commit 4486842
1 file changed
Lines changed: 21 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1652 | 1652 | | |
1653 | 1653 | | |
1654 | 1654 | | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
1655 | 1672 | | |
1656 | 1673 | | |
1657 | 1674 | | |
| |||
1668 | 1685 | | |
1669 | 1686 | | |
1670 | 1687 | | |
1671 | | - | |
| 1688 | + | |
1672 | 1689 | | |
1673 | 1690 | | |
1674 | 1691 | | |
| |||
2324 | 2341 | | |
2325 | 2342 | | |
2326 | 2343 | | |
2327 | | - | |
| 2344 | + | |
2328 | 2345 | | |
2329 | 2346 | | |
2330 | 2347 | | |
| |||
2509 | 2526 | | |
2510 | 2527 | | |
2511 | 2528 | | |
| 2529 | + | |
2512 | 2530 | | |
2513 | 2531 | | |
2514 | 2532 | | |
| |||
2540 | 2558 | | |
2541 | 2559 | | |
2542 | 2560 | | |
| 2561 | + | |
2543 | 2562 | | |
2544 | 2563 | | |
2545 | 2564 | | |
| |||
0 commit comments