On Fri, Aug 10, 2018 at 06:36:20PM +0530, Lokesh Vutla wrote:

> Add driver model support for OMAP_SERIAL while reusing
> the functions in ns16550.c
> 
> Signed-off-by: Lokesh Vutla <lokeshvu...@ti.com>
> ---
> 
> Based on the conclusion on the thread[1], added a separate driver for
> omap uart.
> 
> [1] https://patchwork.ozlabs.org/patch/944756/
> 
>  drivers/serial/Kconfig       |   9 +++
>  drivers/serial/Makefile      |   1 +
>  drivers/serial/ns16550.c     |  42 ------------
>  drivers/serial/serial_omap.c | 121 +++++++++++++++++++++++++++++++++++
>  4 files changed, 131 insertions(+), 42 deletions(-)
>  create mode 100644 drivers/serial/serial_omap.c

For the record, I don't like this, but I'm not naking it, and I guess
this is what we'll need moving forward.  FWIW, the alternative (patching
the dtsi files in the kernel) looks like:

diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 9cd62bc2ca35..dab6bc9607bb 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -346,6 +346,7 @@
                        ti,hwmods = "uart1";
                        clock-frequency = <48000000>;
                        reg = <0x44e09000 0x2000>;
+                       reg-shift = <2>;
                        interrupts = <72>;
                        status = "disabled";
                        dmas = <&edma 26 0>, <&edma 27 0>;
@@ -357,6 +358,7 @@
                        ti,hwmods = "uart2";
                        clock-frequency = <48000000>;
                        reg = <0x48022000 0x2000>;
+                       reg-shift = <2>;
                        interrupts = <73>;
                        status = "disabled";
                        dmas = <&edma 28 0>, <&edma 29 0>;
@@ -368,6 +370,7 @@
                        ti,hwmods = "uart3";
                        clock-frequency = <48000000>;
                        reg = <0x48024000 0x2000>;
+                       reg-shift = <2>;
                        interrupts = <74>;
                        status = "disabled";
                        dmas = <&edma 30 0>, <&edma 31 0>;
@@ -379,6 +382,7 @@
                        ti,hwmods = "uart4";
                        clock-frequency = <48000000>;
                        reg = <0x481a6000 0x2000>;
+                       reg-shift = <2>;
                        interrupts = <44>;
                        status = "disabled";
                };
@@ -388,6 +392,7 @@
                        ti,hwmods = "uart5";
                        clock-frequency = <48000000>;
                        reg = <0x481a8000 0x2000>;
+                       reg-shift = <2>;
                        interrupts = <45>;
                        status = "disabled";
                };
@@ -397,6 +402,7 @@
                        ti,hwmods = "uart6";
                        clock-frequency = <48000000>;
                        reg = <0x481aa000 0x2000>;
+                       reg-shift = <2>;
                        interrupts = <46>;
                        status = "disabled";
                };
diff --git a/arch/arm/boot/dts/am3517.dtsi b/arch/arm/boot/dts/am3517.dtsi
index ca294914bbb1..1eceeba076d8 100644
--- a/arch/arm/boot/dts/am3517.dtsi
+++ b/arch/arm/boot/dts/am3517.dtsi
@@ -56,6 +56,7 @@
                        ti,hwmods = "uart4";
                        status = "disabled";
                        reg = <0x4809e000 0x400>;
+                       reg-shift = <2>;
                        interrupts = <84>;
                        dmas = <&sdma 55 &sdma 54>;
                        dma-names = "tx", "rx";
diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
index f0cbd86312dc..0f0f203a0fdd 100644
--- a/arch/arm/boot/dts/am4372.dtsi
+++ b/arch/arm/boot/dts/am4372.dtsi
@@ -300,6 +300,7 @@
                uart0: serial@44e09000 {
                        compatible = "ti,am4372-uart","ti,omap2-uart";
                        reg = <0x44e09000 0x2000>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart1";
                };
