[SeaBIOS] [PATCH] Updated version of OXPCIe serial port support

Kevin O'Connor kevin at koconnor.net
Sat Feb 12 23:30:17 CET 2011


On Fri, Feb 11, 2011 at 01:18:03PM -0800, Stefan Reinauer wrote:
> add support for OXPCIe 952 card and clean up debug abstraction layer
> 
> Signed-off-by: Stefan Reinauer <reinauer at google.com>

Thanks.  See comments below.

[...]
> +#define OXPCIE_COM1 (oxpcie_bar + 0x1000)
> +u32 oxpcie_bar VAR16VISIBLE;

I don't think it's a good idea to have an all caps define that
references a variable.

[...]
> +        oxpcie_bar = pci_config_readl(oxpcie_bdf, 0x10);

s/0x10/PCI_BASE_ADDRESS_0/

> +// Write a character to the serial port.
> +static void
> +debug_serial_oxford(char c)
> +{
> +    if (!CONFIG_DEBUG_SERIAL_OXFORD)
> +        return;
> +    if (!oxpcie_bar)
> +        return;
> +
> +    int timeout = DEBUG_TIMEOUT;
> +    while ((readb((void *)OXPCIE_COM1+SEROFF_LSR) & 0x60) != 0x60)

I'm not sure how this will work.  The bar is likely to be in high
memory, yet this code can be run from 16bit mode.

There is now pci_readl/pci_writel for trampolining into 32bit mode to
read/write BARs.  Would you want to trampoline to 32bit mode for a
debug device though?

The rest of the patch looks okay to me.

-Kevin



More information about the SeaBIOS mailing list