MLK-20784-1 TMU: Add a interface for TMU arch level initialization
authorYe Li <ye.li@nxp.com>
Mon, 21 Jan 2019 08:47:04 +0000 (00:47 -0800)
committerYe Li <ye.li@nxp.com>
Fri, 24 May 2019 09:31:10 +0000 (02:31 -0700)
Since imx8mm TMU needs to load some registers from fuse, this is arch
dependent operation and may vary on different platforms. So add
a interface for arch level initialization.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 1a66350d1baeef355d51da609c505aebb233cefb)

drivers/thermal/nxp_tmu.c

index ae0cb65..b4004a2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 NXP
+ * Copyright 2017-2019 NXP
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
@@ -191,6 +191,11 @@ static int nxp_tmu_calibration(struct udevice *dev)
        return 0;
 }
 
+void __weak nxp_tmu_arch_init(void *reg_base)
+{
+       return;
+}
+
 static void nxp_tmu_init(struct udevice *dev)
 {
        struct nxp_tmu_plat *pdata = dev_get_platdata(dev);
@@ -214,6 +219,8 @@ static void nxp_tmu_init(struct udevice *dev)
                /* Set update_interval */
                writel(TMTMIR_DEFAULT, &pdata->regs->regs_v1.tmtmir);
        }
+
+       nxp_tmu_arch_init((void *)pdata->regs);
 }
 
 static int nxp_tmu_enable_msite(struct udevice *dev)