Re: [PATCH v4 03/12] serial: mvebu-uart: initial support for Armada-3700 serial port

2016-02-18 Thread Gregory CLEMENT
Hi Greg and Jiri
 
 On mar., févr. 16 2016, Gregory CLEMENT  
wrote:

> From: Wilson Ding 
>
> Armada-3700's uart is a simple serial port, which doesn't
> support. Configuring the modem control lines. The uart port has a 32
> bytes Tx FIFO and a 64 bytes Rx FIFO
>
> The uart driver implements the uart core operations. It also support the
> system (early) console based on Armada-3700's serial port.
>
> Known Issue:
>
> The uart driver currently doesn't support clock programming, which means
> the baud-rate stays with the default value configured by the bootloader
> at boot time
>
> [gregory.clem...@free-electrons.com: Rewrite many part which are too long
> to enumerate]
>
> Signed-off-by: Wilson Ding 
> Signed-off-by: Nadav Haklai 
> Signed-off-by: Gregory CLEMENT 
> Acked-by: Rob Herring 

I took care of the arm related part of the series, but I will let you
apply this patch in the serial subsystem once you have reviewed it. But
if for any reason you preferred that I took it through mvebu just tell
me.

Thanks,

Gregory

> ---
>  .../devicetree/bindings/tty/serial/mvebu-uart.txt  |  13 +
>  Documentation/kernel-parameters.txt|   6 +
>  drivers/tty/serial/Kconfig |  22 +
>  drivers/tty/serial/Makefile|   1 +
>  drivers/tty/serial/mvebu-uart.c| 650 
> +
>  include/uapi/linux/serial_core.h   |   3 +
>  6 files changed, 695 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/tty/serial/mvebu-uart.txt
>  create mode 100644 drivers/tty/serial/mvebu-uart.c
>
> diff --git a/Documentation/devicetree/bindings/tty/serial/mvebu-uart.txt 
> b/Documentation/devicetree/bindings/tty/serial/mvebu-uart.txt
> new file mode 100644
> index ..6087defd9f93
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/tty/serial/mvebu-uart.txt
> @@ -0,0 +1,13 @@
> +* Marvell UART : Non standard UART used in some of Marvell EBU SoCs (e.g., 
> Armada-3700)
> +
> +Required properties:
> +- compatible: "marvell,armada-3700-uart"
> +- reg: offset and length of the register set for the device.
> +- interrupts: device interrupt
> +
> +Example:
> + serial@12000 {
> + compatible = "marvell,armada-3700-uart";
> + reg = <0x12000 0x400>;
> + interrupts = <43>;
> + };
> diff --git a/Documentation/kernel-parameters.txt 
> b/Documentation/kernel-parameters.txt
> index 87d40a72f6a1..ea0aba48d616 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -1058,6 +1058,12 @@ bytes respectively. Such letter suffixes can also be 
> entirely omitted.
>   A valid base address must be provided, and the serial
>   port must already be setup and configured.
>  
> + armada3700_uart,
> + Start an early, polled-mode console on the
> + Armada 3700 serial port at the specified
> + address. The serial port must already be setup
> + and configured. Options are not yet supported.
> +
>   earlyprintk=[X86,SH,BLACKFIN,ARM,M68k]
>   earlyprintk=vga
>   earlyprintk=efi
> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
> index 39721ec4f415..b291f934d51b 100644
> --- a/drivers/tty/serial/Kconfig
> +++ b/drivers/tty/serial/Kconfig
> @@ -1606,6 +1606,28 @@ config SERIAL_STM32_CONSOLE
>   depends on SERIAL_STM32=y
>   select SERIAL_CORE_CONSOLE
>  
> +config SERIAL_MVEBU_UART
> + bool "Marvell EBU serial port support"
> + select SERIAL_CORE
> + help
> +   This driver is for Marvell EBU SoC's UART. If you have a machine
> +   based on the Armada-3700 SoC and wish to use the on-board serial
> +   port,
> +   say 'Y' here.
> +   Otherwise, say 'N'.
> +
> +config SERIAL_MVEBU_CONSOLE
> + bool "Console on Marvell EBU serial port"
> + depends on SERIAL_MVEBU_UART
> + select SERIAL_CORE_CONSOLE
> + select SERIAL_EARLYCON
> + default y
> + help
> +   Say 'Y' here if you wish to use Armada-3700 UART as the system 
> console.
> +   (the system console is the device which receives all kernel messages
> +   and warnings and which allows logins in single user mode)
> +   Otherwise, say 'N'.
> +
>  endmenu
>  
>  config SERIAL_MCTRL_GPIO
> diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
> index b391c9b31960..988167595330 100644
> --- a/drivers/tty/serial/Makefile
> +++ b/drivers/tty/serial/Makefile
> @@ -91,6 +91,7 @@ obj-$(CONFIG_SERIAL_CONEXANT_DIGICOLOR) += 
> digicolor-usart.o
>  obj-$(CONFIG_SERIAL_MEN_Z135)+= men_z135_uart.o
>  obj-$(CONFIG_SERIAL_SPRD) += sprd_serial.o
>  

Re: [PATCH v4 03/12] serial: mvebu-uart: initial support for Armada-3700 serial port

2016-02-18 Thread Gregory CLEMENT
Hi Greg and Jiri
 
 On mar., févr. 16 2016, Gregory CLEMENT  
wrote:

> From: Wilson Ding 
>
> Armada-3700's uart is a simple serial port, which doesn't
> support. Configuring the modem control lines. The uart port has a 32
> bytes Tx FIFO and a 64 bytes Rx FIFO
>
> The uart driver implements the uart core operations. It also support the
> system (early) console based on Armada-3700's serial port.
>
> Known Issue:
>
> The uart driver currently doesn't support clock programming, which means
> the baud-rate stays with the default value configured by the bootloader
> at boot time
>
> [gregory.clem...@free-electrons.com: Rewrite many part which are too long
> to enumerate]
>
> Signed-off-by: Wilson Ding 
> Signed-off-by: Nadav Haklai 
> Signed-off-by: Gregory CLEMENT 
> Acked-by: Rob Herring 

I took care of the arm related part of the series, but I will let you
apply this patch in the serial subsystem once you have reviewed it. But
if for any reason you preferred that I took it through mvebu just tell
me.

Thanks,

Gregory

> ---
>  .../devicetree/bindings/tty/serial/mvebu-uart.txt  |  13 +
>  Documentation/kernel-parameters.txt|   6 +
>  drivers/tty/serial/Kconfig |  22 +
>  drivers/tty/serial/Makefile|   1 +
>  drivers/tty/serial/mvebu-uart.c| 650 
> +
>  include/uapi/linux/serial_core.h   |   3 +
>  6 files changed, 695 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/tty/serial/mvebu-uart.txt
>  create mode 100644 drivers/tty/serial/mvebu-uart.c
>
> diff --git a/Documentation/devicetree/bindings/tty/serial/mvebu-uart.txt 
> b/Documentation/devicetree/bindings/tty/serial/mvebu-uart.txt
> new file mode 100644
> index ..6087defd9f93
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/tty/serial/mvebu-uart.txt
> @@ -0,0 +1,13 @@
> +* Marvell UART : Non standard UART used in some of Marvell EBU SoCs (e.g., 
> Armada-3700)
> +
> +Required properties:
> +- compatible: "marvell,armada-3700-uart"
> +- reg: offset and length of the register set for the device.
> +- interrupts: device interrupt
> +
> +Example:
> + serial@12000 {
> + compatible = "marvell,armada-3700-uart";
> + reg = <0x12000 0x400>;
> + interrupts = <43>;
> + };
> diff --git a/Documentation/kernel-parameters.txt 
> b/Documentation/kernel-parameters.txt
> index 87d40a72f6a1..ea0aba48d616 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -1058,6 +1058,12 @@ bytes respectively. Such letter suffixes can also be 
> entirely omitted.
>   A valid base address must be provided, and the serial
>   port must already be setup and configured.
>  
> + armada3700_uart,
> + Start an early, polled-mode console on the
> + Armada 3700 serial port at the specified
> + address. The serial port must already be setup
> + and configured. Options are not yet supported.
> +
>   earlyprintk=[X86,SH,BLACKFIN,ARM,M68k]
>   earlyprintk=vga
>   earlyprintk=efi
> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
> index 39721ec4f415..b291f934d51b 100644
> --- a/drivers/tty/serial/Kconfig
> +++ b/drivers/tty/serial/Kconfig
> @@ -1606,6 +1606,28 @@ config SERIAL_STM32_CONSOLE
>   depends on SERIAL_STM32=y
>   select SERIAL_CORE_CONSOLE
>  
> +config SERIAL_MVEBU_UART
> + bool "Marvell EBU serial port support"
> + select SERIAL_CORE
> + help
> +   This driver is for Marvell EBU SoC's UART. If you have a machine
> +   based on the Armada-3700 SoC and wish to use the on-board serial
> +   port,
> +   say 'Y' here.
> +   Otherwise, say 'N'.
> +
> +config SERIAL_MVEBU_CONSOLE
> + bool "Console on Marvell EBU serial port"
> + depends on SERIAL_MVEBU_UART
> + select SERIAL_CORE_CONSOLE
> + select SERIAL_EARLYCON
> + default y
> + help
> +   Say 'Y' here if you wish to use Armada-3700 UART as the system 
> console.
> +   (the system console is the device which receives all kernel messages
> +   and warnings and which allows logins in single user mode)
> +   Otherwise, say 'N'.
> +
>  endmenu
>  
>  config SERIAL_MCTRL_GPIO
> diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
> index b391c9b31960..988167595330 100644
> --- a/drivers/tty/serial/Makefile
> +++ b/drivers/tty/serial/Makefile
> @@ -91,6 +91,7 @@ obj-$(CONFIG_SERIAL_CONEXANT_DIGICOLOR) += 
> digicolor-usart.o
>  obj-$(CONFIG_SERIAL_MEN_Z135)+= men_z135_uart.o
>  obj-$(CONFIG_SERIAL_SPRD) += sprd_serial.o
>  obj-$(CONFIG_SERIAL_STM32)   += stm32-usart.o
> +obj-$(CONFIG_SERIAL_MVEBU_UART)  += mvebu-uart.o
>  
>  # GPIOLIB helpers for modem control lines
>  

