On 6/2/25 09:50, Beleswar Padhi wrote:
+int __maybe_unused shutdown_mcu_r5_core1(void)
+{
+ struct ti_sci_handle *ti_sci = get_ti_sci_handle();
+ struct ti_sci_dev_ops *dev_ops = &ti_sci->ops.dev_ops;
+ struct ti_sci_proc_ops *proc_ops = &ti_sci->ops.proc_ops;
+ u32 dev_id_mcu_r5_core1 = put_core_ids[0];
+ u64 boot_vector;
+ u32 cfg, ctrl, sts;
+ int cluster_mode_lockstep, ret;
+
+ ret = proc_ops->proc_request(ti_sci, PROC_ID_MCU_R5FSS0_CORE1);
+ if (ret) {
+ printf("Unable to request processor control for core %d\n",
+ PROC_ID_MCU_R5FSS0_CORE1);
+ return ret;
+ }
+
+ ret = proc_ops->get_proc_boot_status(ti_sci, PROC_ID_MCU_R5FSS0_CORE1,
+ &boot_vector, &cfg, &ctrl, &sts);
+ if (ret) {
+ printf("Unable to get Processor boot status for core %d\n",
+ PROC_ID_MCU_R5FSS0_CORE1);
+ goto release_proc_ctrl;
+ }
+
+ /* Shutdown MCU R5F Core 1 only if the cluster is booted in SplitMode */
+ cluster_mode_lockstep = !!(cfg & PROC_BOOT_CFG_FLAG_R5_LOCKSTEP);
+ if (cluster_mode_lockstep) {
+ ret = -EINVAL;
+ goto release_proc_ctrl;
+ }
+
I suppose this code runs in A72-SPL environment right? I wonder, if you
need to check the state of CORE1 (reset state and/or HALT) before
proceeding to shutdown the core. Just to make any other earlier
bootloader (SBL or other variants) did n't boot CORE1.