Search code examples
x86serial-portdevice-driveru-boot

No input in U-Boot command line


It looks either I get lost the skills how to google for an answer, or missed too obvious option in the configuration. Anyway, I have a U-Boot latest release for x86, which works till command prompt, where unfortunately I can’t type anything.

Added debug prints to getc() of ns16550 driver show that the input is actually there, though no echo on the screen and no actual execution of the command if I type it correctly and press Enter.

fdtdec_get_config_string: bootcmd
fdtdec_get_config_int: bootsecure
fdtdec_get_int: bootsecure: (not found)
=> getc() d
getc() d
getc() 70
getc() 72
getc() 69
getc() 6e
getc() 74
getc() 65
getc() 6e
getc() 76
getc() d

(It has Enter, Enter, and printenv + Enter)

There’s serial interface only, so I can’t switch to alternative.


Solution

  • The problem appeared in a broken hardware (it's actually a simulation), where unaligned I/O byte access doesn't work. So, what happen is in between of the following code:

    if (!(serial_in(&com_port->lsr) & UART_LSR_DR))
        return -EAGAIN;
    

    Since LSR has address 0x3fd (offset 5), serial_in() returns 0xFF and thus skips return from here assuming data available, while reading RBR returns 0x00 repeatedly.

    Solution is either to fix hardware, or make a custom serial driver for it.