Re: [PATCH v4 03/12] serial: mvebu-uart: initial support for Armada-3700 serial port

2016-02-16 Thread Arnd Bergmann
On Tuesday 16 February 2016 22:27:06 Thomas Petazzoni wrote:
> Arnd,
> 
> On Tue, 16 Feb 2016 22:20:51 +0100, Arnd Bergmann wrote:
> 
> > > +config SERIAL_MVEBU_CONSOLE
> > > +   bool "Console on Marvell EBU serial port"
> > > +   depends on SERIAL_MVEBU_UART
> > 
> > then this one must become
> > 
> >   depends on SERIAL_MVEBU_UART
> > 
> > so it does not get enabled if the driver is not builtin.
> 
> Hm, what's the different between "depends on SERIAL_MVEBU_UART" and
> "depends on SERIAL_MVEBU_UART" ? Is it the late time that causes my
> eyes to misunderstand what you mean, or some typo on your side ? 
> 


typo: I meant

depends on SERIAL_MVEBU_UART=y


Arnd


Re: [PATCH v4 03/12] serial: mvebu-uart: initial support for Armada-3700 serial port

2016-02-16 Thread Arnd Bergmann
On Tuesday 16 February 2016 22:27:06 Thomas Petazzoni wrote:
> Arnd,
> 
> On Tue, 16 Feb 2016 22:20:51 +0100, Arnd Bergmann wrote:
> 
> > > +config SERIAL_MVEBU_CONSOLE
> > > +   bool "Console on Marvell EBU serial port"
> > > +   depends on SERIAL_MVEBU_UART
> > 
> > then this one must become
> > 
> >   depends on SERIAL_MVEBU_UART
> > 
> > so it does not get enabled if the driver is not builtin.
> 
> Hm, what's the different between "depends on SERIAL_MVEBU_UART" and
> "depends on SERIAL_MVEBU_UART" ? Is it the late time that causes my
> eyes to misunderstand what you mean, or some typo on your side ? 
> 


typo: I meant

depends on SERIAL_MVEBU_UART=y


Arnd


Re: [PATCH v4 03/12] serial: mvebu-uart: initial support for Armada-3700 serial port

2016-02-16 Thread Thomas Petazzoni
Arnd,

On Tue, 16 Feb 2016 22:20:51 +0100, Arnd Bergmann wrote:

> > +config SERIAL_MVEBU_CONSOLE
> > +   bool "Console on Marvell EBU serial port"
> > +   depends on SERIAL_MVEBU_UART
> 
> then this one must become
> 
>   depends on SERIAL_MVEBU_UART
> 
> so it does not get enabled if the driver is not builtin.

