Page MenuHomeFreeBSD

uart_dev_pl011: add EARLY_PRINTF support
AbandonedPublic

Authored by jchandra on Feb 4 2019, 7:40 PM.

Details

Reviewers
andrew
Group Reviewers
ARM
Summary

Implement early_putc for ARM PL011 uart. This will be useful for debugging
failures during early boot.

[RFC, I can commit it if it will be useful.]

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 22341

Event Timeline

jchandra created this revision.Feb 4 2019, 7:40 PM
andrew added inline comments.Feb 4 2019, 9:03 PM
sys/dev/uart/uart_dev_pl011.c
615

Unfortunately we can't just have this, it needs to be (for anything that might be in GENERIC on arm or arm64):

#if 0
#ifdef EARLY_PRINTF
...
#endif
#endif
jchandra abandoned this revision.Feb 4 2019, 10:33 PM

On second thought, for now I think I will drop this until we have a better EARLY_PRINTF

sys/dev/uart/uart_dev_pl011.c
615

Yes, it was a bad idea.
This would cause duplicate symbol for early_putc in case other drivers do the same thing. We will need a unique name for each driver.

Additionally, on arm64 we seem to do a 1G mapping for the address space. I will drop the patches until both of the problems are fixed.

ian added a subscriber: ian.Feb 5 2019, 2:13 AM
ian added inline comments.
sys/dev/uart/uart_dev_pl011.c
615

It is seriously not worth complicating the EARLY_PRINTF code with any kind of scheme for avoiding symbol clashes. By design, this code is turned off all the time, and it should be. The need for it is so rare, and the implementations of it are so machine/board/chip-specific, that by design you build a custom kernel with the right things enabled to use it for the target you're working on just when you need it.

jchandra added inline comments.Feb 6 2019, 9:29 PM
sys/dev/uart/uart_dev_pl011.c
615

Probably calling it "problems" was not accurate. EARLY_PRINTF was really useful to figure out a memory region setup failure I saw.

Having to edit source files to enable a conf option somehow seems strange to me, that is why I was not keen on checking it in.