Skip to content
Commit 35780e86 authored by Alexander Sverdlin's avatar Alexander Sverdlin Committed by Wolfram Sang
Browse files

i2c: davinci: Optimize clock generation on Keystone SoC



According to "KeyStone Architecture Inter-IC Control Bus User Guide", fixed
additive part of frequency divisors (referred as "d" in the code and datasheet)
always equals to 6, independent of module clock prescaler.

                         module clock frequency
master clock frequency = ----------------------
                         (ICCL + 6) + (ICCH + 6)

It was not the case with original Davinci IP. Introduce new compatible property
"ti,keystone-i2c", which triggers special handling in the driver.

Without this change Keystone-based systems (having 204.8MHz input clock) choose
prescaler 29 (PSC=28). Using d=5 in this case leads to bus bitrate ~353kHz
instead of requested 400kHz. After correction, assuming d=6 bus rate is ~392kHz.
This gives ~11% transfer rate increase.

Signed-off-by: default avatarAlexander Sverdlin <alexander.sverdlin@nokia.com>
Reviewed-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
Tested-by: default avatarHemanth Guruva Reddy <hemanth.guruva_reddy@nokia.com>
Tested-by: default avatarLukasz Gemborowski <lukasz.gemborowski@nokia.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 064181b0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment