Page MenuHomeFreeBSD

uart: provide and use default rclk for JH7110 UART
ClosedPublic

Authored by mhorne on Oct 15 2025, 3:14 PM.
Tags
None
Referenced Files
F136612787: D53119.id.diff
Tue, Nov 18, 2:18 PM
Unknown Object (File)
Tue, Nov 18, 7:41 AM
Unknown Object (File)
Thu, Nov 6, 8:08 AM
Unknown Object (File)
Mon, Nov 3, 8:13 AM
Unknown Object (File)
Mon, Nov 3, 8:13 AM
Unknown Object (File)
Mon, Nov 3, 8:12 AM
Unknown Object (File)
Thu, Oct 30, 2:22 PM
Unknown Object (File)
Mon, Oct 20, 9:28 PM
Subscribers
None

Details

Summary

A regression in the u-boot-provided JH7110 device tree leaves the uart
incorrectly configured.

The issue arises when a baud rate is specified ('current-speed'
property), but the rclk value is not ('clock-frequency'). Previous
releases, e.g. v2025.04, provided both.

In this instance, we end up defaulting to DEFAULT_RCLK in ns8250_init(),
which is the wrong value. The relevant uart class (uart_snps) should
provide a default rclk in its definition, but it does not. Add a new
variant class with the correct default rclk of 24000000.

Finally, uart_cpu_fdt_probe() needs to be updated to actually query this
default value when it does not find a 'clock-frequency' property. This
was simply missing; the ACPI uart bus behaves identically, see
uart_acpi_probe().

PR: 289978
Reported by: rdunkle@smallcatbrain.com
MFC after: 1 week?
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mhorne created this revision.

The logic for removing this in the FDT is that, on Linux, the clock framework comes up early enough (or at least some early part of it) in order to be able to query the UART clock's frequency from the clock driver, whereas we don't do anything like that with clocks prior to newbus passes, so way too late for cninit.

The logic for removing this in the FDT is that, on Linux, the clock framework comes up early enough (or at least some early part of it) in order to be able to query the UART clock's frequency from the clock driver, whereas we don't do anything like that with clocks prior to newbus passes, so way too late for cninit.

Yes. I can note this in the commit message.

What do you think of the patch?

The logic for removing this in the FDT is that, on Linux, the clock framework comes up early enough (or at least some early part of it) in order to be able to query the UART clock's frequency from the clock driver, whereas we don't do anything like that with clocks prior to newbus passes, so way too late for cninit.

Yes. I can note this in the commit message.

What do you think of the patch?

Seems reasonable at a glance, but not giving a proper approval as I'm busy listening to conference talks.

This revision was not accepted when it landed; it landed in state Needs Review.Fri, Oct 31, 3:30 PM
This revision was automatically updated to reflect the committed changes.