Skip to content
Commit f690a4d7 authored by Ivan T. Ivanov's avatar Ivan T. Ivanov Committed by Stephen Boyd
Browse files

clk: bcm2835: Round UART input clock up



It was reported that RPi3[1] and RPi Zero 2W boards have issues with
the Bluetooth. It turns out that when switching from initial to
operation speed host and device no longer can talk each other because
host uses incorrect UART baud rate.

The UART driver used in this case is amba-pl011. Original fix, see
below Github link[2], was inside pl011 module, but somehow it didn't
look as the right place to fix. Beside that this original rounding
function is not exactly perfect for all possible clock values. So I
deiced to move the hack to the platform which actually need it.

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 baud rate
== requested clock/16, there is no headroom and the slight
reduction in actual clock rate results in failure.

If increasing a clock by less than 0.1% changes it from ..999..
to ..000.., round it up.

[1] https://bugzilla.suse.com/show_bug.cgi?id=1188238
[2] https://github.com/raspberrypi/linux/commit/ab3f1b39537f6d3825b8873006fbe2fc5ff057b7

Cc: Phil Elwell <phil@raspberrypi.com>
Signed-off-by: default avatarIvan T. Ivanov <iivanov@suse.de>
Reviewed-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/20220912081306.24662-1-iivanov@suse.de
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 6c542285
  • mirror @mirror

    mentioned in commit e79cebb6

    ·

    mentioned in commit e79cebb6

    Toggle commit list
  • mirror @mirror

    mentioned in commit 45d225d85d02327360b28f3f3c87d4e07e770a0e

    ·

    mentioned in commit 45d225d85d02327360b28f3f3c87d4e07e770a0e

    Toggle commit list
  • mirror @mirror

    mentioned in commit 97715955c96b590b4b4ae5904c721ee052202ade

    ·

    mentioned in commit 97715955c96b590b4b4ae5904c721ee052202ade

    Toggle commit list
  • mirror @mirror

    mentioned in commit feb9e21dace8f7cc09b5a3a57605f90ac1530b19

    ·

    mentioned in commit feb9e21dace8f7cc09b5a3a57605f90ac1530b19

    Toggle commit list
  • mirror @mirror

    mentioned in commit 865b2ee7cc645141a1bffc3189621af17cf57240

    ·

    mentioned in commit 865b2ee7cc645141a1bffc3189621af17cf57240

    Toggle commit list
  • mirror @mirror

    mentioned in commit 6c38df82fb08dbf664172aba20c3a0ca79f17881

    ·

    mentioned in commit 6c38df82fb08dbf664172aba20c3a0ca79f17881

    Toggle commit list
  • mirror @mirror

    mentioned in commit 11e03f667d11623c7547416648642e96aefcd677

    ·

    mentioned in commit 11e03f667d11623c7547416648642e96aefcd677

    Toggle commit list
  • mirror @mirror

    mentioned in commit 9c232e49d76b6fa4c41f986e0256f52aed67cc06

    ·

    mentioned in commit 9c232e49d76b6fa4c41f986e0256f52aed67cc06

    Toggle commit list
  • mirror @mirror

    mentioned in commit b134c7f2

    ·

    mentioned in commit b134c7f2

    Toggle commit list
  • mirror @mirror

    mentioned in commit 5916fb29369032ecd85129758b8e9863ecc5d719

    ·

    mentioned in commit 5916fb29369032ecd85129758b8e9863ecc5d719

    Toggle commit list
  • mirror @mirror

    mentioned in commit 1cf306507bb6bf3f399bd4e36c7e90c9220cc1ab

    ·

    mentioned in commit 1cf306507bb6bf3f399bd4e36c7e90c9220cc1ab

    Toggle commit list
  • mirror @mirror

    mentioned in commit 6730a178727d80f13b6d786148a5f352d9f4cdea

    ·

    mentioned in commit 6730a178727d80f13b6d786148a5f352d9f4cdea

    Toggle commit list
  • mirror @mirror

    mentioned in commit 500e21007d70c756dc3ba04017fe5041d572ac52

    ·

    mentioned in commit 500e21007d70c756dc3ba04017fe5041d572ac52

    Toggle commit list
  • mirror @mirror

    mentioned in commit 27f6c340589144feb1aedc6afeaa9e3c675c2da2

    ·

    mentioned in commit 27f6c340589144feb1aedc6afeaa9e3c675c2da2

    Toggle commit list
  • mirror @mirror

    mentioned in commit 05fbcf8d7c029d8d2c0931786739e0d644711375

    ·

    mentioned in commit 05fbcf8d7c029d8d2c0931786739e0d644711375

    Toggle commit list
  • mirror @mirror

    mentioned in commit 4137786452c5bb72ef2642d72c60388016cbcae7

    ·

    mentioned in commit 4137786452c5bb72ef2642d72c60388016cbcae7

    Toggle commit list
  • mirror @mirror

    mentioned in commit 8be8fcab3cd48192fe8c9d9068974b4a8729a0c3

    ·

    mentioned in commit 8be8fcab3cd48192fe8c9d9068974b4a8729a0c3

    Toggle commit list
  • mirror @mirror

    mentioned in commit be7a16bc49ab6a85332603843bf8ee2c44d46939

    ·

    mentioned in commit be7a16bc49ab6a85332603843bf8ee2c44d46939

    Toggle commit list
  • mirror @mirror

    mentioned in commit 4c27b5ac

    ·

    mentioned in commit 4c27b5ac

    Toggle commit list
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment