]> git.baikalelectronics.ru Git - uboot.git/commit
uart: pl011: Add proper DM clock support
authorAndre Przywara <andre.przywara@arm.com>
Mon, 27 Apr 2020 18:17:59 +0000 (19:17 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 7 May 2020 13:01:42 +0000 (09:01 -0400)
commit6aa1d566ae533abdaa3faa7748a16d1f9030e3ce
tree960e608c449f56aa82277bf96fbc83253590a35d
parent74e6c63e1fc74061ba3a57f908d486e272766741
uart: pl011: Add proper DM clock support

Even though the PL011 UART driver claims to be DM compliant, it does not
really a good job with parsing DT nodes. U-Boot seems to adhere to a
non-standard binding, either requiring to have a "skip-init" property in
the node, or to have an extra "clock" property holding the base
*frequency* value for the baud rate generator.
DTs in the U-Boot tree seem to have been hacked to match this
requirement.

The official binding does not mention any of these properties, instead
recommends a standard "clocks" property to point to the baud base clock.

Some boards use simple "fixed-clock" providers, which U-Boot readily
supports, so let's add some simple DM clock code to the PL011 driver to
learn the rate of the first clock, as described by the official binding.

These clock nodes seem to be not ready very early in the boot process,
so provide a fallback value, by re-using the already existing
CONFIG_PL011_CLOCK variable.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
[trini: Add <clock_legacy.h> for get_bus_freq() for layerscape
platforms]
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/serial/serial_pl01x.c