Page MenuHomeFreeBSD

Update syscon_generic.c to support simplebus and clkdev interface
Needs ReviewPublic

Authored by oskar.holmlund_ohdata.se on Thu, Sep 10, 8:22 PM.

Details

Reviewers
mmel
skibo
manu
Summary

Problem reported by Thomas Skibo (ARM mailinglist)
My interpretation of Michal Meloun proposal of solution to the problem.

Add support for simplebus in syscon_generic.c.
To handle the syscon in TI am335x device tree the driver also need to have the clkdev interface (write/read/modify...). For example sys_clkin_ck@40 (line 8 in am33xx-clocks.dtsi) need the clkdev interface.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

oskar.holmlund_ohdata.se requested review of this revision.Thu, Sep 10, 8:22 PM
skibo added inline comments.Thu, Sep 10, 9:10 PM
sys/dev/extres/syscon/syscon_generic.h
35

Adding this broke sys/arm/allwinner/aw_syscon.c. Add #include <dev/fdt/simplebus.h> to aw_syscon.c?

Thanks Thomas - didnt try GENERIC build.

Another way is to include in syscon_generic.h but i assume its better to keep the header free from includes?

mmel added inline comments.Mon, Sep 14, 3:45 PM
sys/dev/extres/syscon/syscon_generic.c
196

simplebus_attach is public function and should be used here.

212

simplebus_detach() should be declared public and should be called from here

222

This clock interface is not common and thus cannot be added into common (universal) driver

sys/dev/extres/syscon/syscon_generic.h
35

you should #include <dev/fdt/simplebus.h> on top of this header. (because simplebus functionality is fully transparent for most of users)

oskar.holmlund_ohdata.se marked an inline comment as done.

Michal, thanks for your guidance.

I'm unsure about the define_class parts, is there any better way than rename the first one?

In probe() maybe its better to return BUS_PROBE_LOW_PRIORITY if its both syscon _and_ simplebus?

mmel added a comment.Sat, Sep 26, 9:50 AM

Already committed as part of other change.

In D26402#591631, @mmel wrote:

Already committed as part of other change.

Thank you!

Please tell me if you want me to update D26401 or any other part of ti clocks that needs to be straightened.