@@ -83,6 +83,16 @@ struct imx_rproc_dcfg {
size_t att_size;
};
+enum imx_rproc_mode {
+ /* Linux load/kick remote core */
+ IMX_RPROC_NORMAL,
+ /*
+ * remote core booted before kicking Linux, and remote core
+ * could be stopped & restarted by Linux
+ */
+ IMX_RPROC_EARLY_BOOT,
+};
+
struct imx_rproc {
struct device *dev;
struct regmap *regmap;
@@ -96,6 +106,7 @@ struct imx_rproc {
struct work_struct rproc_work;
struct workqueue_struct *workqueue;
void __iomem *rsc_table;
+ enum imx_rproc_mode mode;
};
static const struct imx_rproc_att imx_rproc_att_imx8mq[] = {
@@ -565,14 +576,18 @@ static int imx_rproc_detect_mode(struct imx_rproc *priv)
int ret;
u32 val;
+ priv->mode = IMX_RPROC_NORMAL;
+
ret = regmap_read(priv->regmap, dcfg->src_reg, &val);
if (ret) {
dev_err(dev, "Failed to read src\n");
return ret;
}
- if (!(val & dcfg->src_stop))
+ if (!(val & dcfg->src_stop)) {
+ priv->mode = IMX_RPROC_EARLY_BOOT;
priv->rproc->state = RPROC_DETACHED;
+ }
return 0;
}
@@ -654,6 +669,9 @@ static int imx_rproc_probe(struct platform_device *pdev)
INIT_WORK(&priv->rproc_work, imx_rproc_vq_work);
+ if (priv->mode == IMX_RPROC_NORMAL)
+ rproc->auto_boot = of_property_read_bool(np, "fsl,auto-boot");
+
ret = rproc_add(rproc);
if (ret) {
dev_err(dev, "rproc_add failed\n");