Hm, what's the different between "depends on SERIAL_MVEBU_UART" and
"depends on SERIAL_MVEBU_UART" ? Is it the late time that causes my
eyes to misunderstand what you mean, or some typo on your side ? :-)

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


Re: [PATCH v4 03/12] serial: mvebu-uart: initial support for Armada-3700 serial port

2016-02-16 Thread Thomas Petazzoni
Arnd,

On Tue, 16 Feb 2016 22:20:51 +0100, Arnd Bergmann wrote:

> > +config SERIAL_MVEBU_CONSOLE
> > +   bool "Console on Marvell EBU serial port"
> > +   depends on SERIAL_MVEBU_UART
> 
> then this one must become
> 
>   depends on SERIAL_MVEBU_UART
> 
> so it does not get enabled if the driver is not builtin.

Hm, what's the different between "depends on SERIAL_MVEBU_UART" and
"depends on SERIAL_MVEBU_UART" ? Is it the late time that causes my
eyes to misunderstand what you mean, or some typo on your side ? :-)

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


Re: [PATCH v4 03/12] serial: mvebu-uart: initial support for Armada-3700 serial port

2016-02-16 Thread Arnd Bergmann
On Tuesday 16 February 2016 19:14:53 Gregory CLEMENT wrote:
> 
> +config SERIAL_MVEBU_UART
> +   bool "Marvell EBU serial port support"
> +   select SERIAL_CORE

It would be nice to make this a tristate option with

depends on ARCH_MVEBU || COMPILE_TEST

so we can build it in an allmodconfig kernel as a standalone module
like the other drivers.

> +
> +config SERIAL_MVEBU_CONSOLE
> +   bool "Console on Marvell EBU serial port"
> +   depends on SERIAL_MVEBU_UART

then this one must become

depends on SERIAL_MVEBU_UART

so it does not get enabled if the driver is not builtin.

Arnd


Re: [PATCH v4 03/12] serial: mvebu-uart: initial support for Armada-3700 serial port

2016-02-16 Thread Arnd Bergmann
On Tuesday 16 February 2016 19:14:53 Gregory CLEMENT wrote:
> 
> +config SERIAL_MVEBU_UART
> +   bool "Marvell EBU serial port support"
> +   select SERIAL_CORE

It would be nice to make this a tristate option with

depends on ARCH_MVEBU || COMPILE_TEST

so we can build it in an allmodconfig kernel as a standalone module
like the other drivers.

> +
> +config SERIAL_MVEBU_CONSOLE
> +   bool "Console on Marvell EBU serial port"
> +   depends on SERIAL_MVEBU_UART

then this one must become

depends on SERIAL_MVEBU_UART

so it does not get enabled if the driver is not builtin.

Arnd


[PATCH v4 03/12] serial: mvebu-uart: initial support for Armada-3700 serial port

2016-02-16 Thread Gregory CLEMENT
From: Wilson Ding 

Armada-3700's uart is a simple serial port, which doesn't
support. Configuring the modem control lines. The uart port has a 32
bytes Tx FIFO and a 64 bytes Rx FIFO

The uart driver implements the uart core operations. It also support the
system (early) console based on Armada-3700's serial port.

Known Issue:

The uart driver currently doesn't support clock programming, which means
the baud-rate stays with the default value configured by the bootloader
at boot time

[gregory.clem...@free-electrons.com: Rewrite many part which are too long
to enumerate]

Signed-off-by: Wilson Ding 
Signed-off-by: Nadav Haklai 
Signed-off-by: Gregory CLEMENT 
Acked-by: Rob Herring 
---
 .../devicetree/bindings/tty/serial/mvebu-uart.txt  |  13 +
 Documentation/kernel-parameters.txt|   6 +
 drivers/tty/serial/Kconfig |  22 +
 drivers/tty/serial/Makefile|   1 +
 drivers/tty/serial/mvebu-uart.c| 650 +
 include/uapi/linux/serial_core.h   |   3 +
 6 files changed, 695 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/tty/serial/mvebu-uart.txt
 create mode 100644 drivers/tty/serial/mvebu-uart.c