@@ -307,6 +308,7 @@
                uart1: serial@48022000 {
                        compatible = "ti,am4372-uart","ti,omap2-uart";
                        reg = <0x48022000 0x2000>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart2";
                        status = "disabled";
@@ -315,6 +317,7 @@
                uart2: serial@48024000 {
                        compatible = "ti,am4372-uart","ti,omap2-uart";
                        reg = <0x48024000 0x2000>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart3";
                        status = "disabled";
@@ -323,6 +326,7 @@
                uart3: serial@481a6000 {
                        compatible = "ti,am4372-uart","ti,omap2-uart";
                        reg = <0x481a6000 0x2000>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart4";
                        status = "disabled";
@@ -331,6 +335,7 @@
                uart4: serial@481a8000 {
                        compatible = "ti,am4372-uart","ti,omap2-uart";
                        reg = <0x481a8000 0x2000>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart5";
                        status = "disabled";
@@ -339,6 +344,7 @@
                uart5: serial@481aa000 {
                        compatible = "ti,am4372-uart","ti,omap2-uart";
                        reg = <0x481aa000 0x2000>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart6";
                        status = "disabled";
diff --git a/arch/arm/boot/dts/dm814x.dtsi b/arch/arm/boot/dts/dm814x.dtsi
index 601c57afd4fe..6014e3ff2005 100644
--- a/arch/arm/boot/dts/dm814x.dtsi
+++ b/arch/arm/boot/dts/dm814x.dtsi
@@ -258,6 +258,7 @@
                                compatible = "ti,am3352-uart", "ti,omap3-uart";
                                ti,hwmods = "uart1";
                                reg = <0x20000 0x2000>;
+                               reg-shift = <2>;
                                clock-frequency = <48000000>;
                                interrupts = <72>;
                                dmas = <&edma 26 0 &edma 27 0>;
@@ -268,6 +269,7 @@
                                compatible = "ti,am3352-uart", "ti,omap3-uart";
                                ti,hwmods = "uart2";
                                reg = <0x22000 0x2000>;
+                               reg-shift = <2>;
                                clock-frequency = <48000000>;
                                interrupts = <73>;
                                dmas = <&edma 28 0 &edma 29 0>;
@@ -278,6 +280,7 @@
                                compatible = "ti,am3352-uart", "ti,omap3-uart";
                                ti,hwmods = "uart3";
                                reg = <0x24000 0x2000>;
+                               reg-shift = <2>;
                                clock-frequency = <48000000>;
                                interrupts = <74>;
                                dmas = <&edma 30 0 &edma 31 0>;
diff --git a/arch/arm/boot/dts/dm816x.dtsi b/arch/arm/boot/dts/dm816x.dtsi
index 1edc2b48b254..fc363420b6f2 100644
--- a/arch/arm/boot/dts/dm816x.dtsi
+++ b/arch/arm/boot/dts/dm816x.dtsi
@@ -390,6 +390,7 @@
                        compatible = "ti,am3352-uart", "ti,omap3-uart";
                        ti,hwmods = "uart1";
                        reg = <0x48020000 0x2000>;
+                       reg-shift = <2>;
                        clock-frequency = <48000000>;
                        interrupts = <72>;
                        dmas = <&edma 26 &edma 27>;
@@ -400,6 +401,7 @@
                        compatible = "ti,am3352-uart", "ti,omap3-uart";
                        ti,hwmods = "uart2";
                        reg = <0x48022000 0x2000>;
+                       reg-shift = <2>;
                        clock-frequency = <48000000>;
                        interrupts = <73>;
                        dmas = <&edma 28 &edma 29>;
@@ -410,6 +412,7 @@
                        compatible = "ti,am3352-uart", "ti,omap3-uart";
                        ti,hwmods = "uart3";
                        reg = <0x48024000 0x2000>;
+                       reg-shift = <2>;
                        clock-frequency = <48000000>;
                        interrupts = <74>;
                        dmas = <&edma 30 &edma 31>;
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index f4ddd86f2c77..ca6e49e8024d 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -610,6 +610,7 @@
                uart1: serial@4806a000 {
                        compatible = "ti,dra742-uart", "ti,omap4-uart";
                        reg = <0x4806a000 0x100>;
+                       reg-shift = <2>;
                        interrupts-extended = <&crossbar_mpu GIC_SPI 67 
IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart1";
                        clock-frequency = <48000000>;
@@ -621,6 +622,7 @@
                uart2: serial@4806c000 {
                        compatible = "ti,dra742-uart", "ti,omap4-uart";
                        reg = <0x4806c000 0x100>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart2";
                        clock-frequency = <48000000>;
@@ -632,6 +634,7 @@
                uart3: serial@48020000 {
                        compatible = "ti,dra742-uart", "ti,omap4-uart";
                        reg = <0x48020000 0x100>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart3";
                        clock-frequency = <48000000>;
@@ -643,6 +646,7 @@
                uart4: serial@4806e000 {
                        compatible = "ti,dra742-uart", "ti,omap4-uart";
                        reg = <0x4806e000 0x100>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart4";
                        clock-frequency = <48000000>;
@@ -654,6 +658,7 @@
                uart5: serial@48066000 {
                        compatible = "ti,dra742-uart", "ti,omap4-uart";
                        reg = <0x48066000 0x100>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart5";
                        clock-frequency = <48000000>;
@@ -665,6 +670,7 @@
                uart6: serial@48068000 {
                        compatible = "ti,dra742-uart", "ti,omap4-uart";
                        reg = <0x48068000 0x100>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart6";
                        clock-frequency = <48000000>;
@@ -676,6 +682,7 @@
                uart7: serial@48420000 {
                        compatible = "ti,dra742-uart", "ti,omap4-uart";
                        reg = <0x48420000 0x100>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart7";
                        clock-frequency = <48000000>;
@@ -685,6 +692,7 @@
                uart8: serial@48422000 {
                        compatible = "ti,dra742-uart", "ti,omap4-uart";
                        reg = <0x48422000 0x100>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart8";
                        clock-frequency = <48000000>;
@@ -694,6 +702,7 @@
                uart9: serial@48424000 {
                        compatible = "ti,dra742-uart", "ti,omap4-uart";
                        reg = <0x48424000 0x100>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart9";
                        clock-frequency = <48000000>;
@@ -703,6 +712,7 @@
                uart10: serial@4ae2b000 {
                        compatible = "ti,dra742-uart", "ti,omap4-uart";
                        reg = <0x4ae2b000 0x100>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart10";
                        clock-frequency = <48000000>;
diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi
index f1d6de8b3c19..789a07384cce 100644
--- a/arch/arm/boot/dts/omap2.dtsi
+++ b/arch/arm/boot/dts/omap2.dtsi
@@ -154,6 +154,7 @@
                        compatible = "ti,omap2-uart";
                        ti,hwmods = "uart1";
                        reg = <0x4806a000 0x2000>;
+                       reg-shift = <2>;
                        interrupts = <72>;
                        dmas = <&sdma 49 &sdma 50>;
                        dma-names = "tx", "rx";
@@ -164,6 +165,7 @@
                        compatible = "ti,omap2-uart";
                        ti,hwmods = "uart2";
                        reg = <0x4806c000 0x400>;
+                       reg-shift = <2>;
                        interrupts = <73>;
                        dmas = <&sdma 51 &sdma 52>;
                        dma-names = "tx", "rx";
@@ -174,6 +176,7 @@
                        compatible = "ti,omap2-uart";
                        ti,hwmods = "uart3";
                        reg = <0x4806e000 0x400>;
+                       reg-shift = <2>;
                        interrupts = <74>;
                        dmas = <&sdma 53 &sdma 54>;
                        dma-names = "tx", "rx";
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 4043ecb38016..f283fdf0af27 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -288,6 +288,7 @@
                uart1: serial@4806a000 {
                        compatible = "ti,omap3-uart";
                        reg = <0x4806a000 0x2000>;
+                       reg-shift = <2>;
                        interrupts-extended = <&intc 72>;
                        dmas = <&sdma 49 &sdma 50>;
                        dma-names = "tx", "rx";
@@ -298,6 +299,7 @@
                uart2: serial@4806c000 {
                        compatible = "ti,omap3-uart";
                        reg = <0x4806c000 0x400>;
+                       reg-shift = <2>;
                        interrupts-extended = <&intc 73>;
                        dmas = <&sdma 51 &sdma 52>;
                        dma-names = "tx", "rx";
@@ -308,6 +310,7 @@
                uart3: serial@49020000 {
                        compatible = "ti,omap3-uart";
                        reg = <0x49020000 0x400>;
+                       reg-shift = <2>;
                        interrupts-extended = <&intc 74>;
                        dmas = <&sdma 53 &sdma 54>;
                        dma-names = "tx", "rx";
diff --git a/arch/arm/boot/dts/omap36xx.dtsi b/arch/arm/boot/dts/omap36xx.dtsi
index 6fb23ada1f64..5fdec069ecd3 100644
--- a/arch/arm/boot/dts/omap36xx.dtsi
+++ b/arch/arm/boot/dts/omap36xx.dtsi
@@ -35,6 +35,7 @@
                uart4: serial@49042000 {
                        compatible = "ti,omap3-uart";
                        reg = <0x49042000 0x400>;
+                       reg-shift = <2>;
                        interrupts = <80>;
                        dmas = <&sdma 81 &sdma 82>;
                        dma-names = "tx", "rx";
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index e554b6e039f3..4119347fe664 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -445,6 +445,7 @@
                uart1: serial@4806a000 {
                        compatible = "ti,omap4-uart";
                        reg = <0x4806a000 0x100>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart1";
                        clock-frequency = <48000000>;
@@ -453,6 +454,7 @@
                uart2: serial@4806c000 {
                        compatible = "ti,omap4-uart";
                        reg = <0x4806c000 0x100>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart2";
                        clock-frequency = <48000000>;
@@ -461,6 +463,7 @@
                uart3: serial@48020000 {
                        compatible = "ti,omap4-uart";
                        reg = <0x48020000 0x100>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart3";
                        clock-frequency = <48000000>;
@@ -469,6 +472,7 @@
                uart4: serial@4806e000 {
                        compatible = "ti,omap4-uart";
                        reg = <0x4806e000 0x100>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart4";
                        clock-frequency = <48000000>;
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 732b61a0e990..b40bbe36939b 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -551,6 +551,7 @@
                uart1: serial@4806a000 {
                        compatible = "ti,omap4-uart";
                        reg = <0x4806a000 0x100>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart1";
                        clock-frequency = <48000000>;
@@ -559,6 +560,7 @@
                uart2: serial@4806c000 {
                        compatible = "ti,omap4-uart";
                        reg = <0x4806c000 0x100>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart2";
                        clock-frequency = <48000000>;
@@ -567,6 +569,7 @@
                uart3: serial@48020000 {
                        compatible = "ti,omap4-uart";
                        reg = <0x48020000 0x100>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart3";
                        clock-frequency = <48000000>;
@@ -575,6 +578,7 @@
                uart4: serial@4806e000 {
                        compatible = "ti,omap4-uart";
                        reg = <0x4806e000 0x100>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart4";
                        clock-frequency = <48000000>;
@@ -583,6 +587,7 @@
                uart5: serial@48066000 {
                        compatible = "ti,omap4-uart";
                        reg = <0x48066000 0x100>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart5";
                        clock-frequency = <48000000>;
@@ -591,6 +596,7 @@
                uart6: serial@48068000 {
                        compatible = "ti,omap4-uart";
                        reg = <0x48068000 0x100>;
+                       reg-shift = <2>;
                        interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
                        ti,hwmods = "uart6";
                        clock-frequency = <48000000>;

with a final diffstat of:
 11 files changed, 46 insertions(+)

-- 
Tom

Attachment: signature.asc
Description: PGP signature

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to