Page MenuHomeFreeBSD

reg-io-width option for UART drivers

Authored by br on Feb 24 2017, 4:43 PM.



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

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

br updated this revision to Diff 25653.Feb 24 2017, 4:43 PM
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 updated this object.Feb 24 2017, 5:01 PM
br edited edge metadata.
br added a reviewer: jchandra.Feb 27 2017, 9:53 AM
br updated this revision to Diff 25748.Feb 27 2017, 1:15 PM

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

br added a reviewer: marcel.Feb 27 2017, 2:40 PM
kan accepted this revision.Feb 27 2017, 4:01 PM
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 accepted this revision.Feb 27 2017, 4:52 PM
marcel edited edge metadata.
marcel added inline comments.
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.

jchandra edited edge metadata.Feb 27 2017, 5:52 PM

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( 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.