• Sam Ravnborg's avatar
    serial: apbuart: fix console prompt on qemu · c6dcd805
    Sam Ravnborg authored
    
    
    When using a leon kernel with qemu there where no console prompt.
    The root cause is the handling of the fifo size in the tx part of the
    apbuart driver.
    
    The qemu uart driver only have a very rudimentary status handling and do
    not report the number of chars queued in the tx fifo in the status register.
    So the driver ends up with a fifo size of 1.
    
    In the tx path the fifo size is divided by 2 - resulting in a fifo
    size of zero.
    
    The original implementation would always try to send one char, but
    after the introduction of uart_port_tx_limited() the fifo size is
    respected even for the first char.
    
    There seems to be no good reason to divide the fifo size with two - so
    remove this. It looks like something copied from the original amba driver.
    
    With qemu we now have a minimum fifo size of one char, so we show
    the prompt.
    Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
    Fixes: d11cc8c3 ("tty: serial: use uart_port_tx_limited()")
    Cc: Andreas Larsson <andreas@gaisler.com>
    Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Cc: Jiri Slaby <jirislaby@kernel.org>
    Cc:  <linux-serial@vger.kernel.org>
    Cc:  <sparclinux@vger.kernel.org>
    Link: https://lore.kernel.org/r/20231226121607.GA2622970@ravnborg.org
    
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    c6dcd805
apbuart.c 15.3 KB