
Hello Simon,
Am 03.01.2020 um 23:26 schrieb Simon Glass:
At present the driver can end up with timing parameters which are slightly faster than those expected. It is possible to optimise the parameters to get the best possible result.
Create a new function to handle the timing calculation. This uses a table of defaults for each speed mode rather than writing it in code.
The function works by calculating the 'period' of each bit on the bus in terms of the input clock to the controller (IC_CLK). It makes sure that the constraints are met and that the different components of that period add up correctly.
This code was taken from coreboot which has ended up with this same driver, but now in a much-different form.
Signed-off-by: Simon Glass sjg@chromium.org
Changes in v2: None
drivers/i2c/designware_i2c.c | 169 ++++++++++++++++++++++++++++++----- 1 file changed, 147 insertions(+), 22 deletions(-)
Reviewed-by: Heiko Schocher hs@denx.de
bye, Heiko