/* stm32_copro_set_hold_boot() - Hold boot bit management @dev: corresponding STM32 remote processor device @hold: hold boot value  */
static int stm32_copro_set_hold_boot(struct udevice *dev, bool hold)
/* stm32_copro_set_hold_boot() - Hold boot bit management @dev: corresponding STM32 remote processor device @hold: hold boot value  */
static int stm32_copro_set_hold_boot(struct udevice *dev, bool hold)
{
	struct stm32_copro_privdata *priv;
	uint val;
	int ret;
	priv = dev_get_priv(dev);
	val = hold ? RCC_GCR_HOLD_BOOT : RCC_GCR_RELEASE_BOOT;
	if (priv->secured_soc) {
		return stm32_smc_exec(STM32_SMC_RCC, STM32_SMC_REG_WRITE,
				      priv->hold_boot_offset, val);
	}
	ret = regmap_update_bits(priv->hold_boot_regmap, priv->hold_boot_offset,
				 priv->hold_boot_mask, val);
	if (ret)
		dev_err(dev, "failed to set hold boot\n");
	return ret;
}