Skip to content
This repository has been archived by the owner on Apr 13, 2019. It is now read-only.

sifive-serial: register uart port as console before adding it #137

Open
wants to merge 1 commit into
base: riscv-linux-4.15
Choose a base branch
from

Conversation

klemens
Copy link

@klemens klemens commented May 20, 2018

The console can be set up (by the kernel) as soon as uart_add_one_port is called. So we have to register the uart port as a console before that. Otherwise sifive_serial_console_setup fails and there is no console at all.

I have run into this problem (early console works fine but the normal console is never activated) with a single-core rocket (sifive/freedom@cd9a525) including the UART running on an fpga with console=ttySI0,115200 in the cmdline. With this patch, linux boots and runs fine, but I don't know much about the linux uart system, so take it with a grain of salt.

The console can be set up as soon as uart_add_one_port is called. So we
have to register the uart port as a console before that. Otherwise
sifive_serial_console_setup fails and there is no console at all.
@acw1251
Copy link

acw1251 commented Jun 5, 2018

I just came across this problem too, and fixed it in an equivalent way.

I am using a modified version of spike (custom simifc_t class without htif). I have a custom device tree and I'm trying to use a sifive uart as the console. My fix was identical except I put sifive_serial_remove_console_port(ssp); before the goto probe_out3 instead of after the probe_out3 label. Since nowhere else jumps to probe_out3 it should be effectively the same.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants