sifive-serial: register uart port as console before adding it
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 (https://github.com/sifive/freedom/commit/cd9a525a662b9eaf27c14533159d723efcf4c184) 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.
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.