MLK-22219 mx6: Place pre_misc_setting() into a common location
authorFabio Estevam <fabio.estevam@nxp.com>
Thu, 4 Jul 2019 17:12:24 +0000 (14:12 -0300)
committerPeng Fan <peng.fan@nxp.com>
Mon, 8 Jul 2019 02:09:11 +0000 (10:09 +0800)
Currently the NoC settings are only done if the splash screen
support is enabled.

However, this can cause IPU issues on i.MX6QP in the kernel, when
splash screen is not enabled in U-Boot.

To avoid such problems, place the pre_misc_setting() function
into a common location that will always run on i.MX6QP/DP.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
arch/arm/mach-imx/mx6/clock.c
arch/arm/mach-imx/mx6/soc.c

index e40d239..9eff9bf 100644 (file)
@@ -1414,30 +1414,6 @@ int do_mx6_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 }
 
 #ifndef CONFIG_MX6SX
-static void pre_misc_setting(void)
-{
-       /* Bypass IPU1 QoS generator */
-       writel(0x00000002, 0x00bb048c);
-       /* Bypass IPU2 QoS generator */
-       writel(0x00000002, 0x00bb050c);
-       /* Bandwidth THR for of PRE0 */
-       writel(0x00000200, 0x00bb0690);
-       /* Bandwidth THR for of PRE1 */
-       writel(0x00000200, 0x00bb0710);
-       /* Bandwidth THR for of PRE2 */
-       writel(0x00000200, 0x00bb0790);
-       /* Bandwidth THR for of PRE3 */
-       writel(0x00000200, 0x00bb0810);
-       /* Saturation THR for of PRE0 */
-       writel(0x00000010, 0x00bb0694);
-       /* Saturation THR for of PRE1 */
-       writel(0x00000010, 0x00bb0714);
-       /* Saturation THR for of PRE2 */
-       writel(0x00000010, 0x00bb0794);
-       /* Saturation THR for of PRE */
-       writel(0x00000010, 0x00bb0814);
-}
-
 void enable_ipu_clock(void)
 {
        struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
@@ -1449,13 +1425,6 @@ void enable_ipu_clock(void)
        if (is_mx6dqp()) {
                setbits_le32(&mxc_ccm->CCGR6, MXC_CCM_CCGR6_PRG_CLK0_MASK);
                setbits_le32(&mxc_ccm->CCGR3, MXC_CCM_CCGR3_IPU2_IPU_MASK);
-
-               /*
-                * Since CONFIG_VIDEO_IPUV3 is always set in mx6sabre_common.h and
-                * this misc setting is a must for mx6qp, this position is ok
-                * to do such settings.
-                */
-               pre_misc_setting();
        }
 }
 #endif
index c71ef89..935ab74 100644 (file)
@@ -534,6 +534,30 @@ bool is_usb_boot(void)
        return false;
 }
 
+static void pre_misc_setting(void)
+{
+       /* Bypass IPU1 QoS generator */
+       writel(0x00000002, 0x00bb048c);
+       /* Bypass IPU2 QoS generator */
+       writel(0x00000002, 0x00bb050c);
+       /* Bandwidth THR for of PRE0 */
+       writel(0x00000200, 0x00bb0690);
+       /* Bandwidth THR for of PRE1 */
+       writel(0x00000200, 0x00bb0710);
+       /* Bandwidth THR for of PRE2 */
+       writel(0x00000200, 0x00bb0790);
+       /* Bandwidth THR for of PRE3 */
+       writel(0x00000200, 0x00bb0810);
+       /* Saturation THR for of PRE0 */
+       writel(0x00000010, 0x00bb0694);
+       /* Saturation THR for of PRE1 */
+       writel(0x00000010, 0x00bb0714);
+       /* Saturation THR for of PRE2 */
+       writel(0x00000010, 0x00bb0794);
+       /* Saturation THR for of PRE */
+       writel(0x00000010, 0x00bb0814);
+}
+
 int arch_cpu_init(void)
 {
        if (is_usbphy_power_on())
@@ -658,8 +682,10 @@ int arch_cpu_init(void)
 
        init_src();
 
-       if (is_mx6dqp())
+       if (is_mx6dqp()) {
                writel(0x80000201, 0xbb0608);
+               pre_misc_setting();
+       }
 
 #ifdef CONFIG_IMX_SEC_INIT
        /* Secure init function such RNG */