From: Eddie Huang <eddie.huang@mediatek.com> Date: 2014-12-18 08:34:06
This series add earlycon support to Mediatek MT8173 SoC. Although 8250 driver
already has earlycon support, but Mediatek UART has highspeed register that
not in 8250_early.c, so I port earlycon in 8250_mtk.c, and add stdout device
tree support.
This patchset is based on 3.18, and my basic support for Mediatek MT8173 Soc [1].
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-December/311238.html
Eddie Huang (2):
tty: serial: 8250_mtk: Add earlycon
arm64: dts: Add mediatek MT8173 earlycon support
arch/arm64/boot/dts/mt8173-evb.dts | 4 +++-
drivers/tty/serial/8250/8250_mtk.c | 33 +++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+), 1 deletion(-)
--
1.8.1.1.dirty
From: Eddie Huang <eddie.huang@mediatek.com> Date: 2014-12-18 08:34:09
Mediatek UART has highspeed register, but 8250_early.c doesn't
support this, so add earlycon in 8250_mtk.c
Signed-off-by: Eddie Huang <eddie.huang@mediatek.com>
---
drivers/tty/serial/8250/8250_mtk.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
2014-12-18 9:33 GMT+01:00 Eddie Huang [off-list ref]:
quoted hunk
Mediatek UART has highspeed register, but 8250_early.c doesn't
support this, so add earlycon in 8250_mtk.c
Signed-off-by: Eddie Huang <eddie.huang@mediatek.com>
---
drivers/tty/serial/8250/8250_mtk.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
On Thursday 18 December 2014 09:48:31 Matthias Brugger wrote:
quoted
+static void __init mtk8250_serial_putc(struct uart_port *port, int c)+{+ while ((readl(port->membase + (UART_LSR << 2)) & BOTH_EMPTY) !=+ BOTH_EMPTY)+ ;
Please delete newline before the semicolon.
No, that newline is best kept in there for clarity. An even better way
to write this would be using cpu_relax():
while ((readl(port->membase + (UART_LSR << 2)) & BOTH_EMPTY) != BOTH_EMPTY)
cpu_relax();
which the kernel convention for doing busy-loops.
Arnd
From: Rob Herring <hidden> Date: 2014-12-26 21:25:12
On Thu, Dec 18, 2014 at 2:33 AM, Eddie Huang [off-list ref] wrote:
Mediatek UART has highspeed register, but 8250_early.c doesn't
support this, so add earlycon in 8250_mtk.c
I don't see any highspeed register setup here. More generically,
aren't you just skipping any UART setup? That may be useful on other
platforms with 8250s, too. With the kernel command line version, you
could perhaps add a "noinit" flag. The DT case is harder, and I'm not
sure how we should handle that. We could perhaps add a
"stdout-path-initialized" flag to chosen.
From: Eddie Huang <eddie.huang@mediatek.com> Date: 2014-12-29 04:25:17
Hi Rob,
On Fri, 2014-12-26 at 15:24 -0600, Rob Herring wrote:
On Thu, Dec 18, 2014 at 2:33 AM, Eddie Huang [off-list ref] wrote:
quoted
Mediatek UART has highspeed register, but 8250_early.c doesn't
support this, so add earlycon in 8250_mtk.c
I don't see any highspeed register setup here. More generically,
aren't you just skipping any UART setup? That may be useful on other
platforms with 8250s, too. With the kernel command line version, you
could perhaps add a "noinit" flag. The DT case is harder, and I'm not
sure how we should handle that. We could perhaps add a
"stdout-path-initialized" flag to chosen.
Yes, I skipped UART setup same as msm_serial.c and amba-pl011.c
(although they are standalone serial driver). Just like earlyprintk, I
think earlycon should reuse UART setting in loader. Since some other
platforms with 8250 already depend on this, it's ok to add flags to
distinguish whether 8250 earlycon driver should init hw or not. As you
said, add "noinit" flag is simple, but "stdout-path-initialized" need
more discussion.
From: Rob Herring <hidden> Date: 2014-12-29 14:54:26
On Sun, Dec 28, 2014 at 10:24 PM, Eddie Huang [off-list ref] wrote:
Hi Rob,
On Fri, 2014-12-26 at 15:24 -0600, Rob Herring wrote:
quoted
On Thu, Dec 18, 2014 at 2:33 AM, Eddie Huang [off-list ref] wrote:
quoted
Mediatek UART has highspeed register, but 8250_early.c doesn't
support this, so add earlycon in 8250_mtk.c
I don't see any highspeed register setup here. More generically,
aren't you just skipping any UART setup? That may be useful on other
platforms with 8250s, too. With the kernel command line version, you
could perhaps add a "noinit" flag. The DT case is harder, and I'm not
sure how we should handle that. We could perhaps add a
"stdout-path-initialized" flag to chosen.
Yes, I skipped UART setup same as msm_serial.c and amba-pl011.c
(although they are standalone serial driver). Just like earlyprintk, I
think earlycon should reuse UART setting in loader. Since some other
platforms with 8250 already depend on this, it's ok to add flags to
distinguish whether 8250 earlycon driver should init hw or not. As you
said, add "noinit" flag is simple, but "stdout-path-initialized" need
more discussion.
On Monday 29 December 2014 12:24:56 Eddie Huang wrote:
Hi Rob,
On Fri, 2014-12-26 at 15:24 -0600, Rob Herring wrote:
quoted
On Thu, Dec 18, 2014 at 2:33 AM, Eddie Huang [off-list ref] wrote:
quoted
Mediatek UART has highspeed register, but 8250_early.c doesn't
support this, so add earlycon in 8250_mtk.c
I don't see any highspeed register setup here. More generically,
aren't you just skipping any UART setup? That may be useful on other
platforms with 8250s, too. With the kernel command line version, you
could perhaps add a "noinit" flag. The DT case is harder, and I'm not
sure how we should handle that. We could perhaps add a
"stdout-path-initialized" flag to chosen.
Yes, I skipped UART setup same as msm_serial.c and amba-pl011.c
(although they are standalone serial driver). Just like earlyprintk, I
think earlycon should reuse UART setting in loader. Since some other
platforms with 8250 already depend on this, it's ok to add flags to
distinguish whether 8250 earlycon driver should init hw or not. As you
said, add "noinit" flag is simple, but "stdout-path-initialized" need
more discussion.
It would definitely be nice to have consistent behavior, and I also
think it would be good to default to noinit for the console, because that
is the more likely case. Basically anything that can do debug_ll on ARM
already depends on this behavior because the debug_ll infrastructure
does not initialize the console before using it. I believe the same
is true for powerpc udbg.
Arnd