Page MenuHomeFreeBSD

Take 2: Update syscon_generic.c to support simplebus
AbandonedPublic

Authored by oskar.holmlund_ohdata.se on Sep 11 2020, 2:30 PM.
Tags
Referenced Files
Unknown Object (File)
Sun, Apr 21, 6:14 PM
Unknown Object (File)
Fri, Apr 19, 1:39 PM
Unknown Object (File)
Dec 20 2023, 8:30 AM
Unknown Object (File)
Dec 16 2023, 5:25 AM
Unknown Object (File)
Dec 10 2023, 1:41 PM
Unknown Object (File)
Sep 26 2023, 11:06 PM
Unknown Object (File)
Sep 6 2023, 2:22 AM
Unknown Object (File)
Aug 14 2023, 7:55 AM
Subscribers

Details

Reviewers
mmel
skibo
manu
Summary

A combination of D26401 and D26402 inspired from sys/arm/allwinner/aw_syscon.c

Just add support for simplebus in syscon_generic.c and nothing else.

Keep ti_scm_syscon.c which "inherit" syscon_generic.c and do TI specific stuffs

  • The probe function needs both syscon and simple-bus in compatible field from DTS to match.
  • Add clkdev interface to syscon_generic.
  • Lower the priority to BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE (otherwise the node will attach to simplebus driver)

Diff Detail

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

Event Timeline

mmel requested changes to this revision.Sep 14 2020, 3:37 PM
mmel added inline comments.
sys/arm/ti/ti_scm_syscon.c
74

This code has the same problem as original one. Assume that you have GENERIC kernel (thuswith all drivers compiled in) and two boards, one TI and one more other. Also assume that both board have ""syscon,simple-bus" compatible node in their DT. How do you ensure that 'ti_scm_syscon' wins on one but 'syscon_generic' on the other?
I'm sorry, but this is wrong approach. The 'simple-bus', 'syscon' or 'clock-bus' drivers are universal and there is no way how you can stole it for TI specific bits.

Seems that Ti have 2 groups of clocks ->
scm clock (from am35xx-clocks.dtsi) these uses syscon based access and 'ti,sysc' (from am33xx-l4.dtsi) with register based access (by using bus_read() an bus_write() ).

Thus I think that all what is needed is (in above of generic_syscon simple-bus extension, see my comments in D26402) is enhance syscon based clocks ('ti,mux-clock', 'ti,gate-clock'...) to use syscon based access.
In these drivers, clkdev_write_4() should be converted to syscon_write_4() and so...

This revision now requires changes to proceed.Sep 14 2020, 3:37 PM