mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-30 10:31:02 +00:00
We found the deviation of ITIM32 is huge since apb2's clock isn't divisible by 1MHz. (The default resolution of hwtimer is 1us.) The solution is set the freq of apb2 the same as core clock. Note apb2 is twice value of original one. It will increase power consumption slightly. But we found the difference is acceptable no matter core clock is 15M or 13MHz. In this version, we also use the arrays to adjust i2c bus timing if bus' freq is 400K or 1MHz for all source clock freqs of i2c. Modified sources: 1. i2c.c: Support all source clock freqs of i2c for best bus timing. 2. clock.c: Set divider of apb2 if it's clock isn't divisible by 1MHz. 3. uart.c: Modified baud-rate for apb2 which is the same as core clock. BUG=chrome-os-partner:34346 TEST=make buildall -j; test nuvoton IC specific drivers BRANCH=none Change-Id: I6089caaaf9aa16186d7c6acf6f5fea0682a55655 Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/327120 Reviewed-by: Randall Spangler <rspangler@chromium.org>