MLK-17083 soc: imx: limit VPU/CPU bandwidth for lcdif on i.MX8MQ
authorAnson Huang <Anson.Huang@nxp.com>
Wed, 6 Dec 2017 13:51:32 +0000 (21:51 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:50:29 +0000 (14:50 -0500)
Config NOC to limit bandwidth to 4GB for both VPU
and CPU to avoid lcdif flickering only when lcdif is enabled.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
(cherry picked from commit 8ab89ebeb94a423792bf588bdf2354c5960d8f13)

drivers/soc/imx/soc-imx8.c
include/soc/imx/fsl_sip.h

index de34a5e..d5d922c 100644 (file)
@@ -257,6 +257,33 @@ static ssize_t imx8_get_soc_uid(struct device *dev,
 static struct device_attribute imx8_uid =
        __ATTR(soc_uid, S_IRUGO, imx8_get_soc_uid, NULL);
 
+static void __init imx8mq_noc_init(void)
+{
+       struct device_node *np;
+       const char *status;
+       int statlen;
+       struct arm_smccc_res res;
+
+       np = of_find_compatible_node(NULL, NULL, "fsl,imx8mq-lcdif");
+       if (!np)
+               return;
+
+       status = of_get_property(np, "status", &statlen);
+       if (status == NULL)
+               return;
+
+       if (statlen > 0) {
+               if (!strcmp(status, "disabled"))
+                       return;
+       }
+
+       pr_info("Config NOC for VPU and CPU\n");
+       arm_smccc_smc(FSL_SIP_NOC, FSL_SIP_NOC_LCDIF, 0,
+                       0, 0, 0, 0, 0, &res);
+       if (res.a0)
+               pr_err("Config NOC for VPU and CPU fail!\n");
+}
+
 static int __init imx8_soc_init(void)
 {
        struct soc_device_attribute *soc_dev_attr;
@@ -287,6 +314,9 @@ static int __init imx8_soc_init(void)
 
        device_create_file(soc_device_to_device(soc_dev), &imx8_uid);
 
+       if (of_machine_is_compatible("fsl,imx8mq"))
+               imx8mq_noc_init();
+
        return 0;
 
 free_rev:
index 11679d2..a5682ca 100644 (file)
@@ -57,4 +57,7 @@
 
 #define FSL_SIP_GET_SOC_INFO           0xc2000006
 
+#define FSL_SIP_NOC                    0xc2000008
+#define FSL_SIP_NOC_LCDIF              0x0
+
 #endif