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.
Solved! Go to Solution.
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.
Does the M4 partition have access to the SC_R_SYSTEM partition?
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?
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.
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.
Please, can you describe me better the ATF source changes needed to give the SC_R_SYSTEM authority to Partition 3?
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
Thank you!