summaryrefslogtreecommitdiff
path: root/gxp-firmware.c
diff options
context:
space:
mode:
Diffstat (limited to 'gxp-firmware.c')
-rw-r--r--gxp-firmware.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gxp-firmware.c b/gxp-firmware.c
index d9e6cc6..eb31f23 100644
--- a/gxp-firmware.c
+++ b/gxp-firmware.c
@@ -372,7 +372,7 @@ static int gxp_firmware_handshake(struct gxp_dev *gxp, uint core)
}
dev_notice(gxp->dev, "Core %u is alive!\n", core);
-#ifndef CONFIG_GXP_GEM5
+#if !IS_ENABLED(CONFIG_GXP_GEM5)
/*
* FW reads the INT_MASK0 register (written by the driver) to
* validate TOP access. The value read is echoed back by the FW to
@@ -396,7 +396,7 @@ static int gxp_firmware_handshake(struct gxp_dev *gxp, uint core)
return -EIO;
}
dev_notice(gxp->dev, "TOP access from core %u successful!\n", core);
-#endif // !CONFIG_GXP_GEM5
+#endif
/* Stop bus performance monitors */
gxp_bpm_stop(gxp, core);
@@ -709,7 +709,7 @@ static void gxp_firmware_wakeup_cores(struct gxp_dev *gxp, uint core_list)
for (core = 0; core < GXP_NUM_CORES; core++) {
if (!(core_list & BIT(core)))
continue;
-#ifndef CONFIG_GXP_GEM5
+#if !IS_ENABLED(CONFIG_GXP_GEM5)
gxp_doorbell_enable_for_core(gxp, CORE_WAKEUP_DOORBELL(core),
core);
#endif
@@ -721,7 +721,7 @@ static int gxp_firmware_finish_startup(struct gxp_dev *gxp,
struct gxp_virtual_device *vd,
uint virt_core, uint core)
{
- int ret = 0;
+ int ret;
struct work_struct *work;
ret = gxp_firmware_handshake(gxp, core);
@@ -792,12 +792,14 @@ int gxp_firmware_run(struct gxp_dev *gxp, struct gxp_virtual_device *vd,
int ret;
uint core, virt_core;
uint failed_cores = 0;
+ int failed_ret;
for (core = 0; core < GXP_NUM_CORES; core++) {
if (core_list & BIT(core)) {
ret = gxp_firmware_setup(gxp, core);
if (ret) {
failed_cores |= BIT(core);
+ failed_ret = ret;
dev_err(gxp->dev, "Failed to run firmware on core %u\n",
core);
}
@@ -816,9 +818,9 @@ int gxp_firmware_run(struct gxp_dev *gxp, struct gxp_virtual_device *vd,
}
}
}
- goto out;
+ return failed_ret;
}
-#ifdef CONFIG_GXP_GEM5
+#if IS_ENABLED(CONFIG_GXP_GEM5)
/*
* GEM5 starts firmware after LPM is programmed, so we need to call
* gxp_doorbell_enable_for_core here to set GXP_REG_COMMON_INT_MASK_0
@@ -850,18 +852,20 @@ int gxp_firmware_run(struct gxp_dev *gxp, struct gxp_virtual_device *vd,
}
if (failed_cores != 0) {
+ virt_core = 0;
for (core = 0; core < GXP_NUM_CORES; core++) {
if (core_list & BIT(core)) {
if (!(failed_cores & BIT(core))) {
gxp_firmware_stop_core(gxp, vd,
virt_core, core);
}
+ virt_core++;
}
}
}
/* Check if we need to set clock mux to low state as requested */
gxp_pm_resume_clkmux(gxp);
-out:
+
return ret;
}