* [PATCH v3 0/3] tty: serial: Add earlycon support to MT8173 SoC
@ 2015-04-28 13:40 Eddie Huang
2015-04-28 13:40 ` [PATCH v3 1/3] tty: serial: 8250: export early_serial8250_setup function Eddie Huang
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Eddie Huang @ 2015-04-28 13:40 UTC (permalink / raw)
To: Greg Kroah-Hartman, Matthias Brugger
Cc: srv_heupstream, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Catalin Marinas, Will Deacon,
Jiri Slaby, Eddie Huang, Howard Chen, Ashwin Chaugule,
Peter Hurley, Wang Long, Kevin Cernekee, Vineet Gupta,
Rafael J. Wysocki, Alan Cox, devicetree, linux-arm-kernel,
linux-kernel, linux-serial, linux-mediatek
This patch add earlycon support to MT8173 SoC platform.
To use earlycon, need
1. Add earlycon in boot parameters
2. Add "linux,sdtout-path" property in device tree file
This patch based on 4.1-rc1.
Change in v3:
Remove noinit options, not necessary, because 8250_early.c will not init hardware
if not provide baudrate.
Change v2:
1. Add noinit options.
2. Remove duplicate code in 8250_mtk.c, reuse the 8250_early.c existed function.
Eddie Huang (3):
tty: serial: 8250: export early_serial8250_setup function
tty: serial: 8250_mtk: Add earlycon
arm64: dts: Add mediatek MT8173 earlycon support
arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 4 +++-
drivers/tty/serial/8250/8250_early.c | 2 +-
drivers/tty/serial/8250/8250_mtk.c | 13 +++++++++++++
include/linux/serial_8250.h | 2 ++
4 files changed, 19 insertions(+), 2 deletions(-)
--
1.8.1.1.dirty
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v3 1/3] tty: serial: 8250: export early_serial8250_setup function
2015-04-28 13:40 [PATCH v3 0/3] tty: serial: Add earlycon support to MT8173 SoC Eddie Huang
@ 2015-04-28 13:40 ` Eddie Huang
2015-04-28 13:40 ` [PATCH v3 2/3] tty: serial: 8250_mtk: Add earlycon Eddie Huang
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Eddie Huang @ 2015-04-28 13:40 UTC (permalink / raw)
To: Greg Kroah-Hartman, Matthias Brugger
Cc: srv_heupstream, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Catalin Marinas, Will Deacon,
Jiri Slaby, Eddie Huang, Howard Chen, Ashwin Chaugule,
Peter Hurley, Wang Long, Kevin Cernekee, Vineet Gupta,
Rafael J. Wysocki, Alan Cox, devicetree, linux-arm-kernel,
linux-kernel, linux-serial, linux-mediatek
8250-like uart driver may call early_serial8250_setup to
reuse 8250_early.c character output function.
Signed-off-by: Eddie Huang <eddie.huang@mediatek.com>
---
drivers/tty/serial/8250/8250_early.c | 2 +-
include/linux/serial_8250.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/8250/8250_early.c b/drivers/tty/serial/8250/8250_early.c
index 6c0fd8b..771dda2 100644
--- a/drivers/tty/serial/8250/8250_early.c
+++ b/drivers/tty/serial/8250/8250_early.c
@@ -131,7 +131,7 @@ static void __init init_port(struct earlycon_device *device)
serial8250_early_out(port, UART_LCR, c & ~UART_LCR_DLAB);
}
-static int __init early_serial8250_setup(struct earlycon_device *device,
+int __init early_serial8250_setup(struct earlycon_device *device,
const char *options)
{
if (!(device->port.membase || device->port.iobase))
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 78097e7..f0c68d8 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -137,6 +137,8 @@ extern int early_serial_setup(struct uart_port *port);
extern unsigned int serial8250_early_in(struct uart_port *port, int offset);
extern void serial8250_early_out(struct uart_port *port, int offset, int value);
+extern int early_serial8250_setup(struct earlycon_device *device,
+ const char *options);
extern void serial8250_do_set_termios(struct uart_port *port,
struct ktermios *termios, struct ktermios *old);
extern int serial8250_do_startup(struct uart_port *port);
--
1.8.1.1.dirty
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v3 2/3] tty: serial: 8250_mtk: Add earlycon
2015-04-28 13:40 [PATCH v3 0/3] tty: serial: Add earlycon support to MT8173 SoC Eddie Huang
2015-04-28 13:40 ` [PATCH v3 1/3] tty: serial: 8250: export early_serial8250_setup function Eddie Huang
@ 2015-04-28 13:40 ` Eddie Huang
2015-04-28 13:40 ` [PATCH v3 3/3] arm64: dts: Add mediatek MT8173 earlycon support Eddie Huang
[not found] ` <1430228434-31779-1-git-send-email-eddie.huang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
3 siblings, 0 replies; 7+ messages in thread
From: Eddie Huang @ 2015-04-28 13:40 UTC (permalink / raw)
To: Greg Kroah-Hartman, Matthias Brugger
Cc: srv_heupstream, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Catalin Marinas, Will Deacon,
Jiri Slaby, Eddie Huang, Howard Chen, Ashwin Chaugule,
Peter Hurley, Wang Long, Kevin Cernekee, Vineet Gupta,
Rafael J. Wysocki, Alan Cox, devicetree, linux-arm-kernel,
linux-kernel, linux-serial, linux-mediatek
Add 8250 MTK UART driver to support earlycon device tree.
Earlycon take effect by
add "earlycon" in kernel boot argument
add "linux,sdtout-path" property in device tree file
Signed-off-by: Eddie Huang <eddie.huang@mediatek.com>
---
drivers/tty/serial/8250/8250_mtk.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c
index 7a11fac..8b2a666 100644
--- a/drivers/tty/serial/8250/8250_mtk.c
+++ b/drivers/tty/serial/8250/8250_mtk.c
@@ -289,6 +289,19 @@ static struct platform_driver mtk8250_platform_driver = {
};
module_platform_driver(mtk8250_platform_driver);
+static int __init early_mtk8250_setup(struct earlycon_device *device,
+ const char *options)
+{
+ if (!device->port.membase)
+ return -ENODEV;
+
+ device->port.iotype = UPIO_MEM32;
+
+ return early_serial8250_setup(device, NULL);
+}
+
+OF_EARLYCON_DECLARE(mtk8250, "mediatek,mt6577-uart", early_mtk8250_setup);
+
MODULE_AUTHOR("Matthias Brugger");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Mediatek 8250 serial port driver");
--
1.8.1.1.dirty
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v3 3/3] arm64: dts: Add mediatek MT8173 earlycon support
2015-04-28 13:40 [PATCH v3 0/3] tty: serial: Add earlycon support to MT8173 SoC Eddie Huang
2015-04-28 13:40 ` [PATCH v3 1/3] tty: serial: 8250: export early_serial8250_setup function Eddie Huang
2015-04-28 13:40 ` [PATCH v3 2/3] tty: serial: 8250_mtk: Add earlycon Eddie Huang
@ 2015-04-28 13:40 ` Eddie Huang
2015-04-29 6:44 ` Sascha Hauer
[not found] ` <1430228434-31779-1-git-send-email-eddie.huang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
3 siblings, 1 reply; 7+ messages in thread
From: Eddie Huang @ 2015-04-28 13:40 UTC (permalink / raw)
To: Greg Kroah-Hartman, Matthias Brugger
Cc: srv_heupstream, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Catalin Marinas, Will Deacon,
Jiri Slaby, Eddie Huang, Howard Chen, Ashwin Chaugule,
Peter Hurley, Wang Long, Kevin Cernekee, Vineet Gupta,
Rafael J. Wysocki, Alan Cox, devicetree, linux-arm-kernel,
linux-kernel, linux-serial, linux-mediatek
Add earlycon support to mediatek MT8173 evaluation board dts.
Signed-off-by: Eddie Huang <eddie.huang@mediatek.com>
---
arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts
index 43d5401..d4cf751 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts
@@ -30,7 +30,9 @@
reg = <0 0x40000000 0 0x80000000>;
};
- chosen { };
+ chosen {
+ linux,stdout-path = &uart0;
+ };
};
&uart0 {
--
1.8.1.1.dirty
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v3 3/3] arm64: dts: Add mediatek MT8173 earlycon support
2015-04-28 13:40 ` [PATCH v3 3/3] arm64: dts: Add mediatek MT8173 earlycon support Eddie Huang
@ 2015-04-29 6:44 ` Sascha Hauer
2015-04-29 8:19 ` Vineet Gupta
0 siblings, 1 reply; 7+ messages in thread
From: Sascha Hauer @ 2015-04-29 6:44 UTC (permalink / raw)
To: Eddie Huang
Cc: Greg Kroah-Hartman, Matthias Brugger, srv_heupstream, Rob Herring,
Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
Catalin Marinas, Will Deacon, Jiri Slaby, Howard Chen,
Ashwin Chaugule, Peter Hurley, Wang Long, Kevin Cernekee,
Vineet Gupta, Rafael J. Wysocki, Alan Cox, devicetree,
linux-arm-kernel, linux-kernel, linux-serial, linux-mediatek@
Hi Eddie,
On Tue, Apr 28, 2015 at 09:40:34PM +0800, Eddie Huang wrote:
> Add earlycon support to mediatek MT8173 evaluation board dts.
This is not about earlycon support. It adds the stdout-path property
which is generally about console. It only happens to used for earlycon,
but would be used as a regular console aswell if it wasn't broken for
some kernel revisisions.
>
> - chosen { };
> + chosen {
> + linux,stdout-path = &uart0;
> + };
Please use stdout-path, without the 'linux,'.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 0/3] tty: serial: Add earlycon support to MT8173 SoC
[not found] ` <1430228434-31779-1-git-send-email-eddie.huang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
@ 2015-04-29 6:46 ` Sascha Hauer
0 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2015-04-29 6:46 UTC (permalink / raw)
To: Eddie Huang
Cc: Greg Kroah-Hartman, Matthias Brugger,
srv_heupstream-NuS5LvNUpcJWk0Htik3J/w, Rob Herring, Pawel Moll,
Mark Rutland, Ian Campbell, Kumar Gala, Catalin Marinas,
Will Deacon, Jiri Slaby, Howard Chen, Ashwin Chaugule,
Peter Hurley, Wang Long, Kevin Cernekee, Vineet Gupta,
Rafael J. Wysocki, Alan Cox, devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-serial-u79uwXL29TY76Z2rM5mHXA, linux-mediatek@
On Tue, Apr 28, 2015 at 09:40:31PM +0800, Eddie Huang wrote:
> This patch add earlycon support to MT8173 SoC platform.
> To use earlycon, need
> 1. Add earlycon in boot parameters
> 2. Add "linux,sdtout-path" property in device tree file
>
> This patch based on 4.1-rc1.
>
> Change in v3:
> Remove noinit options, not necessary, because 8250_early.c will not init hardware
> if not provide baudrate.
>
> Change v2:
> 1. Add noinit options.
> 2. Remove duplicate code in 8250_mtk.c, reuse the 8250_early.c existed function.
>
> Eddie Huang (3):
> tty: serial: 8250: export early_serial8250_setup function
> tty: serial: 8250_mtk: Add earlycon
> arm64: dts: Add mediatek MT8173 earlycon support
Works fine here:
Tested-by: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 3/3] arm64: dts: Add mediatek MT8173 earlycon support
2015-04-29 6:44 ` Sascha Hauer
@ 2015-04-29 8:19 ` Vineet Gupta
0 siblings, 0 replies; 7+ messages in thread
From: Vineet Gupta @ 2015-04-29 8:19 UTC (permalink / raw)
To: Sascha Hauer, Eddie Huang
Cc: Greg Kroah-Hartman, Matthias Brugger,
srv_heupstream-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
Catalin Marinas, Will Deacon, Jiri Slaby, Howard Chen,
Ashwin Chaugule, Peter Hurley, Wang Long, Kevin Cernekee,
Rafael J. Wysocki, Alan Cox,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
On Wednesday 29 April 2015 12:15 PM, Sascha Hauer wrote:
> Hi Eddie,
>
> On Tue, Apr 28, 2015 at 09:40:34PM +0800, Eddie Huang wrote:
>> Add earlycon support to mediatek MT8173 evaluation board dts.
> This is not about earlycon support. It adds the stdout-path property
> which is generally about console.
Indeed, this is shorter way of specifying the default console by referring to uart
device.
> It only happens to used for earlycon,
> but would be used as a regular console aswell if it wasn't broken for
> some kernel revisisions.
Really - I'm confused. When I last tried this for arc_uart (in 3.17 time frame),
it would setup default console, but to use it for earlycon we needed
bootargs=earlycon in chosen. However I had to revet that change since OF core
still was fixing a few things in that area.
See mainline 22524b02b17b901f28 ("Revert "ARC: [arcfpga] stdout-path now suffices
for earlycon/console"")
-Vineet
>
>>
>> - chosen { };
>> + chosen {
>> + linux,stdout-path = &uart0;
>> + };
> Please use stdout-path, without the 'linux,'.
>
> Sascha
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-04-29 8:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-28 13:40 [PATCH v3 0/3] tty: serial: Add earlycon support to MT8173 SoC Eddie Huang
2015-04-28 13:40 ` [PATCH v3 1/3] tty: serial: 8250: export early_serial8250_setup function Eddie Huang
2015-04-28 13:40 ` [PATCH v3 2/3] tty: serial: 8250_mtk: Add earlycon Eddie Huang
2015-04-28 13:40 ` [PATCH v3 3/3] arm64: dts: Add mediatek MT8173 earlycon support Eddie Huang
2015-04-29 6:44 ` Sascha Hauer
2015-04-29 8:19 ` Vineet Gupta
[not found] ` <1430228434-31779-1-git-send-email-eddie.huang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-04-29 6:46 ` [PATCH v3 0/3] tty: serial: Add earlycon support to MT8173 SoC Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).