Page MenuHomeFreeBSD

uart: Add support for snps,dw-apb-uart clock and hwreset resources
ClosedPublic

Authored by jmcneill on Mar 26 2016, 6:05 PM.
Tags
Referenced Files
Unknown Object (File)
Thu, Mar 28, 7:52 PM
Unknown Object (File)
Feb 22 2024, 6:14 AM
Unknown Object (File)
Feb 19 2024, 5:44 PM
Unknown Object (File)
Feb 11 2024, 8:27 PM
Unknown Object (File)
Feb 5 2024, 1:33 AM
Unknown Object (File)
Jan 5 2024, 7:13 PM
Unknown Object (File)
Jan 2 2024, 8:52 PM
Unknown Object (File)
Dec 23 2023, 11:53 AM

Details

Summary

This change moves support for Synopsys Designware APB UART out of ns8250 into a separate driver, and adds support for activating clock and hwreset resources when the EXT_RESOURCES option is present.

Diff Detail

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

Event Timeline

jmcneill retitled this revision from to uart: Add support for snps,dw-apb-uart clock and hwreset resources.
jmcneill updated this object.
jmcneill edited the test plan for this revision. (Show Details)
jmcneill added a reviewer: ARM.
jmcneill set the repository for this revision to rS FreeBSD src repository - subversion.
jmcneill added a project: ARM.
manu_bidouilliste.com added inline comments.
sys/arm/conf/A20
75 ↗(On Diff #14631)

Shouldn't the dependancy on ns8250 be handled in sys/conf/files ?
Something like :
dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 | uart_snps

I'm really not sure if this kind of stuff is ok.

sys/arm/conf/A20
75 ↗(On Diff #14631)

When you have two options that need to be set it would be: ... optional uart uart_foo | uart uart_bar

  • Make uart_snps depend on uart_ns8250
  • Remove redundant clk_disable calls before clk_release
sys/dev/uart/uart_dev_ns8250.c
460 ↗(On Diff #14632)

This doesn't seems to be needed anymore, the busy-detect property was when ns8250 wasn't snps aware.

sys/dev/uart/uart_dev_ns8250.c
460 ↗(On Diff #14632)

It was kept around to give people a chance to update their dtb. It can be removed now.

sys/dev/uart/uart_dev_snps.c
158 ↗(On Diff #14632)

There seems to be a lot happening in this probe function that should be moved to attach.

sys/dev/uart/uart_dev_snps.c
158 ↗(On Diff #14632)

Two problems --

  • uart_bus_probe needs to know the ref clock frequency
  • uart_bus_probe -> ns8250_bus_probe access registers, so clocks must be enabled
  • uart_dev_ns8250: Remove support for "busy-detect" property.
  • uart_dev_snps: allow to attach to ofwbus as well as simplebus to match uart_bus_fdt behavior.
mmel added inline comments.
sys/dev/uart/uart_dev_snps.c
284 ↗(On Diff #14649)

This is not needed. Owfbus is subclass of simplebus for some time, so binding to simplebus also matches to ofwbus.

sys/dev/uart/uart_dev_snps.c
284 ↗(On Diff #14649)

Have you tested this? I've found both are needed if the device could be a child of either.

sys/dev/uart/uart_dev_snps.c
284 ↗(On Diff #14649)

Yes, sure. Tegra, for example, doesn't not have 'base' SoC simplebus at all, all devices are children of ofwbus. Binding to base class also matches to all its subclasses.

andrew added a reviewer: andrew.
This revision is now accepted and ready to land.Mar 30 2016, 10:20 AM
adrian added a reviewer: adrian.
This revision was automatically updated to reflect the committed changes.