ns16550: add device tree support
Subsystems (2)
PATCH 1/1 ns16550: add device tree support
This patch adds device tree support for serial_ns16550 driver.
Tested with pcduino (allwinner a10).
--- .../devicetree/bindings/serial/ns16550_serial.txt | 34 ++++++++++++++ drivers/serial/serial_ns16550.c | 53 ++++++++++++++++++++-- 2 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 Documentation/devicetree/bindings/serial/ns16550_serial.txt
Documentation/devicetree/bindings/serial/ns16550_serial.txt new file +34 -0
@@ -0,0 +1,34 @@ +* NS16550 UART + +Required properties: +- compatible : "ns16550_serial" +- reg : offset and length of the register set for the device. + + +Optional properties: +- clock-frequency : the input clock frequency for the UART. +- reg-shift : quantity to shift the register offsets by. If this property is + not present then the register offsets are not shifted. +- reg-io-width : the size (in bytes) of the IO accesses that should be + performed on the device. If this property is not present then single byte + accesses are used. +- disable-fifo : + 0: enable tx/rx fifo (default value) + 1: disable tx/rx fifo +- console-stdin : activate stdin on this console. +- console-stdout : activate stdout on this console. +- console-stderr : activate stderr on this console. + +Example: + + serial@0x01c28000 { + compatible = "ns16550_serial"; + reg = <0x01c28000 0x400>; + clock-frequency = <24000000>; + reg-shift = <2>; + reg-io-width = <4>; + disable-fifo = <0>; + console-stdin; + console-stdout; + console-stderr; + };
drivers/serial/serial_ns16550.c +50 -3
83 lines not on this page · raw message
Signature · 7 lines
1.8.1.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 3 lines
This patch adds device tree support for
serial_ns16550driver.Tested with pcduino (allwinner a10).
Is we have mach-sunxi support in barebox already? Do you have custom patches for support this subarch? Thanks.
---
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Quoted 2 lines
Is we have mach-sunxi support in barebox already? Do you have custom patches for support this subarch?
As far as I know, mach-sunxi is not supported yet. Currently only serial/clocksource are working on my local environment.
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Quoted 17 lines · NISHIMOTO Hiroki
This patch adds device tree support for
serial_ns16550driver.Tested with pcduino (allwinner a10).
Signed-off-by NISHIMOTO Hiroki <[email protected]>--- .../devicetree/bindings/serial/ns16550_serial.txt | 34 ++++++++++++++ drivers/serial/serial_ns16550.c | 53 ++++++++++++++++++++-- 2 files changed, 84 insertions(+), 3 deletions(-)create mode 100644
Documentation/devicetree/bindings/serial/ns16550_serial.txtDocumentation/devicetree/bindings/serial/ns16550_serial.txt new file +0
-0
Documentation/devicetree/bindings/serial/ns16550_serial.txt line 4
Quoted 4 lines
Documentation/devicetree/bindings/serial/ns16550_serial.txt new file +4
-0@@ -0,0 +1,34 @@ +* NS16550 UART + +Required properties: +- compatible : "ns16550_serial"
Hiroki,
as stated in Documentation/devicetree/bindings/README, barebox uses the same bindings as "the kernel" which is Linux I guess. Linux already has a binding for ns16550 compatible serial.
I suggest to use that binding as a reference although it is not documented but needs to be stripped from its source code.
Quoted 6 lines
Documentation/devicetree/bindings/serial/ns16550_serial.txt new file +6
-0+- reg : offset and length of the register set for the device. + + +Optional properties: +- clock-frequency : the input clock frequency for the UART. +- reg-shift : quantity to shift the register offsets by. If this property is
Documentation/devicetree/bindings/serial/ns16550_serial.txt line 20
Quoted 10 lines
Documentation/devicetree/bindings/serial/ns16550_serial.txt new file +10
-0+ not present then the register offsets are not shifted. +- reg-io-width : the size (in bytes) of the IO accesses that should be + performed on the device. If this property is not present then single byte + accesses are used. +- disable-fifo : + 0: enable tx/rx fifo (default value) + 1: disable tx/rx fifo +- console-stdin : activate stdin on this console. +- console-stdout : activate stdout on this console. +- console-stderr : activate stderr on this console.
ePAPR specification already defines stdout-path and stdin-path. Moreover, barebox has of_device_is_stdout_path to check if a device is referenced by stdout-path property.
Sebastian
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Sebastian,
Thanks for your reviwing.
I will re-send as v2.
NISHIMOTO Hiroki
Quoted 52 lines · NISHIMOTO Hiroki
Quoted 17 lines
This patch adds device tree support for
serial_ns16550driver.Tested with pcduino (allwinner a10).
Signed-off-by NISHIMOTO Hiroki <[email protected]>--- .../devicetree/bindings/serial/ns16550_serial.txt | 34 ++++++++++++++ drivers/serial/serial_ns16550.c | 53 ++++++++++++++++++++-- 2 files changed, 84 insertions(+), 3 deletions(-)create mode 100644
Documentation/devicetree/bindings/serial/ns16550_serial.txtDocumentation/devicetree/bindings/serial/ns16550_serial.txt new file +0
-0Documentation/devicetree/bindings/serial/ns16550_serial.txt line 4
Quoted 4 lines
Documentation/devicetree/bindings/serial/ns16550_serial.txt new file +4
-0@@ -0,0 +1,34 @@ +* NS16550 UART + +Required properties: +- compatible : "ns16550_serial"Hiroki,
as stated in
Documentation/devicetree/bindings/README, barebox uses the same bindings as "the kernel" which is Linux I guess. Linux already has a binding for ns16550 compatible serial.I suggest to use that binding as a reference although it is not documented but needs to be stripped from its source code.
Quoted 6 lines
Documentation/devicetree/bindings/serial/ns16550_serial.txt new file +6
-0+- reg : offset and length of the register set for the device. + + +Optional properties: +- clock-frequency : the input clock frequency for the UART. +- reg-shift : quantity to shift the register offsets by. If this property isDocumentation/devicetree/bindings/serial/ns16550_serial.txt line 20
Quoted 10 lines
Documentation/devicetree/bindings/serial/ns16550_serial.txt new file +10
-0+ not present then the register offsets are not shifted. +- reg-io-width : the size (in bytes) of the IO accesses that should be + performed on the device. If this property is not present then single byte + accesses are used. +- disable-fifo : + 0: enable tx/rx fifo (default value) + 1: disable tx/rx fifo +- console-stdin : activate stdin on this console. +- console-stdout : activate stdout on this console. +- console-stderr : activate stderr on this console.ePAPR specification already defines stdout-path and stdin-path. Moreover, barebox has
of_device_is_stdout_pathto check if a device is referenced by stdout-path property.
Quoted 2 lines
Sebastian
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox