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)
Mon, Apr 1, 1:13 PM
Unknown Object (File)
Mar 8 2024, 1:56 AM
Unknown Object (File)
Mar 8 2024, 12:56 AM
Unknown Object (File)
Feb 1 2024, 4:08 PM
Unknown Object (File)
Jan 12 2024, 12:00 AM
Unknown Object (File)
Jan 9 2024, 6:55 AM
Unknown Object (File)
Jan 9 2024, 6:55 AM
Unknown Object (File)
Dec 20 2023, 1:26 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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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

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.