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
F80137357: D3559.id.diff
Thu, Mar 28, 10:39 AM
Unknown Object (File)
Feb 20 2024, 12:47 AM
Unknown Object (File)
Feb 20 2024, 12:47 AM
Unknown Object (File)
Feb 20 2024, 12:46 AM
Unknown Object (File)
Feb 19 2024, 6:06 PM
Unknown Object (File)
Feb 3 2024, 3:08 PM
Unknown Object (File)
Jan 3 2024, 4:26 AM
Unknown Object (File)
Dec 23 2023, 11:45 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 Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #8460)

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

166–167 ↗(On Diff #8460)

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 ↗(On Diff #8460)

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 ↗(On Diff #8460)

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.