We'll just assume we've just powered on the machine, and jumped straight into the beginning of the linux kernel after the BIOS has done the DDR init etc.
mithro
futaris: Correct
futaris
So, just rewrite ENTRY(_emergency_print) first...
So the original function in the original routine clobbers r4, r5, r6, r7. putc is l.movhi r4,hi(UART_BASE_ADD) ...
Actually, looking at your init code for uart, we probably should do the same. uart_ev_pending_write(uart_ev_pending_read()); and uart_ev_enable_write(UART_EV_TX);
We don't need irqs in early emergency_printk support. Just keep polling until we can print.
mithro
futaris: Yeah
futaris: Have you attempted to build my qemu with litex support?
futaris
Yeah, it builds.
mithro
I was just helping shenki to build it then
futaris: As part of the HDMI2USB-litex-firmware?
futaris
I think I just built from the tree.
mithro
futaris: with the ./build-qemu-litex.sh script?
futaris
I'll try that script again soon. Last time I built using the script, I only built lm32, not or1k.
mithro
Yeah - I'm pretty sure that shenki just discovered that using that script doesn't really work for or1k at the moment
futaris has quit
I'm heading to dinner be back in an hour
futarisWeb joined the channel
Sewar joined the channel
futarisWeb
The following packages will be DOWNGRADED due to dependency conflicts: python: 3.6.0-0 --> 3.5.3-1
./scripts/download-env.sh fails at openocd for me.
arcticShadow joined the channel
drivers/tty/serial/8250 is where the or1k (non litex) UART is done. CONFIG_SERIAL_8250, CONFIG_SERIAL_8250_CONSOLE. 8250_of.c gets the information from the devicetree if CONFIG_SERIAL_OF_PLATFORM is defined.
I only just saw today, that you can't change baudrate for example... I'm just looking through drivers/tty/serial trying to see the simplest uart driver, to base a new litex uart off.
futarisIRCcloud: You were telling me how to modify head.S?
futarisIRCcloud
Just need to modify _early_uart_init. It'll probably work if we remove everything, and just "l.jr r9" then "nop".
I don't quite understand all the or1k asm, but _emergency_printf should just check until it can write, putc, check that the byte was written, then do the same for the next character until it reaches the end of the string.
mithro
What is l.jr r9?
futarisIRCcloud
return to where this function was called from.
mithro
Oh
Well, I guess we don't really need to init the uart