Page MenuHomeFreeBSD

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

Authored by oskar.holmlund_ohdata.se on Sep 10 2020, 8:22 PM.
Tags
Referenced Files
Unknown Object (File)
Dec 22 2023, 10:42 PM
Unknown Object (File)
Dec 10 2023, 1:41 PM
Unknown Object (File)
Sep 6 2023, 2:22 AM
Unknown Object (File)
Aug 14 2023, 7:29 AM
Unknown Object (File)
Jun 14 2023, 5:31 PM
Unknown Object (File)
Mar 4 2023, 11:19 AM
Unknown Object (File)
Mar 2 2023, 4:52 PM
Unknown Object (File)
Feb 14 2023, 1:24 AM
Subscribers

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 - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

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

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?

sys/dev/extres/syscon/syscon_generic.c
185

simplebus_attach is public function and should be used here.

208

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

219

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

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

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?

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.