iMX8QM: system reset from M4 core software

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

iMX8QM: system reset from M4 core software

Jump to solution
2,352 Views
aso
Contributor III

Hello,

I am developing software on a custom board using iMX8QM.
The following function is executed to reset the system from the M4 core software.

 sc_pm_reset (ipc, SC_PM_RESET_TYPE_COLD);

The return value of this function is SC_ERR_NOACCESS and cannot be reset.
What should I do to reset it?

Currently, M4 core software are running from uboot commands.

 loadm4image_0 = fatload mmc $ {mmcdev}: $ {mmcpart} $ {loadaddr} $ {m4_0_image}
 m4boot_0 = run load m4image_0; dcache flush; bootaux $ {loadaddr} 0
 run m4boot_0

Thanks.

0 Kudos
1 Solution
2,243 Views
aso
Contributor III

Thank you for answering.

This case was self-solved.

I checked the SCFW porting kit.
The SC_R_SYSTEM is owned by ATF as the partition 1.
u-boot, Linux and M4 software were AP, as partition3.
Since partition 3 is dynamically created by ATF, SCFW could not handle it.

Therefore, I changed the source code of ATF and built it.
I have given the The SC_R_SYSTEM authority.
As a result, I succeeded in resetting with the current configuration.

Thanks.

View solution in original post

7 Replies
2,329 Views
fmonte
Contributor IV

Does the M4 partition have access to the SC_R_SYSTEM partition?

0 Kudos
2,314 Views
aso
Contributor III

Thanks for your comment.

How can I give SC_R_SYSTEM access to M4 partition?
I'm thinking of editing scfw, how do I set it?

Also, if I give access to the M4 partition, do I need to boot from the M4 partition? Is it okay to use the uboot command as before?

0 Kudos
2,298 Views
fmonte
Contributor IV

You need to work on board.c of SCFW. Use functions like sc_rm_assign_resource() to set the ownership of a resource.

You do not need to alter your boot configuration.

0 Kudos
2,244 Views
aso
Contributor III

Thank you for answering.

This case was self-solved.

I checked the SCFW porting kit.
The SC_R_SYSTEM is owned by ATF as the partition 1.
u-boot, Linux and M4 software were AP, as partition3.
Since partition 3 is dynamically created by ATF, SCFW could not handle it.

Therefore, I changed the source code of ATF and built it.
I have given the The SC_R_SYSTEM authority.
As a result, I succeeded in resetting with the current configuration.

Thanks.

686 Views
zemagi
Contributor II

Please, can you describe me better the ATF source changes needed to give the SC_R_SYSTEM authority to Partition 3? 

0 Kudos
642 Views
aso
Contributor III

The modified source file is below.
/plat/imx/imx8qm/include/sec_rsrc.h

~$ diff -u sec_rsrc.h update/sec_rsrc.h
--- sec_rsrc.h  2019-10-15 17:56:50.000000000 +0900
+++ update/sec_rsrc.h   2023-12-11 11:31:45.664303795 +0900
@@ -18,8 +18,9 @@
        SC_R_GIC,
        SC_R_GIC_SMMU,
        SC_R_CCI,
-       SC_R_SYSTEM,
-       SC_R_GPT_0,
+//  delete for board reset in M4 app
+//     SC_R_SYSTEM,
+//     SC_R_GPT_0,
 #ifdef SPD_trusty
        SC_R_CAAM_JR2,
        SC_R_CAAM_JR2_OUT,
@@ -32,6 +33,8 @@

 /* resources that have register access for non-secure domain */
 sc_rsrc_t ns_access_allowed[] = {
+// add for board reset in M4 app
+       SC_R_SYSTEM,
        SC_R_GIC,
        SC_R_GPT_0,
        SC_R_CCI

 

0 Kudos
633 Views
zemagi
Contributor II

Thank you!

0 Kudos