Page MenuHomeFreeBSD

Dynamically configure timers' base frequency for Armada 38x
ClosedPublic

Authored by mw on Aug 5 2017, 10:26 AM.
Tags
Referenced Files
Unknown Object (File)
Mar 9 2024, 3:13 PM
Unknown Object (File)
Mar 5 2024, 7:23 AM
Unknown Object (File)
Jan 12 2024, 1:39 PM
Unknown Object (File)
Jan 6 2024, 3:47 AM
Unknown Object (File)
Dec 20 2023, 3:19 AM
Unknown Object (File)
Dec 12 2023, 1:53 AM
Unknown Object (File)
Sep 29 2023, 12:01 AM
Unknown Object (File)
Sep 23 2023, 5:15 AM

Details

Summary

Instead of using 'clock-frequency' device tree property for global/twd
mpcore timers of Armada 38x SoCs, set it in platform_late_init stage
with arm_tmr_change_frequency() function.

Diff Detail

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

Event Timeline

Why not do the same as Linux and calculate it dynamically?

Is there clock framework in the FreeBSD, so that it can obtain clock from device tree phandle: (clocks = <&coreclk 2>;) and later to clk_get() and clk_prepare_enable()? Later it is done in Linux by clk_get_rate() callback.

In D11881#246387, @mw wrote:

Is there clock framework in the FreeBSD, so that it can obtain clock from device tree phandle: (clocks = <&coreclk 2>;) and later to clk_get() and clk_prepare_enable()? Later it is done in Linux by clk_get_rate() callback.

Look at sys/dev/extres/clk.
But I guess this will be hard to convert the Marvell port to it.

@manu thanks for pointing the code does any platform/driver use it?

About the change itself - I found an easy way to avoid timer node fixup: I called arm_tmr_change_frequency() from platform_late_init and it works fine. I'll submit updated patchset.

In D11881#246860, @mw wrote:

@manu thanks for pointing the code does any platform/driver use it?

Yes the Tegra port and Allwinner uses it exclusively.

mw retitled this revision from Fix-up Armada 38x timer FDT nodes to Dynamically configure timers' base frequency for Armada 38x.
mw edited the summary of this revision. (Show Details)
  • Abandon fdt fixup
  • Update commit message

@manu Do you find the newest version of the patch acceptable?

This revision was automatically updated to reflect the committed changes.