Serial ports have been the primary means of early debugging of new coreboot ports. New hardware doesn't always have a serial port and another method for early debugging is needed.

Serial ports have been the primary means of early debugging of new coreboot ports. New hardware doesn't always have a serial port and another method for early debugging is needed.

−

The '''EHCI Debug Port''' is an optional capability of EHCI controllers. All USB2 host controllers are EHCI controllers. The debug port provides a mode of operation that requires neither RAM nor a full USB stack. A handful of registers in the EHCI controller PCI configuration and BAR address space are used for all communication. All three transfer types are supported (OUT/SETUP/IN) but transfers can only be a maximum of 8 bytes and only one specific physical USB port can be used. A Debug Class compliant device is the only supported USB function that can be communicated with.

+

The '''EHCI Debug Port''' is an optional capability of EHCI controllers which can be used for that purpose.

+

+

All USB2 host controllers are EHCI controllers. The debug port provides a mode of operation that requires neither RAM nor a full USB stack. A handful of registers in the EHCI controller PCI configuration and BAR address space are used for all communication. All three transfer types are supported (OUT/SETUP/IN) but transfers can only be a maximum of 8 bytes and only one specific physical USB port can be used. A Debug Class compliant device is the only supported USB function that can be communicated with.

+

+

While the '''Debug Class''' functional spec describes a device communicating over USB also with the debugging host (aka remote) it would be very possible to make a Debug Class device with a regular serial port on the other end. One thing to watch out for is that such a device might not be able to handle the same throughput as the debug port itself and hence may lose data unless it can do some buffering.

+

+

== Supported chipsets ==

+

+

The following southbridges have USB debug support in coreboot:

+

+

{| border="0" style="font-size: smaller" valign="top"

+

|- bgcolor="#6699dd"

+

! align="left" | Vendor

+

! align="left" | Southbridge

+

! align="left" | Status

+

! align="left" | Comments

+

+

|- bgcolor="#eeeeee" valign="top"

+

| AMD

+

| SB600

+

| style="background:lime" | OK

+

| Tested by [[User:Uwe|Uwe Hermann]].

+

|- bgcolor="#eeeeee" valign="top"

+

| AMD

+

| SB700

+

| style="background:orange" | WIP

+

| Probably won't work, a patch is being prepared.

+

+

|- bgcolor="#dddddd" valign="top"

+

| Intel

+

| 82801GX (ICH7)

+

| style="background:lime" | OK

+

| Tested by [[User:SvenS|Sven Schnelle]] on Lenovo Thinkpad X60/T60.

+

|

+

+

|- bgcolor="#eeeeee" valign="top"

+

| NVIDIA

+

| MCP55

+

| style="background:lime" | OK

+

| Tested by [[User:Uwe|Uwe Hermann]]. Any physical USB port will work, as the code tries all ports until the one with the attached USB Debug device is found.

+

+

|- bgcolor="#dddddd" valign="top"

+

| SiS

+

| SiS966

+

| style="background:yellow" | Untested

+

| '''Note:''' It's unclear if the chipset actually has EHCI Debug Port functionality, and (if yes), whether the current coreboot code supports it properly (or whether it's just copy-pasted code from another chipset).

On your "host PC" you need a Linux system which is recent enough to provide the '''usb_debug''' kernel module. When you attach the Ajays Net20DC device to your host PC, it will create a '''/dev/ttyUSB0''' device to which you can connect as usual using any serial terminal program, e.g. '''minicom''' (115200, 8n1).

+

+

TODO: Is the Baud rate actually configurable somewhere?

−

== Debug Class Device ==

+

You must connect the NET20DC to a special USB port on your coreboot target board (not all of the USB ports will work!), often this is USB port 1. If in doubt, try all available ports to check which one works on your board.

−

While the Debug Class functional spec describes a device communicating over USB also with the debugging host (aka remote) it would be very possible to make a Debug Class device with a regular serial port on the other end. One thing to watch out for is that such a device might not be able to handle the same throughput as the debug port itself and hence may lose data unless it can do some buffering.

−

== Considerations in coreboot ==

+

Then you can power up your coreboot target board and you should see the usual coreboot bootlog in minicom on your host PC.

−

We'll use Mode 1 since a full USB stack and EHCI driver isn't running when we're using the debug port. We get early two-way communication from PCI memory write accesses. printf() should transmit also to the debug port on any (all?) EHCI controllers sporting the capability. Linux already supports this and we could probably copy code or headers from the kernel.

+

+

=== usb_debug_io.c ===

+

+

