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)
Apr 17 2017, 11:15 PM
Unknown Object (File)
Apr 16 2017, 6:33 PM
Unknown Object (File)
Apr 13 2017, 9:41 AM
Unknown Object (File)
Apr 11 2017, 12:57 PM
Unknown Object (File)
Mar 31 2017, 8:03 AM
Unknown Object (File)
Mar 30 2017, 9:06 PM
Unknown Object (File)
Mar 15 2017, 12:40 PM
Unknown Object (File)
Feb 6 2017, 4:55 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.