Page MenuHomeFreeBSD

Allow the FDT uart driver to select witch device node to use
ClosedPublic

Authored by andrew on Sep 3 2015, 4:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 20, 4:20 PM
Unknown Object (File)
Fri, Dec 20, 4:18 PM
Unknown Object (File)
Fri, Dec 20, 10:21 AM
Unknown Object (File)
Wed, Dec 11, 4:58 AM
Unknown Object (File)
Oct 24 2024, 5:51 AM
Unknown Object (File)
Oct 24 2024, 2:14 AM
Unknown Object (File)
Oct 22 2024, 9:35 PM
Unknown Object (File)
Oct 21 2024, 1:52 PM
Subscribers

Details

Summary

Some upstream dts files lack a stdout in /choosen. In these cases
we default to serial0, however this may be incorrect. This adds
support to set the node we should use in loader.

An example of this would be to add the following to loader.conf:
hw.fdt.console="/smb/uart@f7113000"

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 380
Build 380: arc lint + arc unit

Event Timeline

andrew retitled this revision from to Allow the FDT uart driver to select witch device node to use.
andrew updated this object.
andrew edited the test plan for this revision. (Show Details)
andrew added reviewers: ARM, MIPS.

Generally I like this, though hw.fdt.console seems limiting. hw.uart.console already exists, and also lets you set UART parameters. I see that we do this to a limited extent for current-speed below and hard-wire 8:1:N. We've done this for a long time, so I don't know how important it is, but I thought I'd point out the inconsistency.

sys/dev/uart/uart_cpu_fdt.c
156

There are other things than /chose/stdin /chosen/stdout. Perhaps you should limit things explicitly to those?

166–167

I'm torn. Is there some reason we don't do this when the user has specified a node that doesn't exist (eg node == -1 when cp != NULL)

We could follow the stdout-path bindings [1] in this node, but this would need us to parse them first.

I'm also open to a better name for the environment variable.

[1] https://www.kernel.org/doc/Documentation/devicetree/bindings/chosen.txt

sys/dev/uart/uart_cpu_fdt.c
156

This is just changing the indentation of existing code, there is extra data in some of these, but that is out of the scope for this change.

166–167

The user could disable the fdt console with this by setting it to an invalid node, e.g. hw.fdt.console="none"

This revision was automatically updated to reflect the committed changes.