diff mbox

[U-Boot,3/9] serial: pl01x: expose skip_init platdata option in DT

Message ID 20160926122651.22132-4-fvogt@suse.com
State Accepted
Commit 165316e38f7391b9269d2539edc1cceac25c16cc
Delegated to: Tom Rini
Headers show

Commit Message

Fabian Vogt Sept. 26, 2016, 12:26 p.m. UTC
To be able to represent the skip-init platdata element with OF_CONTROL,
it needs to be read from the device tree as well and put into the platform data.

Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Fabian Vogt <fvogt@suse.com>
---
 doc/device-tree-bindings/serial/pl01x.txt | 3 +++
 drivers/serial/serial_pl01x.c             | 2 ++
 2 files changed, 5 insertions(+)

Comments

Simon Glass Sept. 27, 2016, 12:34 a.m. UTC | #1
On 26 September 2016 at 06:26, Fabian Vogt <fvogt@suse.com> wrote:
> To be able to represent the skip-init platdata element with OF_CONTROL,
> it needs to be read from the device tree as well and put into the platform data.
>
> Cc: Eric Anholt <eric@anholt.net>
> Signed-off-by: Fabian Vogt <fvogt@suse.com>
> ---
>  doc/device-tree-bindings/serial/pl01x.txt | 3 +++
>  drivers/serial/serial_pl01x.c             | 2 ++
>  2 files changed, 5 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini Nov. 29, 2016, 5:34 p.m. UTC | #2
On Mon, Sep 26, 2016 at 02:26:45PM +0200, Fabian Vogt wrote:

> To be able to represent the skip-init platdata element with OF_CONTROL,
> it needs to be read from the device tree as well and put into the platform data.
> 
> Cc: Eric Anholt <eric@anholt.net>
> Signed-off-by: Fabian Vogt <fvogt@suse.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/doc/device-tree-bindings/serial/pl01x.txt b/doc/device-tree-bindings/serial/pl01x.txt
index 61c27d1..017b1e2 100644
--- a/doc/device-tree-bindings/serial/pl01x.txt
+++ b/doc/device-tree-bindings/serial/pl01x.txt
@@ -5,3 +5,6 @@  Required properties:
 - reg: exactly one register range with length 0x1000
 - clock: input clock frequency for the UART (used to calculate the baud
   rate divisor)
+
+Optional properties:
+- skip-init: if present, the baud rate divisor is not changed
diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index 6f83835..a8d3d67 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -356,6 +356,8 @@  static int pl01x_serial_ofdata_to_platdata(struct udevice *dev)
 	plat->base = addr;
 	plat->clock = fdtdec_get_int(gd->fdt_blob, dev->of_offset, "clock", 1);
 	plat->type = dev_get_driver_data(dev);
+	plat->skip_init = fdtdec_get_bool(gd->fdt_blob, dev->of_offset,
+	                                  "skip-init");
 	return 0;
 }
 #endif