[Solved][IMX8QM] Unable to get temp Alarm interrupt

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[Solved][IMX8QM] Unable to get temp Alarm interrupt

454 Views
oleksiimoisieiev
Contributor I

Hello. 

I'm trying to set temp alarm for A53 cluster on IMX8QM board. My goal is to use IRQ mechanism to handle temperature alarms and do cpu throttling.

To do this I'm making smc call from the Linux kernel:

arm_smccc_smc(IMX_SIP_MISC_SET_TEMP, SC_R_A53, SC_MISC_TEMP_HIGH, 60, 0, &res);

 

According to the System Controller Firmware Porting Guide (I'm using B0 from Aug 15 2019), SCFW should raise an interrupt when SC_MISC_TEMP_HIGH was reached. 

Also I used smc call, not scfw api, because SC_R_A53 is part of the secure partition, so alarm should be set through smc call to ATF. See commit 869eebc of imx-atf.

Accorording to the commit message: Linux needs to call SMC to trap to TF-A for thermal alarm operation etc, by calling SCFW.

But I'm getting SC_ERR_NOACCESS error when trying to enable irq or get irq status: 

sc_irq_enable(mu_ipcHandle, SC_R_A53, SC_IRQ_GROUP_TEMP, SC_IRQ_TEMP_HIGH, 1);

sc_irq_status(mu_ipcHandle, SC_R_A53, SC_IRQ_GROUP_TEMP, &irq_status);

 

Also I see no reaction from SCFW when HIGH temperature was reached. So the question is: how can I get interrupt from SCFW in case of alarm if I have no permission to enable it from linux? irq_dispatch function is not used in ATF so it do not handle any interrupts either.

Best regards,

Oleksii

0 Kudos
Reply
1 Reply

441 Views
oleksiimoisieiev
Contributor I

I was able to fix this issue by using correct resource_id while calling sc_irq_enable/sc_irq_status. 

SC_R_MU_[0-9]A resource_id should be used here. where index is the MU index, which is currently used. In my case I used MU1 so call will look like this:

sc_irq_enable(mu_ipcHandle, SC_R_MU_1A, SC_IRQ_GROUP_TEMP, SC_IRQ_TEMP_HIGH, 1);

sc_irq_status(mu_ipcHandle, SC_R_MU_1A, SC_IRQ_GROUP_TEMP, &irq_status);

Marking question as solved. 

0 Kudos
Reply