<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dissonant.dev/index.php?action=history&amp;feed=atom&amp;title=Mainline%3ABroadcom_Kona%2FClocks</id>
	<title>Mainline:Broadcom Kona/Clocks - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dissonant.dev/index.php?action=history&amp;feed=atom&amp;title=Mainline%3ABroadcom_Kona%2FClocks"/>
	<link rel="alternate" type="text/html" href="https://wiki.dissonant.dev/index.php?title=Mainline:Broadcom_Kona/Clocks&amp;action=history"/>
	<updated>2026-04-15T04:58:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://wiki.dissonant.dev/index.php?title=Mainline:Broadcom_Kona/Clocks&amp;diff=87&amp;oldid=prev</id>
		<title>Knuxify: /* Policies */</title>
		<link rel="alternate" type="text/html" href="https://wiki.dissonant.dev/index.php?title=Mainline:Broadcom_Kona/Clocks&amp;diff=87&amp;oldid=prev"/>
		<updated>2025-02-15T19:56:28Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Policies&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:56, 15 February 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l40&quot;&gt;Line 40:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 40:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Policies ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Policies ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Each CCU has 4 policies. Policies control whether specific clocks &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;are &lt;/del&gt;enabled, as well as the frequencies of specific clocks and some voltages, as seen in the frequency/voltage control sections below.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Each CCU has 4 policies. Policies control whether specific clocks &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;can be gated (&lt;/ins&gt;enabled&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/disabled)&lt;/ins&gt;, as well as the frequencies of specific clocks and some voltages, as seen in the frequency/voltage control sections below.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;According to the mainline driver, these policies are: &amp;quot;Deep Sleep&amp;quot;, &amp;quot;Economy&amp;quot;, &amp;quot;Normal&amp;quot; and &amp;quot;Turbo&amp;quot;, where policy 2 is the default (question is, is it 2 counting from 1 or 0?).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;According to the mainline driver, these policies are: &amp;quot;Deep Sleep&amp;quot;, &amp;quot;Economy&amp;quot;, &amp;quot;Normal&amp;quot; and &amp;quot;Turbo&amp;quot;, where policy 2 is the default (question is, is it 2 counting from 1 or 0?).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key my_wiki-mediawiki-:diff:1.41:old-45:rev-87:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Knuxify</name></author>
	</entry>
	<entry>
		<id>https://wiki.dissonant.dev/index.php?title=Mainline:Broadcom_Kona/Clocks&amp;diff=45&amp;oldid=prev</id>
		<title>Knuxify: /* Core clocks and freq policy */</title>
		<link rel="alternate" type="text/html" href="https://wiki.dissonant.dev/index.php?title=Mainline:Broadcom_Kona/Clocks&amp;diff=45&amp;oldid=prev"/>
		<updated>2025-01-21T17:26:26Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Core clocks and freq policy&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:26, 21 January 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l111&quot;&gt;Line 111:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 111:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Core clocks and freq policy ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Core clocks and freq policy ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The second user of this is core clocks - in the core CCU, the frequency policy is used to determine which clock source is used for the CPU - see &quot;Core clocks&quot; section for details. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;### &lt;/del&gt;PI manager and freq policy&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The second user of this is core clocks - in the core CCU, the frequency policy is used to determine which clock source is used for the CPU - see &quot;Core clocks&quot; section for details.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=== &lt;/ins&gt;PI manager and freq policy &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The PI manager is also able to set this through the &amp;lt;code&amp;gt;pi_set_ccu_freq&amp;lt;/code&amp;gt; function, which is only used if &amp;lt;code&amp;gt;CONFIG_CHANGE_POLICY_FOR_DFS&amp;lt;/code&amp;gt; is not defined (and it is not defined in the Grand Neo downstream kernel). See &amp;quot;Power Islands&amp;quot; section.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The PI manager is also able to set this through the &amp;lt;code&amp;gt;pi_set_ccu_freq&amp;lt;/code&amp;gt; function, which is only used if &amp;lt;code&amp;gt;CONFIG_CHANGE_POLICY_FOR_DFS&amp;lt;/code&amp;gt; is not defined (and it is not defined in the Grand Neo downstream kernel). See &amp;quot;Power Islands&amp;quot; section.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key my_wiki-mediawiki-:diff:1.41:old-17:rev-45:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Knuxify</name></author>
	</entry>
	<entry>
		<id>https://wiki.dissonant.dev/index.php?title=Mainline:Broadcom_Kona/Clocks&amp;diff=17&amp;oldid=prev</id>
		<title>Knuxify at 17:01, 20 January 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.dissonant.dev/index.php?title=Mainline:Broadcom_Kona/Clocks&amp;diff=17&amp;oldid=prev"/>
		<updated>2025-01-20T17:01:56Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:01, 20 January 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l7&quot;&gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Figure out how voltage and peripheral voltage settings work, and what they affect&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Figure out how voltage and peripheral voltage settings work, and what they affect&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Document connection to the power/PI manager&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Document connection to the power/PI manager&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;-----&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;-----&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l56&quot;&gt;Line 56:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 55:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The above is more or less abridged from the mainline driver&amp;#039;s docs:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The above is more or less abridged from the mainline driver&amp;#039;s docs:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source &lt;/del&gt;lang=&quot;c&quot;&amp;gt;        /*&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight &lt;/ins&gt;lang=&quot;c&quot;&amp;gt;        /*&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          * If it&amp;#039;s a synchronous request, we&amp;#039;ll wait for the voltage&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          * If it&amp;#039;s a synchronous request, we&amp;#039;ll wait for the voltage&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          * and frequency of the active load to stabilize before&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          * and frequency of the active load to stabilize before&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l70&quot;&gt;Line 70:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 69:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          *  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          *  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          * Note, we do NOT read-modify-write this register.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          * Note, we do NOT read-modify-write this register.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          */    &amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          */    &amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;and is somewhat related to downstream&amp;#039;s &amp;lt;code&amp;gt;ccu_set_policy_ctrl&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;and is somewhat related to downstream&amp;#039;s &amp;lt;code&amp;gt;ccu_set_policy_ctrl&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l93&quot;&gt;Line 93:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 92:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Effectively, a frequency table looks sort of like this (written in a simplified, Python-like syntax for easier understanding):&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Effectively, a frequency table looks sort of like this (written in a simplified, Python-like syntax for easier understanding):&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source &lt;/del&gt;lang=&quot;python&quot;&amp;gt;ccu_freq_list0 = [26000000,26000000,26000000,26000000]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight &lt;/ins&gt;lang=&quot;python&quot;&amp;gt;ccu_freq_list0 = [26000000,26000000,26000000,26000000]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ccu_freq_list1 = [52000000,52000000,52000000,5200000]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ccu_freq_list1 = [52000000,52000000,52000000,5200000]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;...&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;...&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l101&quot;&gt;Line 101:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 100:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     ccu_freq_list0, ccu_freq_list1, ..., ccu_freq_list6&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     ccu_freq_list0, ccu_freq_list1, ..., ccu_freq_list6&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# actual number of frequencies in table is specific to each CCU&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# actual number of frequencies in table is specific to each CCU&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is used by bus clocks - which frequencies correspond to which clocks is shown by the &amp;lt;code&amp;gt;.freq_tbl_index&amp;lt;/code&amp;gt; member of the clock info struct. Clocks that have this value set to &amp;gt;= 0 specify that they&amp;#039;re connected to that specific frequency; clocks with a value of -1 use a source clock or internal dividers instead.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is used by bus clocks - which frequencies correspond to which clocks is shown by the &amp;lt;code&amp;gt;.freq_tbl_index&amp;lt;/code&amp;gt; member of the clock info struct. Clocks that have this value set to &amp;gt;= 0 specify that they&amp;#039;re connected to that specific frequency; clocks with a value of -1 use a source clock or internal dividers instead.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source &lt;/del&gt;lang=&quot;python&quot;&amp;gt;# A bus clock will perform an operation like so:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight &lt;/ins&gt;lang=&quot;python&quot;&amp;gt;# A bus clock will perform an operation like so:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;current_policy = ccu.get_active_policy()  # CCU policy ID, from 0 to 3&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;current_policy = ccu.get_active_policy()  # CCU policy ID, from 0 to 3&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;freq_id = ccu.get_freq_policy(current_policy)  # read frequency ID (aka which table to use) for the current policy&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;freq_id = ccu.get_freq_policy(current_policy)  # read frequency ID (aka which table to use) for the current policy&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ccu.freq_table[freq_id][bus_clk.freq_tbl_index]&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ccu.freq_table[freq_id][bus_clk.freq_tbl_index]&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Core clocks and freq policy ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Core clocks and freq policy ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l142&quot;&gt;Line 142:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 142:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Every PI also has its own OPPs which get converted to CCU frequency IDs as per the &amp;lt;code&amp;gt;.opp_info&amp;lt;/code&amp;gt; tables&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Every PI also has its own OPPs which get converted to CCU frequency IDs as per the &amp;lt;code&amp;gt;.opp_info&amp;lt;/code&amp;gt; tables&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* PI reset offsets are located in the root CCU&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* PI reset offsets are located in the root CCU&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;-----&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;-----&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l161&quot;&gt;Line 161:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 160:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;.trig&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;TRIGGER()&amp;lt;/code&amp;gt;, in order: &amp;lt;code&amp;gt;.clk_div.div_trig_offset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.div_trig_mask&amp;lt;/code&amp;gt; (-&amp;gt;bit)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;.trig&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;TRIGGER()&amp;lt;/code&amp;gt;, in order: &amp;lt;code&amp;gt;.clk_div.div_trig_offset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.div_trig_mask&amp;lt;/code&amp;gt; (-&amp;gt;bit)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;.policy&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;POLICY()&amp;lt;/code&amp;gt;, in order: the CCU&amp;#039;s &amp;lt;code&amp;gt;policy_mask{1/2}_offset&amp;lt;/code&amp;gt; (depending on &amp;lt;code&amp;gt;.mask_set&amp;lt;/code&amp;gt;), &amp;lt;code&amp;gt;.policy_bit_mask&amp;lt;/code&amp;gt; (-&amp;gt;bit)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;.policy&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;POLICY()&amp;lt;/code&amp;gt;, in order: the CCU&amp;#039;s &amp;lt;code&amp;gt;policy_mask{1/2}_offset&amp;lt;/code&amp;gt; (depending on &amp;lt;code&amp;gt;.mask_set&amp;lt;/code&amp;gt;), &amp;lt;code&amp;gt;.policy_bit_mask&amp;lt;/code&amp;gt; (-&amp;gt;bit)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;-----&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;-----&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;TPIU is some CoreSight thing. PTI is likely MIPS PTI (&amp;#039;&amp;#039;Parallel Trace Interface&amp;#039;&amp;#039;).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;TPIU is some CoreSight thing. PTI is likely MIPS PTI (&amp;#039;&amp;#039;Parallel Trace Interface&amp;#039;&amp;#039;).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key my_wiki-mediawiki-:diff:1.41:old-16:rev-17:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Knuxify</name></author>
	</entry>
	<entry>
		<id>https://wiki.dissonant.dev/index.php?title=Mainline:Broadcom_Kona/Clocks&amp;diff=16&amp;oldid=prev</id>
		<title>Knuxify: /* Policy engine */</title>
		<link rel="alternate" type="text/html" href="https://wiki.dissonant.dev/index.php?title=Mainline:Broadcom_Kona/Clocks&amp;diff=16&amp;oldid=prev"/>
		<updated>2025-01-20T17:00:51Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Policy engine&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:00, 20 January 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l49&quot;&gt;Line 49:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 49:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Before making any changes to the policy or one of the controls below, the policy engine must first be stopped. Restarting the policy engine will apply the changes to it.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Before making any changes to the policy or one of the controls below, the policy engine must first be stopped. Restarting the policy engine will apply the changes to it.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Starting the policy engine is done by writing to the policy control offset, either: * the ATL (active load) bit for synchronous requests (we wait for the frequency and voltage to stabilize); * or clearing it for asynchronous requests, going into target mode (where the voltage ramps in the background, then the target load is copied to the active load triggering a frequency change).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Starting the policy engine is done by writing to the policy control offset, either:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* the ATL (active load) bit for synchronous requests (we wait for the frequency and voltage to stabilize);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* or clearing it for asynchronous requests, going into target mode (where the voltage ramps in the background, then the target load is copied to the active load triggering a frequency change).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The above is more or less abridged from the mainline driver&amp;#039;s docs:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The above is more or less abridged from the mainline driver&amp;#039;s docs:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key my_wiki-mediawiki-:diff:1.41:old-15:rev-16:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Knuxify</name></author>
	</entry>
	<entry>
		<id>https://wiki.dissonant.dev/index.php?title=Mainline:Broadcom_Kona/Clocks&amp;diff=15&amp;oldid=prev</id>
		<title>Knuxify: import from my personal docs</title>
		<link rel="alternate" type="text/html" href="https://wiki.dissonant.dev/index.php?title=Mainline:Broadcom_Kona/Clocks&amp;diff=15&amp;oldid=prev"/>
		<updated>2025-01-20T17:00:16Z</updated>

		<summary type="html">&lt;p&gt;import from my personal docs&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The Broadcom Kona clock manager consists of multiple CCUs (clock control units), which each manage their own set of clocks - whether they&amp;#039;re enabled/disabled, their frequencies and other per-clock settings - as well as some peripheral voltage settings (likely a DVFS configuration).&lt;br /&gt;
