Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed7c4657 authored by Dan Bar-On's avatar Dan Bar-On
Browse files

soc: qcom: spcom: don't send sw_init_done when spu boot fail



When SPU PBL fails to load SPU, do not send sw_init_done.

Change-Id: Ib551ac34273557957377e81c0abd2b22f16ab7a8
Signed-off-by: default avatarDan Bar-On <dbaron@codeaurora.org>
parent f7be1951
Loading
Loading
Loading
Loading
+33 −7
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
 */

/*
@@ -240,6 +240,8 @@ struct spcom_device {
/* Device Driver State */
static struct spcom_device *spcom_dev;

/* error registers shared with SPU */
static u32 spcom_rmb_error_reg_addr;
/* Physical address of SP2SOC RMB shared register */
/* SP_SCSR_RMB_SP2SOC_IRQ_SET_ADDR */
static u32 spcom_sp2soc_rmb_reg_addr;
@@ -595,15 +597,32 @@ static int spcom_handle_create_channel_command(void *cmd_buf, int cmd_size)
 */
static int spcom_local_powerup(const struct subsys_desc *subsys)
{
	void __iomem *regs;
	void __iomem *regs, *err_regs;
	u32 pbl_status_reg = 0;

	err_regs = ioremap_nocache(spcom_rmb_error_reg_addr, sizeof(u32));
	if (!err_regs)
		return -ENOMEM;

	pbl_status_reg = readl_relaxed(err_regs);

	if (pbl_status_reg == 0) {
		regs = ioremap_nocache(spcom_sp2soc_rmb_reg_addr, sizeof(u32));
	if (!regs)
		if (!regs) {
			iounmap(err_regs);
			return -ENOMEM;
		}

	writel_relaxed(spcom_sp2soc_pbldone_mask|spcom_sp2soc_initdone_mask,
		writel_relaxed(
			spcom_sp2soc_pbldone_mask|spcom_sp2soc_initdone_mask,
			regs);
		iounmap(regs);
	} else {
		pr_err("PBL has returned an error= 0x%x. Not sending sw_init_done\n",
			pbl_status_reg);
	}

	iounmap(err_regs);
	pr_debug("spcom local powerup - SPSS cold boot\n");
	return 0;
}
@@ -2121,6 +2140,13 @@ static int spcom_parse_dt(struct device_node *np)
	u32 soc2sp_rmb_sp_ssr_bit = 0;

	/* Read SP HLOS SCSR RMB IRQ register address */
	ret = of_property_read_u32(np, "qcom,spcom-rmb-err-reg-addr",
		&spcom_rmb_error_reg_addr);
	if (ret < 0) {
		pr_err("can't get rmb error reg addr\n");
		return ret;
	}

	ret = of_property_read_u32(np, "qcom,spcom-sp2soc-rmb-reg-addr",
		&spcom_sp2soc_rmb_reg_addr);
	if (ret < 0) {