As an alternative, you can also use [http://tracker.coreboot.org/trac/coreboot/ticket/57 this small libusb-based user-space program] on the host PC to retrieve the coreboot logs.

== Finding the USB debug port ==

== Finding the USB debug port ==

+

Generally, each EHCI controller can offer at most one debug port. That port corresponds to a fixed physical USB port. Locating that physical port is rather difficult because you need to look at lots of information.

Generally, each EHCI controller can offer at most one debug port. That port corresponds to a fixed physical USB port. Locating that physical port is rather difficult because you need to look at lots of information.

−

Carl-Daniel Hailfinger has written a script which can help finding that port: http://coreboot.org/pipermail/coreboot/2008-September/038615.html

+

Carl-Daniel Hailfinger [http://www.coreboot.org/pipermail/coreboot/2008-September/038618.html has written] [http://www.coreboot.org/pipermail/coreboot/attachments/20080909/ae11c291/attachment.sh a script] which can help finding that port.

== Hardware capability ==

== Hardware capability ==

+

The Debug Port is optional, please check if EHCI controllers near you support it:

The Debug Port is optional, please check if EHCI controllers near you support it:

Look for a line like the last one above. Please include the PCI device ID too:

−

Please include the PCI device id too:

+

$ '''for i in $(lspci|grep EHCI|cut -f1 -d' ') ; do

−

+

$ ''' lspci -ns $i'''

−

# lspci -ns $(lspci|grep EHCI|cut -f1 -d' ')

+

$ '''done'''

00:1d.7 0c03: 8086:265c (rev 03)

00:1d.7 0c03: 8086:265c (rev 03)

−

If your controller isn't already listed below then please add it or send an email to the [[Mailinglist]] if you don't have a wiki account yet and want one, or want us to add your controller to the page.

+

If your controller isn't already listed below then please add it or send an email to the [[Mailinglist|mailing list]] if you don't have a wiki account yet and want one, or want us to add your controller to the page.

−

=== Controllers verified to have the Debug port capability ===

+

=== Controllers verified to have the debug port capability ===

* 10b9:5239 ALi Corporation USB 2.0 (USB PCI card)

* 10b9:5239 ALi Corporation USB 2.0 (USB PCI card)

Line 45:

Line 110:

* 8086:283a Intel ICH8

* 8086:283a Intel ICH8

* 8086:293a Intel ICH9 (rev 2)

* 8086:293a Intel ICH9 (rev 2)

+

* 8086:3a3a Intel ICH10

+

* 8086:3a3c Intel ICH10

* 10de:0088 NVIDIA MCP2A (rev a2)

* 10de:0088 NVIDIA MCP2A (rev a2)

* 10de:005b NVIDIA CK804 (rev a3)

* 10de:005b NVIDIA CK804 (rev a3)

Line 54:

Line 121:

* 1106:3104 VIA VX800 (rev 90)

* 1106:3104 VIA VX800 (rev 90)

−

=== Controllers verified to lack the Debug port capability ===

+

=== Controllers verified to lack the debug port capability ===

* 1033:00e0 NEC Corporation EHCI (rev 02) (Compaq part)

* 1033:00e0 NEC Corporation EHCI (rev 02) (Compaq part)

Line 63:

Line 130:

* 1039:7002 SiS EHCI (rev 00)

* 1039:7002 SiS EHCI (rev 00)

−

== Where to buy ==

+

== Devices/Dongles ==

+

+

To be able to use the debug port it needs to be connected to a compatible device.

+

Currently there seems to be only two commercial devices available which can use the EHCI Debug Port, the '''NET20DC''' and the '''AMIDebug RX'''.

+

+

=== DIY ===

+

But you can also make your own usb debug dongle, see [[DIY_EHCI_debug_dongle]].

−

Currently there seems to be only one device which can use the EHCI Debug Port, the '''NET20DC'''.

Revision as of 11:30, 7 June 2013

Serial ports have been the primary means of early debugging of new coreboot ports. New hardware doesn't always have a serial port and another method for early debugging is needed.

The EHCI Debug Port is an optional capability of EHCI controllers which can be used for that purpose.

All USB2 host controllers are EHCI controllers. The debug port provides a mode of operation that requires neither RAM nor a full USB stack. A handful of registers in the EHCI controller PCI configuration and BAR address space are used for all communication. All three transfer types are supported (OUT/SETUP/IN) but transfers can only be a maximum of 8 bytes and only one specific physical USB port can be used. A Debug Class compliant device is the only supported USB function that can be communicated with.

While the Debug Class functional spec describes a device communicating over USB also with the debugging host (aka remote) it would be very possible to make a Debug Class device with a regular serial port on the other end. One thing to watch out for is that such a device might not be able to handle the same throughput as the debug port itself and hence may lose data unless it can do some buffering.

Using the EHCI debug port

usb_debug kernel module and minicom

On your "host PC" you need a Linux system which is recent enough to provide the usb_debug kernel module. When you attach the Ajays Net20DC device to your host PC, it will create a /dev/ttyUSB0 device to which you can connect as usual using any serial terminal program, e.g. minicom (115200, 8n1).

TODO: Is the Baud rate actually configurable somewhere?

You must connect the NET20DC to a special USB port on your coreboot target board (not all of the USB ports will work!), often this is USB port 1. If in doubt, try all available ports to check which one works on your board.

Then you can power up your coreboot target board and you should see the usual coreboot bootlog in minicom on your host PC.

usb_debug_io.c

Finding the USB debug port

Generally, each EHCI controller can offer at most one debug port. That port corresponds to a fixed physical USB port. Locating that physical port is rather difficult because you need to look at lots of information.

Devices/Dongles

To be able to use the debug port it needs to be connected to a compatible device.
Currently there seems to be only two commercial devices available which can use the EHCI Debug Port, the NET20DC and the AMIDebug RX.