This is the area to clarify hardware specification if there's anything unclear from the datasheet. If the specification is software related, please ask in the related software section.

UART0 console works for UEFI Shell but not once booted.

GMN
GMN New Member Posts: 20

UP2 10-pin connector for UART0 to FT232R serial to USB converter. PC and Putty terminal.
This arrangement works fine for console access while in UEFI but once I boot, I cannot access the serial port. I was expecting to send debug output to this port via 0x3F8. What am I missing? If UART0 is not tied to 0x3F8, is there a MMIO address for this UART? Is there another UART on the UP2 that does respond to 0x3F8 (traditional COM 1)?

Answers

  • DCleri
    DCleri Administrator, AAEON Posts: 1,213 admin

    you would need to configure at OS level the Serial port to have it available during and after Operating System boot.

    You can find our tutorials in our wiki: https://wiki.up-community.org/Serial_console#Ubuntu

  • GMN
    GMN New Member Posts: 20

    My OS is OpenVMS, not a linux dist. I have booted on a very wide variety of bare metal and virtual machines and have always been able to access the architecturally defined COM 1 serial port at 0x3F8. But for reasons I have yet to discover, this is not working on the UP2 (Atom). Below is the serial port init sequence which has been successful on all other platforms. If you see anything wrong with this, please reply.

    After this init, a simple __outbyte(0x3F8, 'c'); should work.

    define IER 1

    define IER_DISABLE 0x00

    define LCR 3

    define LCR_DLAB 0x80

    define DLLSB 0

    define DLMSB 1

    define DLLSB_115200 1

    define DLMSB_115200 0

    define LCR_81N 0x03

    define FCR 2

    define FCR_INIT 0xC7

    define MCR 4

    define MCR_INIT 0x0B

    define LSR 5

    define LSR_RBF 1

    define MSR 6

    define MSR_DCD 0x08

    define serial_port 0x3F8 // Architectural COM 1

    // Init the standard serial port to our liking.
    
    __outbyte(serial_port + IER, IER_DISABLE);
    __outbyte(serial_port + LCR, LCR_DLAB);
    __outbyte(serial_port + DLLSB,DLLSB_115200);
    __outbyte(serial_port + DLMSB,DLMSB_115200);
    __outbyte(serial_port + LCR, LCR_81N);
    __outbyte(serial_port + FCR, FCR_INIT);
    __outbyte(serial_port + MCR, MCR_INIT);
    
    if ((__inbyte(serial_port + MSR) & MSR_DCD) != 0) _HaveSerialConnection = 1;
    
  • 9600
    9600 New Member Posts: 8

    My OS is OpenVMS, not a linux dist.

    Do you work for HPE or VSI? If not, I'm curious how you have OpenVMS running on bare metal Intel arch :smile:

  • GMN
    GMN New Member Posts: 20

    Yes I work for VSI and VMS runs fine on the UP2.

  • GMN
    GMN New Member Posts: 20

    To answer my own question; the UP2 does not support legacy port IO addresses for the console serial port. It is a MMIO address that you can extract from the ACPI SPCR table. Once the right address was found, the console works fine.

  • Jeroen van Jaarsveld
    Jeroen van Jaarsveld New Member Posts: 7

    That's interesting - is the MMIO address always the same and if so can you please share it?

  • GMN
    GMN New Member Posts: 20

    First BAR is at 0x9152400