Page MenuHomeFreeBSD

arm64: add a driver for the uart found on Apple Silicon machines
ClosedPublic

Authored by kevans on Dec 17 2024, 2:45 PM.
Tags
None
Referenced Files
F116018937: D48120.diff
Thu, May 1, 4:48 PM
Unknown Object (File)
Thu, Apr 17, 2:46 AM
Unknown Object (File)
Mon, Apr 14, 4:37 PM
Unknown Object (File)
Mon, Apr 7, 1:12 AM
Unknown Object (File)
Sat, Apr 5, 3:04 PM
Unknown Object (File)
Sat, Apr 5, 3:04 PM
Unknown Object (File)
Sat, Apr 5, 3:03 PM
Unknown Object (File)
Wed, Apr 2, 2:58 AM
Subscribers

Details

Summary

This is a revival of the old exynos4210 driver, with some additional
bits to configure the apple "s5l" uart (which is actually slightly
different to operate).

This hasn't been tested on anything that would hit the non-s5l path, so
banish it off to the apple/ domain until someone cares to confirm that
none of the other hardware is broken -- it may be that nobody does, but
the complexity isn't too bad: mostly the driver1 construct added to the
uart_bas that we use to avoid having a whole bunch of shims for uart
driver methods and hardcoded references to the cfg structs.

Diff Detail

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

Event Timeline

sys/arm64/apple/exynos_uart.c
30–31

Not needed

558–559

I wonder if we could merge this with compat_cfg_data, e.g. by putting them together like this:

struct exynos_uart_class {
 struct uart_class base;
 struct exynos_uart_cfg cfg;
};
sys/arm64/apple/exynos_uart.h
35

Not needed

kevans marked 2 inline comments as done.

Address review feedback

Remove obsolete $FreeBSD$ tags, add SPDX tags to new old files.

The cfg and class data are now tied together; note that the driver1 kludge has
to remain for the time being, as we don't have a reliable way to get that from
uart_ops. There's a period of time where a uart_devinfo is not yet associated
with a uart_softc, so we have no immediate path back to the class in the earlier
stages of boot before newbus has probed the uart.

Just minor style issues

sys/arm64/apple/exynos_uart.c
523–524

Should these be macros?

527

Should this be (...) != 0?

534

And this

This revision is now accepted and ready to land.Mar 31 2025, 10:27 AM