[U-Boot] [PATCH v2 01/10] serial: ns16550: Support clocks via phandle
Simon Glass
sjg at chromium.org
Mon Aug 1 03:01:46 CEST 2016
On 27 July 2016 at 08:26, Paul Burton <paul.burton at imgtec.com> wrote:
> Previously ns16550 compatible UARTs probed via device tree have needed
> their device tree nodes to contain a clock-frequency property. An
> alternative to this commonly used with Linux is to reference a clock via
> a phandle. This patch allows U-Boot to support that, retrieving the
> clock frequency by probing the appropriate clock device.
>
> For example, a system might choose to provide the UART base clock as a
> reference to a clock common to multiple devices:
>
> sys_clk: clock {
> compatible = "fixed-clock";
> #clock-cells = <0>;
> clock-frequency = <10000000>;
> };
>
> uart0: uart at 10000000 {
> compatible = "ns16550a";
> reg = <0x10000000 0x1000>;
> clocks = <&sys_clk>;
> };
>
> uart1: uart at 10000000 {
> compatible = "ns16550a";
> reg = <0x10001000 0x1000>;
> clocks = <&sys_clk>;
> };
>
> This removes the need for the frequency information to be duplicated in
> multiple nodes and allows the device tree to be more descriptive of the
> system.
>
> Signed-off-by: Paul Burton <paul.burton at imgtec.com>
>
> ---
>
> Changes in v2:
> - Propogate non-ENODEV errors from clk_get_by_index
>
> drivers/serial/ns16550.c | 19 ++++++++++++++++---
> 1 file changed, 16 insertions(+), 3 deletions(-)
This seems OK. I hope it does not bloat the code of any boards.
Reviewed-by: Simon Glass <sjg at chromium.org>
More information about the U-Boot
mailing list