remoteproc: imx_rproc: support i.MX8MQ/M
authorPeng Fan <peng.fan@nxp.com>
Sat, 6 Mar 2021 11:24:23 +0000 (19:24 +0800)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Thu, 11 Mar 2021 18:02:44 +0000 (12:02 -0600)
Add i.MX8MQ dev/sys addr map and configuration data structure
i.MX8MM share i.MX8MQ settings.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/1615029865-23312-9-git-send-email-peng.fan@oss.nxp.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/remoteproc/Kconfig
drivers/remoteproc/imx_rproc.c

index 15d1574d129bb77073c3e96f23d38c6880dd4393..7cf3d1b40c55f0c83ee86b2bc0c1da631dbfacee 100644 (file)
@@ -24,11 +24,11 @@ config REMOTEPROC_CDEV
          It's safe to say N if you don't want to use this interface.
 
 config IMX_REMOTEPROC
-       tristate "IMX6/7 remoteproc support"
+       tristate "i.MX remoteproc support"
        depends on ARCH_MXC
        help
-         Say y here to support iMX's remote processors (Cortex M4
-         on iMX7D) via the remote processor framework.
+         Say y here to support iMX's remote processors via the remote
+         processor framework.
 
          It's safe to say N here.
 
index 5ae1f52095487839762564480bca40ae0fc3f6be..0124ebf69838bd348b10b13d1b280e96c6a7dc1c 100644 (file)
@@ -88,6 +88,34 @@ struct imx_rproc {
        struct clk                      *clk;
 };
 
+static const struct imx_rproc_att imx_rproc_att_imx8mq[] = {
+       /* dev addr , sys addr  , size      , flags */
+       /* TCML - alias */
+       { 0x00000000, 0x007e0000, 0x00020000, 0 },
+       /* OCRAM_S */
+       { 0x00180000, 0x00180000, 0x00008000, 0 },
+       /* OCRAM */
+       { 0x00900000, 0x00900000, 0x00020000, 0 },
+       /* OCRAM */
+       { 0x00920000, 0x00920000, 0x00020000, 0 },
+       /* QSPI Code - alias */
+       { 0x08000000, 0x08000000, 0x08000000, 0 },
+       /* DDR (Code) - alias */
+       { 0x10000000, 0x80000000, 0x0FFE0000, 0 },
+       /* TCML */
+       { 0x1FFE0000, 0x007E0000, 0x00020000, ATT_OWN },
+       /* TCMU */
+       { 0x20000000, 0x00800000, 0x00020000, ATT_OWN },
+       /* OCRAM_S */
+       { 0x20180000, 0x00180000, 0x00008000, ATT_OWN },
+       /* OCRAM */
+       { 0x20200000, 0x00900000, 0x00020000, ATT_OWN },
+       /* OCRAM */
+       { 0x20220000, 0x00920000, 0x00020000, ATT_OWN },
+       /* DDR (Data) */
+       { 0x40000000, 0x40000000, 0x80000000, 0 },
+};
+
 static const struct imx_rproc_att imx_rproc_att_imx7d[] = {
        /* dev addr , sys addr  , size      , flags */
        /* OCRAM_S (M4 Boot code) - alias */
@@ -138,6 +166,15 @@ static const struct imx_rproc_att imx_rproc_att_imx6sx[] = {
        { 0x80000000, 0x80000000, 0x60000000, 0 },
 };
 
+static const struct imx_rproc_dcfg imx_rproc_cfg_imx8mq = {
+       .src_reg        = IMX7D_SRC_SCR,
+       .src_mask       = IMX7D_M4_RST_MASK,
+       .src_start      = IMX7D_M4_START,
+       .src_stop       = IMX7D_M4_STOP,
+       .att            = imx_rproc_att_imx8mq,
+       .att_size       = ARRAY_SIZE(imx_rproc_att_imx8mq),
+};
+
 static const struct imx_rproc_dcfg imx_rproc_cfg_imx7d = {
        .src_reg        = IMX7D_SRC_SCR,
        .src_mask       = IMX7D_M4_RST_MASK,
@@ -496,6 +533,8 @@ static int imx_rproc_remove(struct platform_device *pdev)
 static const struct of_device_id imx_rproc_of_match[] = {
        { .compatible = "fsl,imx7d-cm4", .data = &imx_rproc_cfg_imx7d },
        { .compatible = "fsl,imx6sx-cm4", .data = &imx_rproc_cfg_imx6sx },
+       { .compatible = "fsl,imx8mq-cm4", .data = &imx_rproc_cfg_imx8mq },
+       { .compatible = "fsl,imx8mm-cm4", .data = &imx_rproc_cfg_imx8mq },
        {},
 };
 MODULE_DEVICE_TABLE(of, imx_rproc_of_match);
@@ -512,5 +551,5 @@ static struct platform_driver imx_rproc_driver = {
 module_platform_driver(imx_rproc_driver);
 
 MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("IMX6SX/7D remote processor control driver");
+MODULE_DESCRIPTION("i.MX remote processor control driver");
 MODULE_AUTHOR("Oleksij Rempel <o.rempel@pengutronix.de>");