* [PATCH RESEND] powerpc: make udbg 16550 boot console configurable for EMBEDDED
@ 2008-12-23 13:11 Peter Korsgaard
2008-12-23 17:24 ` Scott Wood
2008-12-23 20:19 ` Benjamin Herrenschmidt
0 siblings, 2 replies; 3+ messages in thread
From: Peter Korsgaard @ 2008-12-23 13:11 UTC (permalink / raw)
To: paulus, benh, linuxppc-dev
The udbg console is currently always enabled for platforms selecting
the PPC_UDBG_16550 symbol (needed to create platform devices for
8250 SoC UARTs from DT).
Now, the udbg console is nice for debugging as it works so early, but
it also has a number of disadvantages:
- It doesn't respect console= and still outputs console messages even
if console isn't ttySx (E.G. if CONFIG_SILENT_CONSOLE is enabled in
U-Boot which sets 'console='
- It's slow (boot is ~0.3s slower on my mpc8347 platform compared to
using the 8250 driver right away)
- It slightly bloats the kernel (pretty insignificant, around 1K)
As that isn't always desirable, add a PPC_UDBG_16550_CONSOLE kconfig
symbol to let the user disable it (only visible if CONFIG_EMBEDDED).
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
---
arch/powerpc/kernel/Makefile | 3 ++-
arch/powerpc/kernel/legacy_serial.c | 4 ++++
arch/powerpc/platforms/Kconfig | 7 +++++++
3 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 92673b4..4651c0b 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -80,7 +80,8 @@ obj-$(CONFIG_MODULES) += ppc_ksyms.o
obj-$(CONFIG_BOOTX_TEXT) += btext.o
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_KPROBES) += kprobes.o
-obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o udbg_16550.o
+obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o
+obj-$(CONFIG_PPC_UDBG_16550_CONSOLE) += udbg_16550.o
obj-$(CONFIG_STACKTRACE) += stacktrace.o
pci64-$(CONFIG_PPC64) += pci_dn.o isa-bridge.o
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index 9ddfaef..c0e9866 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -279,6 +279,7 @@ static int __init add_legacy_pci_port(struct device_node *np,
}
#endif
+#ifdef CONFIG_PPC_UDBG_16550_CONSOLE
static void __init setup_legacy_serial_console(int console)
{
struct legacy_serial_info *info =
@@ -295,6 +296,9 @@ static void __init setup_legacy_serial_console(int console)
DBG("default console speed = %d\n", info->speed);
udbg_init_uart(addr, info->speed, info->clock);
}
+#else
+#define setup_legacy_serial_console(console) do { } while (0)
+#endif
/*
* This is called very early, as part of setup_system() or eventually
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 47e956c..bc3ce47 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -312,4 +312,11 @@ config MPC8xxx_GPIO
Say Y here if you're going to use hardware that connects to the
MPC831x/834x/837x/8572/8610 GPIOs.
+config PPC_UDBG_16550_CONSOLE
+ bool "Boot console on 16550 UDBG" if EMBEDDED
+ depends on PPC_UDBG_16550
+ default y
+ help
+ Say Y here to use the UDBG infrastructure for early boot messages.
+
endmenu
--
1.5.6.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH RESEND] powerpc: make udbg 16550 boot console configurable for EMBEDDED
2008-12-23 13:11 [PATCH RESEND] powerpc: make udbg 16550 boot console configurable for EMBEDDED Peter Korsgaard
@ 2008-12-23 17:24 ` Scott Wood
2008-12-23 20:19 ` Benjamin Herrenschmidt
1 sibling, 0 replies; 3+ messages in thread
From: Scott Wood @ 2008-12-23 17:24 UTC (permalink / raw)
To: Peter Korsgaard; +Cc: paulus, linuxppc-dev
Peter Korsgaard wrote:
> - It doesn't respect console= and still outputs console messages even
> if console isn't ttySx (E.G. if CONFIG_SILENT_CONSOLE is enabled in
> U-Boot which sets 'console='
I believe it uses /chosen/linux,stdout-path; u-boot could clear that if
silent console is desired.
> As that isn't always desirable, add a PPC_UDBG_16550_CONSOLE kconfig
> symbol to let the user disable it (only visible if CONFIG_EMBEDDED).
There's an existing CONFIG_PPC_EARLY_DEBUG that it could depend on instead.
-Scott
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH RESEND] powerpc: make udbg 16550 boot console configurable for EMBEDDED
2008-12-23 13:11 [PATCH RESEND] powerpc: make udbg 16550 boot console configurable for EMBEDDED Peter Korsgaard
2008-12-23 17:24 ` Scott Wood
@ 2008-12-23 20:19 ` Benjamin Herrenschmidt
1 sibling, 0 replies; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2008-12-23 20:19 UTC (permalink / raw)
To: Peter Korsgaard; +Cc: linuxppc-dev, paulus
On Tue, 2008-12-23 at 14:11 +0100, Peter Korsgaard wrote:
> The udbg console is currently always enabled for platforms selecting
> the PPC_UDBG_16550 symbol (needed to create platform devices for
> 8250 SoC UARTs from DT).
>
> Now, the udbg console is nice for debugging as it works so early, but
> it also has a number of disadvantages:
.../...
I don't think that's the right approach.
I think a better one is to make a config option that selects whether the
udbg console is registered. ie. CONFIG_UDBG_CONSOLE which would affect
the calls sites in setup_32/64.c or the register_udbg_console() function
itself in udbg.c
Ben.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-12-23 20:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-23 13:11 [PATCH RESEND] powerpc: make udbg 16550 boot console configurable for EMBEDDED Peter Korsgaard
2008-12-23 17:24 ` Scott Wood
2008-12-23 20:19 ` Benjamin Herrenschmidt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.