How to use mini-PCIe Serial port

1,093 views
Skip to first unread message

David Hendricks

unread,
Jul 2, 2010, 6:33:58 PM7/2/10
to chromiu...@chromium.org
Some folks doing bring-up work are using mini-PCIe cards to get serial connectivity. This is useful for situations where you might not have networking or VGA available and during *very* early debugging.

Here's a brief explanation of how to get it working for Chromium OS. This is pretty generic and can apply to other distros, though the part about presenting a serial login prompt may differ.

My setup is a generic x86 netbook and an Oxford 950-based mini-PCIe to serial adapter. Here is a snippet from dmesg. Linux sets everything up nicely for this device:
[    0.676698] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.678173] serial 0000:04:00.3: PCI INT D -> GSI 18 (level, low) -> IRQ 18
[    0.678716] 1 ports detected on Oxford PCI Express device
[    0.678910] ttyS0: detected caps 00000700 should be 00000100
[    0.679365] 0000:04:00.3: ttyS0 at MMIO 0x50401000 (irq = 18) is a 16C950/954
[    0.679899] console [ttyS0] enabled, bootconsole disabled

The MMIO base address is important. You can obtain this information a couple of ways, but the easiest is to either look at dmesg or look at /proc/iomem:
localhost ~ # cat /proc/iomem | grep serial
    50401000-50401007 : serial

Once you know the MMIO base address, you can add this to your kernel command-line (modify UART settings as needed):
console=uart8250,mmio,0x50401000,115200n8

If you want a login prompt to appear, you'll need to add an init service to start one. Here's an example init script, /etc/init/ttyS0:
/etc/init/ttyS0:
start on startup
stop on starting halt or starting reboot

respawn
exec /sbin/agetty -L -w 115200 ttyS1 linux

Congrats, you have now turned your high-tech mini-PCIe expansion slot into a serial port. Happy hacking!

--
David Hendricks (dhendrix)
Systems Software Engineer, Google Inc.

Nick Sanders

unread,
Aug 18, 2010, 3:46:05 PM8/18/10
to David Hendricks, chromiu...@chromium.org
You can edit the kernel commandline in the build at 
build_kernel_image.sh:120

Or, if you are running a legacy bios, you can edit sdb12:/syslinux/usb.A.cfg
on a prebuilt image.

--
Chromium OS Developers mailing list: chromiu...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en

David Hendricks

unread,
Jun 2, 2011, 11:27:45 PM6/2/11
to Chromium OS dev
For those who do a lot of serial debugging, I updated and improved these instructions to include needed Linux configuration changes and some other ideas for how to find alternate IO and MMIO addresses.


Enjoy!
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages