[PATCH 5/5] lib: utils/suspend: add Andes ATCSMU suspend driver

Andrew Jones andrew.jones at oss.qualcomm.com
Wed Feb 11 07:59:39 PST 2026


On Mon, Dec 29, 2025 at 03:19:14PM +0800, Ben Zong-You Xie wrote:
...
> @@ -130,16 +152,27 @@ static int ae350_hart_stop(void)
>  	/* Prevent the core leaving the WFI mode unexpectedly */
>  	csr_write(CSR_MIE, 0);
>  
> -	atcsmu_set_wakeup_events(0x0, hartid);
> -	atcsmu_set_command(DEEP_SLEEP_CMD, hartid);
> -	rc = atcsmu_set_reset_vector((u64)ae350_enable_coherency_warmboot, hartid);
> -	if (rc)
> -		return SBI_EFAIL;
> +	if (sleep_type == SBI_SUSP_AE350_LIGHT_SLEEP) {
> +		csr_write(CSR_MIE, MIP_MSIP);
> +		atcsmu_set_wakeup_events(PCS_WAKEUP_MSIP_MASK, hartid);
> +		atcsmu_set_command(LIGHT_SLEEP_CMD, hartid);
> +	} else if (sleep_type == SBI_SUSP_SLEEP_TYPE_SUSPEND) {
> +		atcsmu_set_wakeup_events(0x0, hartid);
> +		atcsmu_set_command(DEEP_SLEEP_CMD, hartid);
> +		rc = atcsmu_set_reset_vector((u64)ae350_enable_coherency_warmboot, hartid);
> +		if (rc)
> +			return SBI_EFAIL;
> +
> +		ae350_non_ret_save(sbi_scratch_thishart_ptr());
> +	}
>  
> -	ae350_non_ret_save(sbi_scratch_thishart_ptr());
>  	ae350_disable_coherency();
>  	wfi();
> -	return 0;
> +
> +	/* Light sleep resumes here */
> +	ae350_enable_coherency();
> +
> +	return SBI_ENOTSUPP;

I just skimmed this patch really fast, so I probably missed something,
but it seems odd to return SBI_ENOTSUPP here.

Thanks,
drew



More information about the opensbi mailing list