Mainline:Broadcom Kona/Power Manager: Difference between revisions
Created page with "* Base address: <code>0x35010000</code> <span id="revisions"></span> == Revisions == There exist two revisions of the Power Manager: REV0 (capri) and REV2 (hawaii, java). Here is a list of known differences: * A second set of voltage controllers is introduced in REV02. ** To go with the second VO, a second sequencer command bank is introduced. * A new i2c command, <code>PWRMGR_I2C_APB_READ_OFFSET</code>, is introduced in REV02. This register contains i2c data and i2c..." |
|||
(One intermediate revision by the same user not shown) | |||
Line 40: | Line 40: | ||
Next, the sequencer is disabled (<code>pwr_mgr_pm_i2c_enable(false)</code> - [[#I2C_ENABLE_OFFSET - 0x4100]]) and initialized with the provided data (<code>pwr_mgr_init_sequencer(info);</code>). | Next, the sequencer is disabled (<code>pwr_mgr_pm_i2c_enable(false)</code> - [[#I2C_ENABLE_OFFSET - 0x4100]]) and initialized with the provided data (<code>pwr_mgr_init_sequencer(info);</code>). | ||
<code>pwr_mgr_init_sequencer</code>: | <code>pwr_mgr_init_sequencer</code>: | ||
Back to <code>pwr_mgr_init</code>, it sets <code>pwr_mgr.i2c_seq_trg = 0</code> and calls the following: * <code>init_completion(&pwr_mgr.i2c_seq_done);</code> - this sets up a [https://embetronicx.com/tutorials/linux/device-drivers/completion-in-linux/ completion handler] (<code>include/linux/completion.h</code>) * <code>INIT_WORK(&pwr_mgr.pwrmgr_work, pwr_mgr_work_handler);</code> - this sets up a [https://www.oreilly.com/library/view/understanding-the-linux/0596005652/ch04s08.html work queue] (<code>kernel/workqueue.c</code>). | * writes the I2C commands from <code>info->i2c_cmds</code> using <code>pwr_mgr_pm_i2c_cmd_write</code> | ||
* writes the data from <code>info->i2c_var_data</code> using <code>pwr_mgr_pm_i2c_var_data_write</code> | |||
* writes command pointers for each volt ??? from <code>info->i2c_cmd_ptr</code> using <code>pwr_mgr_set_v0x_specific_i2c_cmd_ptr</code> | |||
Back to <code>pwr_mgr_init</code>, it sets <code>pwr_mgr.i2c_seq_trg = 0</code> and calls the following: | |||
* <code>init_completion(&pwr_mgr.i2c_seq_done);</code> - this sets up a [https://embetronicx.com/tutorials/linux/device-drivers/completion-in-linux/ completion handler] (<code>include/linux/completion.h</code>) | |||
* <code>INIT_WORK(&pwr_mgr.pwrmgr_work, pwr_mgr_work_handler);</code> - this sets up a [https://www.oreilly.com/library/view/understanding-the-linux/0596005652/ch04s08.html work queue] (<code>kernel/workqueue.c</code>). | |||
Then, it runs <code>pwr_mgr_mask_intr(PWRMGR_INTR_ALL, true);</code> to mask all interrupts by default. | Then, it runs <code>pwr_mgr_mask_intr(PWRMGR_INTR_ALL, true);</code> to mask all interrupts by default. | ||
Line 130: | Line 137: | ||
<span id="events"></span> | <span id="events"></span> | ||
== Events == | == Events == | ||
Line 141: | Line 149: | ||
There is code for both a HW sequencer and a SW sequencer. As evidenced by the comments, they cannot both run at once or timeouts will happen. | There is code for both a HW sequencer and a SW sequencer. As evidenced by the comments, they cannot both run at once or timeouts will happen. | ||
Downstream driver defines multiple erratas for these. In our case: * CONFIG_KONA_PWRMGR_SWSEQ_FAKE_TRG_ERRATUM=y * CONFIG_KONA_PWRMGR_SWSEQ_RETRY_WORKAROUND=y | Downstream driver defines multiple erratas for these. In our case: | ||
* <code>CONFIG_KONA_PWRMGR_SWSEQ_FAKE_TRG_ERRATUM=y</code> | |||
* <code>CONFIG_KONA_PWRMGR_SWSEQ_RETRY_WORKAROUND=y</code> | |||
This sequencer can control voltage requests and PC pin status. | This sequencer can control voltage requests and PC pin status. | ||
Line 233: | Line 244: | ||
<span id="power-island"></span> | <span id="power-island"></span> | ||
== Power Island == | == Power Island == | ||