diff --git a/Documentation/devicetree/bindings/tty/serial/mvebu-uart.txt 
b/Documentation/devicetree/bindings/tty/serial/mvebu-uart.txt
new file mode 100644
index ..6087defd9f93
--- /dev/null
+++ b/Documentation/devicetree/bindings/tty/serial/mvebu-uart.txt
@@ -0,0 +1,13 @@
+* Marvell UART : Non standard UART used in some of Marvell EBU SoCs (e.g., 
Armada-3700)
+
+Required properties:
+- compatible: "marvell,armada-3700-uart"
+- reg: offset and length of the register set for the device.
+- interrupts: device interrupt
+
+Example:
+   serial@12000 {
+   compatible = "marvell,armada-3700-uart";
+   reg = <0x12000 0x400>;
+   interrupts = <43>;
+   };
diff --git a/Documentation/kernel-parameters.txt 
b/Documentation/kernel-parameters.txt
index 87d40a72f6a1..ea0aba48d616 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1058,6 +1058,12 @@ bytes respectively. Such letter suffixes can also be 
entirely omitted.
A valid base address must be provided, and the serial
port must already be setup and configured.
 
+   armada3700_uart,
+   Start an early, polled-mode console on the
+   Armada 3700 serial port at the specified
+   address. The serial port must already be setup
+   and configured. Options are not yet supported.
+
earlyprintk=[X86,SH,BLACKFIN,ARM,M68k]
earlyprintk=vga
earlyprintk=efi
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 39721ec4f415..b291f934d51b 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -1606,6 +1606,28 @@ config SERIAL_STM32_CONSOLE
depends on SERIAL_STM32=y
select SERIAL_CORE_CONSOLE
 
+config SERIAL_MVEBU_UART
+   bool "Marvell EBU serial port support"
+   select SERIAL_CORE
+   help
+ This driver is for Marvell EBU SoC's UART. If you have a machine
+ based on the Armada-3700 SoC and wish to use the on-board serial
+ port,
+ say 'Y' here.
+ Otherwise, say 'N'.
+
+config SERIAL_MVEBU_CONSOLE
+   bool "Console on Marvell EBU serial port"
+   depends on SERIAL_MVEBU_UART
+   select SERIAL_CORE_CONSOLE
+   select SERIAL_EARLYCON
+   default y
+   help
+ Say 'Y' here if you wish to use Armada-3700 UART as the system 
console.
+ (the system console is the device which receives all kernel messages
+ and warnings and which allows logins in single user mode)
+ Otherwise, say 'N'.
+
 endmenu
 
 config SERIAL_MCTRL_GPIO
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
index b391c9b31960..988167595330 100644
--- a/drivers/tty/serial/Makefile
+++ b/drivers/tty/serial/Makefile
@@ -91,6 +91,7 @@ obj-$(CONFIG_SERIAL_CONEXANT_DIGICOLOR)   += 
digicolor-usart.o
 obj-$(CONFIG_SERIAL_MEN_Z135)  += men_z135_uart.o
 obj-$(CONFIG_SERIAL_SPRD) += sprd_serial.o
 obj-$(CONFIG_SERIAL_STM32) += stm32-usart.o
+obj-$(CONFIG_SERIAL_MVEBU_UART)+= mvebu-uart.o
 
 # GPIOLIB helpers for modem control lines
 obj-$(CONFIG_SERIAL_MCTRL_GPIO)+= serial_mctrl_gpio.o
diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c
new file mode 100644
index ..0ff27818bb87
--- /dev/null
+++ b/drivers/tty/serial/mvebu-uart.c
@@ -0,0 +1,650 @@
+/*
+* ***
+* Copyright (C) 2015 

[PATCH v4 03/12] serial: mvebu-uart: initial support for Armada-3700 serial port

2016-02-16 Thread Gregory CLEMENT
From: Wilson Ding 

Armada-3700's uart is a simple serial port, which doesn't
support. Configuring the modem control lines. The uart port has a 32
bytes Tx FIFO and a 64 bytes Rx FIFO

The uart driver implements the uart core operations. It also support the
system (early) console based on Armada-3700's serial port.

Known Issue:

The uart driver currently doesn't support clock programming, which means
the baud-rate stays with the default value configured by the bootloader
at boot time

[gregory.clem...@free-electrons.com: Rewrite many part which are too long
to enumerate]

Signed-off-by: Wilson Ding 
Signed-off-by: Nadav Haklai 
Signed-off-by: Gregory CLEMENT 
Acked-by: Rob Herring 
---
 .../devicetree/bindings/tty/serial/mvebu-uart.txt  |  13 +
 Documentation/kernel-parameters.txt|   6 +
 drivers/tty/serial/Kconfig |  22 +
 drivers/tty/serial/Makefile|   1 +
 drivers/tty/serial/mvebu-uart.c| 650 +
 include/uapi/linux/serial_core.h   |   3 +
 6 files changed, 695 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/tty/serial/mvebu-uart.txt
 create mode 100644 drivers/tty/serial/mvebu-uart.c

diff --git a/Documentation/devicetree/bindings/tty/serial/mvebu-uart.txt 
b/Documentation/devicetree/bindings/tty/serial/mvebu-uart.txt
new file mode 100644
index ..6087defd9f93
--- /dev/null
+++ b/Documentation/devicetree/bindings/tty/serial/mvebu-uart.txt
@@ -0,0 +1,13 @@
+* Marvell UART : Non standard UART used in some of Marvell EBU SoCs (e.g., 
Armada-3700)
+
+Required properties:
+- compatible: "marvell,armada-3700-uart"
+- reg: offset and length of the register set for the device.
+- interrupts: device interrupt
+
+Example:
+   serial@12000 {
+   compatible = "marvell,armada-3700-uart";
+   reg = <0x12000 0x400>;
+   interrupts = <43>;
+   };
diff --git a/Documentation/kernel-parameters.txt 
b/Documentation/kernel-parameters.txt
index 87d40a72f6a1..ea0aba48d616 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1058,6 +1058,12 @@ bytes respectively. Such letter suffixes can also be 
entirely omitted.
A valid base address must be provided, and the serial
port must already be setup and configured.
 
+   armada3700_uart,
+   Start an early, polled-mode console on the
+   Armada 3700 serial port at the specified
+   address. The serial port must already be setup
+   and configured. Options are not yet supported.
+
earlyprintk=[X86,SH,BLACKFIN,ARM,M68k]
earlyprintk=vga
earlyprintk=efi
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 39721ec4f415..b291f934d51b 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -1606,6 +1606,28 @@ config SERIAL_STM32_CONSOLE
depends on SERIAL_STM32=y
select SERIAL_CORE_CONSOLE
 
+config SERIAL_MVEBU_UART
+   bool "Marvell EBU serial port support"
+   select SERIAL_CORE
+   help
+ This driver is for Marvell EBU SoC's UART. If you have a machine
+ based on the Armada-3700 SoC and wish to use the on-board serial
+ port,
+ say 'Y' here.
+ Otherwise, say 'N'.
+
+config SERIAL_MVEBU_CONSOLE
+   bool "Console on Marvell EBU serial port"
+   depends on SERIAL_MVEBU_UART
+   select SERIAL_CORE_CONSOLE
+   select SERIAL_EARLYCON
+   default y
+   help
+ Say 'Y' here if you wish to use Armada-3700 UART as the system 
console.
+ (the system console is the device which receives all kernel messages
+ and warnings and which allows logins in single user mode)
+ Otherwise, say 'N'.
+
 endmenu
 
 config SERIAL_MCTRL_GPIO
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
index b391c9b31960..988167595330 100644
--- a/drivers/tty/serial/Makefile
+++ b/drivers/tty/serial/Makefile
@@ -91,6 +91,7 @@ obj-$(CONFIG_SERIAL_CONEXANT_DIGICOLOR)   += 
digicolor-usart.o
 obj-$(CONFIG_SERIAL_MEN_Z135)  += men_z135_uart.o
 obj-$(CONFIG_SERIAL_SPRD) += sprd_serial.o
 obj-$(CONFIG_SERIAL_STM32) += stm32-usart.o
+obj-$(CONFIG_SERIAL_MVEBU_UART)+= mvebu-uart.o
 
 # GPIOLIB helpers for modem control lines
 obj-$(CONFIG_SERIAL_MCTRL_GPIO)+= serial_mctrl_gpio.o
diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c
new file mode 100644
index ..0ff27818bb87
--- /dev/null
+++ b/drivers/tty/serial/mvebu-uart.c
@@ -0,0 +1,650 @@
+/*
+* ***
+* Copyright (C) 2015 Marvell International Ltd.
+* ***
+* This