&lt;br /&gt;
This doc will not explain much about the clocks themselves (gating, hyst, selectors, etc.) - for that, see the source code of the mainline driver, which explains these things much better than this doc ever could.&lt;br /&gt;
&lt;br /&gt;
== TODOs ==&lt;br /&gt;
&lt;br /&gt;
* Figure out how voltage and peripheral voltage settings work, and what they affect&lt;br /&gt;
* Document connection to the power/PI manager&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
== Clock types ==&lt;br /&gt;
&lt;br /&gt;
There are multiple types of clocks handled by the CCUs.&lt;br /&gt;
&lt;br /&gt;
=== Reference clocks ===&lt;br /&gt;
&lt;br /&gt;
Fixed clocks used as clock sources for other clocks.&lt;br /&gt;
&lt;br /&gt;
=== Bus clocks ===&lt;br /&gt;
&lt;br /&gt;
Presumably handle frequencies for internal buses. They must be initialized before any of the peripheral clocks can be used.&lt;br /&gt;
&lt;br /&gt;
Some peripheral clocks have corresponding bus clocks (see &amp;lt;code&amp;gt;sdio1&amp;lt;/code&amp;gt; (peripheral) and &amp;lt;code&amp;gt;sdio1_ahb&amp;lt;/code&amp;gt; (bus), &amp;lt;code&amp;gt;uartb&amp;lt;/code&amp;gt; (peri) and &amp;lt;code&amp;gt;uartb_apb&amp;lt;/code&amp;gt; (bus)). Some bus clocks are used as the primary clock for specific blocks (see &amp;lt;code&amp;gt;usb_otg_ahb&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== Peripheral clocks ===&lt;br /&gt;
&lt;br /&gt;
The primary clocks used for various elements of the SoC.&lt;br /&gt;
&lt;br /&gt;
=== PLL clocks and PLL channels clocks ===&lt;br /&gt;
&lt;br /&gt;
These work completely differently from bus/peri clocks. Their primary use is as a configurable clock source - notably, they&amp;#039;re used to power the CPU&amp;#039;s clock.&lt;br /&gt;
&lt;br /&gt;
=== Core clock ===&lt;br /&gt;
&lt;br /&gt;
The CPU&amp;#039;s clock.&lt;br /&gt;
&lt;br /&gt;
== CCUs ==&lt;br /&gt;
&lt;br /&gt;
=== Policies ===&lt;br /&gt;
&lt;br /&gt;
Each CCU has 4 policies. Policies control whether specific clocks are enabled, as well as the frequencies of specific clocks and some voltages, as seen in the frequency/voltage control sections below.&lt;br /&gt;
&lt;br /&gt;
According to the mainline driver, these policies are: &amp;quot;Deep Sleep&amp;quot;, &amp;quot;Economy&amp;quot;, &amp;quot;Normal&amp;quot; and &amp;quot;Turbo&amp;quot;, where policy 2 is the default (question is, is it 2 counting from 1 or 0?).&lt;br /&gt;
&lt;br /&gt;
=== Policy engine ===&lt;br /&gt;
&lt;br /&gt;
Before making any changes to the policy or one of the controls below, the policy engine must first be stopped. Restarting the policy engine will apply the changes to it.&lt;br /&gt;
&lt;br /&gt;
Starting the policy engine is done by writing to the policy control offset, either: * the ATL (active load) bit for synchronous requests (we wait for the frequency and voltage to stabilize); * or clearing it for asynchronous requests, going into target mode (where the voltage ramps in the background, then the target load is copied to the active load triggering a frequency change).&lt;br /&gt;
&lt;br /&gt;
The above is more or less abridged from the mainline driver&amp;#039;s docs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;        /*&lt;br /&gt;
         * If it&amp;#039;s a synchronous request, we&amp;#039;ll wait for the voltage&lt;br /&gt;
         * and frequency of the active load to stabilize before&lt;br /&gt;
         * returning.  To do this we select the active load by&lt;br /&gt;
         * setting the ATL bit.&lt;br /&gt;
         * &lt;br /&gt;
         * An asynchronous request instead ramps the voltage in the&lt;br /&gt;
         * background, and when that process stabilizes, the target&lt;br /&gt;
         * load is copied to the active load and the CCU frequency&lt;br /&gt;
         * is switched.  We do this by selecting the target load&lt;br /&gt;
         * (ATL bit clear) and setting the request auto-copy (AC bit&lt;br /&gt;
         * set).&lt;br /&gt;
         * &lt;br /&gt;
         * Note, we do NOT read-modify-write this register. &lt;br /&gt;
         */    &amp;lt;/source&amp;gt;&lt;br /&gt;
and is somewhat related to downstream&amp;#039;s &amp;lt;code&amp;gt;ccu_set_policy_ctrl&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Getting the active policy ===&lt;br /&gt;
&lt;br /&gt;
There&amp;#039;s a way to use the policy debug registers to get the active policy, as seen in &amp;lt;code&amp;gt;ccu_policy_dbg_get_act_policy&amp;lt;/code&amp;gt;, which is called through &amp;lt;code&amp;gt;ccu_get_active_policy&amp;lt;/code&amp;gt;. This is used to get the frequency ID to use for the bus clocks, as seen below.&lt;br /&gt;
&lt;br /&gt;
TODO: How do you set the policy? My guess is that it&amp;#039;s managed by the policy engine based on some kind of dependency; either that, or it&amp;#039;s dictated by the power manager. TODO.&lt;br /&gt;
&lt;br /&gt;
=== Frequency control ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ccu_set_freq_policy&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;ccu_get_freq_policy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ccu_clk-&amp;gt;freq_tbl[freq_id][freq_tbl_index]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each CCU with a policy has a &amp;quot;policy_freq&amp;quot; register, which stores the IDs of the frequency policies to use for each CCU policy - this is written in &amp;lt;code&amp;gt;ccu_set_freq_policy&amp;lt;/code&amp;gt;. On init, it reads the first 4 members of &amp;lt;code&amp;gt;ccu_clk-&amp;gt;freq_policy&amp;lt;/code&amp;gt; and writes them as the defaults to the registers.&lt;br /&gt;
&lt;br /&gt;
Every frequency policy has an ID from 0 to 7. The downstream driver has tables representing what frequencies each policy entails.&lt;br /&gt;
&lt;br /&gt;
==== Frequency tables ====&lt;br /&gt;
&lt;br /&gt;
The selected frequency policy controls which set of frequencies is used in the CCU. It acts as an index to a second table, &amp;lt;code&amp;gt;.freq_tbl&amp;lt;/code&amp;gt;, which in turn contains the frequencies that that specific frequency policy sets up. Each CCU has a specific number of frequencies in these tables.&lt;br /&gt;
&lt;br /&gt;
Effectively, a frequency table looks sort of like this (written in a simplified, Python-like syntax for easier understanding):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;ccu_freq_list0 = [26000000,26000000,26000000,26000000]&lt;br /&gt;
ccu_freq_list1 = [52000000,52000000,52000000,5200000]&lt;br /&gt;
...&lt;br /&gt;
ccu_freq_list6 = [208000000,104000000,104000000,1040000000]&lt;br /&gt;
&lt;br /&gt;
ccu.freq_tbl = [&lt;br /&gt;
    ccu_freq_list0, ccu_freq_list1, ..., ccu_freq_list6&lt;br /&gt;
]&lt;br /&gt;
# actual number of frequencies in table is specific to each CCU&amp;lt;/source&amp;gt;&lt;br /&gt;
This is used by bus clocks - which frequencies correspond to which clocks is shown by the &amp;lt;code&amp;gt;.freq_tbl_index&amp;lt;/code&amp;gt; member of the clock info struct. Clocks that have this value set to &amp;gt;= 0 specify that they&amp;#039;re connected to that specific frequency; clocks with a value of -1 use a source clock or internal dividers instead.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;# A bus clock will perform an operation like so:&lt;br /&gt;
&lt;br /&gt;
current_policy = ccu.get_active_policy()  # CCU policy ID, from 0 to 3&lt;br /&gt;
freq_id = ccu.get_freq_policy(current_policy)  # read frequency ID (aka which table to use) for the current policy&lt;br /&gt;
ccu.freq_table[freq_id][bus_clk.freq_tbl_index]&amp;lt;/source&amp;gt;&lt;br /&gt;
=== Core clocks and freq policy ===&lt;br /&gt;
&lt;br /&gt;
The second user of this is core clocks - in the core CCU, the frequency policy is used to determine which clock source is used for the CPU - see &amp;quot;Core clocks&amp;quot; section for details. ### PI manager and freq policy&lt;br /&gt;
&lt;br /&gt;
The PI manager is also able to set this through the &amp;lt;code&amp;gt;pi_set_ccu_freq&amp;lt;/code&amp;gt; function, which is only used if &amp;lt;code&amp;gt;CONFIG_CHANGE_POLICY_FOR_DFS&amp;lt;/code&amp;gt; is not defined (and it is not defined in the Grand Neo downstream kernel). See &amp;quot;Power Islands&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
=== Voltage control ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ccu_set_voltage&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;ccu_get_voltage&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a DVFS (dynamic voltage/frequency scaling) setup that connects a specific frequency ID to a specific voltage ID.&lt;br /&gt;
&lt;br /&gt;
Every frequency ID has a corresponding voltage ID in the voltage table, which are defined in the &amp;lt;code&amp;gt;.freq_volt&amp;lt;/code&amp;gt; member of the CCU clock struct in downstream, and are written at initialization time to the CCU VLT registers (VLT0_3 and VLT4_7). Which voltage is selected depends on which frequency ID is selected.&lt;br /&gt;
&lt;br /&gt;
No code in downstream appears to set/get these voltage tables after init, except for the debug code. Most likely, the default values are fine.&lt;br /&gt;
&lt;br /&gt;
=== Peripheral voltage control ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ccu_set_peri_voltage&amp;lt;/code&amp;gt; / no get function&lt;br /&gt;
&lt;br /&gt;
Actually completely different from the voltage control, though they share the same voltage IDs in downstream.&lt;br /&gt;
&lt;br /&gt;
There are two modes - NORMAL and HIGH. The voltage ID to use is written to the &amp;lt;code&amp;gt;.vlt_peri_offset&amp;lt;/code&amp;gt; register.&lt;br /&gt;
&lt;br /&gt;
As the name suggests, the peripheral voltage setting is used by peripheral clocks, which can select the voltage level - NORMAL or HIGH - to use by writing a bit using the &amp;lt;code&amp;gt;.volt_lvl_mask&amp;lt;/code&amp;gt;, as done in the &amp;lt;code&amp;gt;peri_clk_set_voltage_lvl&amp;lt;/code&amp;gt; function in downstream.&lt;br /&gt;
&lt;br /&gt;
== Relation to Power Islands ==&lt;br /&gt;
&lt;br /&gt;
The Power Islands, besides being controlled mostly by the power manager, also have connections to the CCUs:&lt;br /&gt;
&lt;br /&gt;
* Every PI has one or more CCUs assigned to it (&amp;lt;code&amp;gt;.ccu_id&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;.num_ccu_id&amp;lt;/code&amp;gt; in pi_mgr)&lt;br /&gt;
* Every PI also has its own OPPs which get converted to CCU frequency IDs as per the &amp;lt;code&amp;gt;.opp_info&amp;lt;/code&amp;gt; tables&lt;br /&gt;
* PI reset offsets are located in the root CCU&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
== Porting downstream clock struct to mainline ==&lt;br /&gt;
&lt;br /&gt;
In downstream, look for a struct of type &amp;lt;code&amp;gt;peri_clk&amp;lt;/code&amp;gt; for your clock. In mainline, open &amp;lt;code&amp;gt;clk-bcm21664.c&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Here&amp;#039;s a list of mainline clock struct members, and their downstream counterparts (&amp;lt;code&amp;gt;(-&amp;gt;bit)&amp;lt;/code&amp;gt; signifies that this mask must be converted to a bit shift first - see the RDB, there&amp;#039;s a &amp;quot;shift&amp;quot; value next to the mask)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;.clocks&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;CLOCKS()&amp;lt;/code&amp;gt;, fill with names of source clocks as seen in &amp;lt;code&amp;gt;clock_source&amp;lt;/code&amp;gt; struct above your clock struct; put each name between double quotes.&lt;br /&gt;
* &amp;lt;code&amp;gt;.gate&amp;lt;/code&amp;gt;: depends on the gate type:&lt;br /&gt;
** &amp;lt;code&amp;gt;HW_SW_GATE[_AUTO]&amp;lt;/code&amp;gt; - these have a &amp;lt;code&amp;gt;gating_sel_mask&amp;lt;/code&amp;gt;; use the &amp;lt;code&amp;gt;_AUTO&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;AUTO_GATE&amp;lt;/code&amp;gt; is present in the &amp;lt;code&amp;gt;.flags&amp;lt;/code&amp;gt;; in order: &amp;lt;code&amp;gt;.clk_gate_offset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.stprsts_mask&amp;lt;/code&amp;gt; (-&amp;gt;bit), &amp;lt;code&amp;gt;.gating_sel_mask&amp;lt;/code&amp;gt; (-&amp;gt;bit), &amp;lt;code&amp;gt;.clk_en_mask&amp;lt;/code&amp;gt; (-&amp;gt;bit)&lt;br /&gt;
** &amp;lt;code&amp;gt;{HW,SW}_ONLY_GATE&amp;lt;/code&amp;gt; - these have no &amp;lt;code&amp;gt;gating_sel_mask&amp;lt;/code&amp;gt;; if &amp;lt;code&amp;gt;.flags&amp;lt;/code&amp;gt; contains &amp;lt;code&amp;gt;AUTO_GATE&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;HW&amp;lt;/code&amp;gt;, else &amp;lt;code&amp;gt;SW&amp;lt;/code&amp;gt;; in order: &amp;lt;code&amp;gt;.clk_gate_offset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.stprsts_mask&amp;lt;/code&amp;gt; (-&amp;gt;bit), &amp;lt;code&amp;gt;.clk_en_mask&amp;lt;/code&amp;gt; (-&amp;gt;bit)&lt;br /&gt;
* &amp;lt;code&amp;gt;.hyst&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;HYST()&amp;lt;/code&amp;gt;, in order: &amp;lt;code&amp;gt;.clk_gate_offset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.hyst_val_mask&amp;lt;/code&amp;gt; (-&amp;gt;bit), &amp;lt;code&amp;gt;.hyst_en_mask&amp;lt;/code&amp;gt; (-&amp;gt;bit)&lt;br /&gt;
* &amp;lt;code&amp;gt;.sel&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;SELECTOR()&amp;lt;/code&amp;gt;, in order: &amp;lt;code&amp;gt;.clk_div.pll_select_offset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.pll_select_shift&amp;lt;/code&amp;gt;, width of &amp;lt;code&amp;gt;.pll_select_mask&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;.div&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;DIVIDER()&amp;lt;/code&amp;gt;, in order: &amp;lt;code&amp;gt;.clk_div.div_offset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.div_shift&amp;lt;/code&amp;gt;, width of &amp;lt;code&amp;gt;.div_mask&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;.trig&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;TRIGGER()&amp;lt;/code&amp;gt;, in order: &amp;lt;code&amp;gt;.clk_div.div_trig_offset&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.div_trig_mask&amp;lt;/code&amp;gt; (-&amp;gt;bit)&lt;br /&gt;
* &amp;lt;code&amp;gt;.policy&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;POLICY()&amp;lt;/code&amp;gt;, in order: the CCU&amp;#039;s &amp;lt;code&amp;gt;policy_mask{1/2}_offset&amp;lt;/code&amp;gt; (depending on &amp;lt;code&amp;gt;.mask_set&amp;lt;/code&amp;gt;), &amp;lt;code&amp;gt;.policy_bit_mask&amp;lt;/code&amp;gt; (-&amp;gt;bit)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
TPIU is some CoreSight thing. PTI is likely MIPS PTI (&amp;#039;&amp;#039;Parallel Trace Interface&amp;#039;&amp;#039;).&lt;/div&gt;</summary>
		<author><name>Knuxify</name></author>
	</entry>
</feed>