Re: [PATCH 09/12] i386/x86_64: EHCI usb debug port early printk support.
- From: ebiederm@xxxxxxxxxxxx (Eric W. Biederman)
- Date: Mon, 30 Apr 2007 14:54:18 -0600
Andi Kleen <ak@xxxxxxx> writes:
Thanks for writing that code. It should be an interesting alternative
on boxes where firescope doesn't work.
I hope I can eventually merge early firewire support code too.
On Mon, Apr 30, 2007 at 10:32:02AM -0600, Eric W. Biederman wrote:
With legacy free systems serial ports have stopped being an option
to get early boot traces and other debug information out of a machine.
This needs a CONFIG_* at least. And some documentation on how to set it
up on both sides.
Besides CONFIG_EARLY_PRINTK I assume. It is enough code so there is a
case for it.
This debug device can be used to replace serial ports for
kgdb, kdb, and console support. And gregkh has a simple usb
serial driver for it so user space applications that control
serial ports should work unmodified.
But not merged yet, right? I was hoping it could be done from
user space anyways.
Sorry old comment, that piece has been merged for a while.
It is the usb_debug module. It creates a tty device that you
can just cat to get the usb debug output.
For users the hard part looks like it will be finding cables and
finding which is usb debug port 1 and realizing that there is
flow control so the kernel boot will not happen if someone is not
reading the serial console data.
That's nasty. Any way to work around that?
Maybe. It has been long enough since I wrote the code
I need to go back and look.
index 92213d2..dc097aa 100644
--- a/arch/x86_64/kernel/early_printk.c
+++ b/arch/x86_64/kernel/early_printk.c
@@ -3,9 +3,19 @@
#include <linux/init.h>
#include <linux/string.h>
#include <linux/screen_info.h>
+#include <linux/usb/ch9.h>
+#include <linux/pci_regs.h>
+#include <linux/pci_ids.h>
+#include <linux/errno.h>
Can you put it in a separate file please?
Perhaps with a little abstraction in drivers/usb ?
+static void dbgp_breath(void)
+{
+ /* Sleep to give the debug port a chance to breathe */
But you don't?
Good point. At least this early I'm not certain there is any
way I can productively do that. This is before we have calibrated
the tsc's and the like so timeouts are difficult, and as I
recall our default guess isn't.
This lack of a good timeout looks to be the reason ehci_wait_for_port
doesn't timeout in a timely fashion because I don't timeout until
I have wrapped a 32bit number.
+static __u32 __init find_dbgp(int ehci_num, unsigned *rbus, unsigned *rslot,unsigned *rfunc)
This should be probably merged into the early quirks loop
early_console = &simnow_console;
keep_early = 1;
+ } else if (!strncmp(buf, "dbgp", 4)) {
usb would seem to be more intuitive
Could be. I was thinking usb debug port. dbgp is at least unique,
and unfortunately it doesn't look like any old usb cable will
do, so a straight usb I expect would be very misleading.
The truth is I don't have a big need for this. I put it together as
a proof of concept to see how hard it would be, etc. I can clean
it up a little but I'm really hoping I can get this into one of
the development trees and people who have more use for it then I
do can play with it and improve things.
One persons experience on two machines probably isn't quite enough
of a sample to Document how to use this. At least beyond what I
did in my changelog.
Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- References:
- [PATCH 0/12] Early USB debug port and i386 boot cleanups
- From: Eric W. Biederman
- [PATCH 01/12] x86_64: Allow fixmaps to be used with the initial page table.
- From: Eric W. Biederman
- [PATCH 02/12] i386 head.S: Remove unnecessary use of %ebx as the boot cpu flag
- From: Eric W. Biederman
- [PATCH 03/12] i386 head.S: Always run the full set of paging state
- From: Eric W. Biederman
- [PATCH 04/12] i386 voyager: Use modern techniques to setup and teardown low identiy mappings.
- From: Eric W. Biederman
- [PATCH 05/12] i386: During page table initialization always set the leaf page table entries.
- From: Eric W. Biederman
- [PATCH 06/12] i386: Minimum cpu detection cleanups.
- From: Eric W. Biederman
- [PATCH 07/12] i386: Add missing !X86_PAE dependincy to the 2G/2G split.
- From: Eric W. Biederman
- [PATCH 08/12] i386: Convert the boot time page tables to the kernels native format.
- From: Eric W. Biederman
- [PATCH 09/12] i386/x86_64: EHCI usb debug port early printk support.
- From: Eric W. Biederman
- Re: [PATCH 09/12] i386/x86_64: EHCI usb debug port early printk support.
- From: Andi Kleen
- [PATCH 0/12] Early USB debug port and i386 boot cleanups
- Prev by Date: Re: 2.6.21-rc7-mm2 suspend bug. [kernel/kthread.c]
- Next by Date: Natsemi DP83815 driver spaming
- Previous by thread: Re: [PATCH 09/12] i386/x86_64: EHCI usb debug port early printk support.
- Next by thread: Re: [PATCH 06/12] i386: Minimum cpu detection cleanups.
- Index(es):
Relevant Pages
- Re: Using USB instead of RS232 on embeded project
... >finding a laptop with two serial ports if that's what you need. ... PCMCIA
or USB to RS232 exist and have existed for some time. ... >commercial and industrial
applications, not hobbyist setups or VAR systems.) ... either due to burst communications
or random connections ... (comp.arch.embedded) - Re: OHCI IssueBulkTransfer problem
... to send packet when requested. ... David Liao wrote: ... USB
OHCI or SetClrearFeature is send out but your function device ignor it. ... //Pack sent before
transfer timeout and received and returned ... (microsoft.public.windowsce.platbuilder) - Re: OHCI IssueBulkTransfer problem
... your description, it looks like it is certainly Data Toggle issue, the ... USB
OHCI or SetClrearFeature is send out but your function device ignor it. ... //Pack sent before
transfer timeout and received and returned ... When the packet that is lost is sent,
... (microsoft.public.windowsce.platbuilder) - Re: MSComm and USB to RS485 Converters (head hurting now, must have martini)
... a .dll that we then use in various test engineering applications ... RS232 to
RS485 converters work fine but I am out of serial ports ... Make sure the USB device
gets mapped in as a comport and operating ... To me it seems like a shot into their own foot because
it stifles Excel VBA apps and thus Excel sales. ... (sci.electronics.design) - External USB drive on Sun HW
... I'm running sparc64 6.0 and also have an external USB drive enclosure ... umass0:
BBB bulk-in clear stall failed, TIMEOUT ... but /dev only has my two primary drives:
... (freebsd-questions)