Page MenuHomeFreeBSD

uart_dev_pl011: add EARLY_PRINTF support
AbandonedPublic

Authored by jchandra on Feb 4 2019, 7:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 18, 11:06 PM
Unknown Object (File)
Wed, Apr 17, 10:42 AM
Unknown Object (File)
Dec 22 2023, 10:23 PM
Unknown Object (File)
Dec 8 2023, 1:24 AM
Unknown Object (File)
Nov 10 2023, 11:14 PM
Unknown Object (File)
Oct 21 2023, 4:29 PM
Unknown Object (File)
Oct 9 2023, 10:14 PM
Unknown Object (File)
Sep 9 2023, 7:19 AM
Subscribers

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 - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 22341

Event Timeline

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

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 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.

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.