Page MenuHomeFreeBSD

reg-io-width option for UART drivers
ClosedPublic

Authored by br on Feb 24 2017, 4:43 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 1, 6:30 PM
Unknown Object (File)
Mon, Sep 21, 3:59 PM
Unknown Object (File)
Sun, Sep 20, 6:07 PM
Unknown Object (File)
Sun, Sep 20, 5:03 AM
Unknown Object (File)
Wed, Sep 16, 9:19 AM
Unknown Object (File)
Fri, Sep 11, 5:15 PM
Unknown Object (File)
Thu, Sep 10, 6:22 PM
Unknown Object (File)
Sep 8 2026, 6:48 AM
Subscribers

Details

Summary

allow setting access width for UART registers

This is required for FDT's standard "reg-io-width" property (similar too "reg-shift" property)

This fixes operation for Altera Arria 10 development kit, where standard ns8250 uart allows 4-byte access only.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

br retitled this revision from to reg-io-width option for UART drivers.
br updated this object.
br edited the test plan for this revision. (Show Details)
br added reviewers: ARM, arm64, MIPS, mmel.
br edited edge metadata.

use static inline funcs for uart_setreg, uart_getreg and consider reg-io-width == 2

kan added a reviewer: kan.
kan added a subscriber: kan.

No objections.

This revision is now accepted and ready to land.Feb 27 2017, 4:01 PM
marcel edited edge metadata.
marcel added inline comments.
sys/dev/uart/uart_core.c
494

I'm ok with the change, but with yet another parameter that ends up in the uart_bas structure, I wonder if it isn't about time we simply pass a uart_bas structure instead.

Such would make future changes (are there any left to expect?) a lot easier as well.

I had a different solution of a similar issue for Netlogic XLP. Instead of handling it in UART, I had subclassed the simplebus with a updated implementation of bus_alloc_resource(https://svnweb.freebsd.org/base/head/sys/mips/nlm/xlp_simplebus.c). I provided a different bustag for UART (and other devices) that needed 4-byte access that implementation. The bus implementation took care of reading 4 bytes and extracting and returning the significant byte.

Thought I would mention it, I don't have any objection to this way of doing it either.

This revision was automatically updated to reflect the committed changes.