imx8: scu: use dedicated MU for SPL
authorPeng Fan <peng.fan@nxp.com>
Fri, 21 Dec 2018 06:21:15 +0000 (06:21 +0000)
committerStefano Babic <sbabic@denx.de>
Mon, 28 Jan 2019 19:35:47 +0000 (20:35 +0100)
SPL runs in EL3 mode, except MU0_A, others are not powered on,
and could not be used. However normal U-Boot use MU1_A, so we
could not reuse the one in dts. And we could not replace the one
in dts with MU0_A, because MU0_A is reserved in secure world.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
arch/arm/mach-imx/imx8/Kconfig
drivers/misc/imx8/scu.c

index 9671107cb6f9e74b9187da4e7926e4d835050ee3..f76a139684222434a31e1b2d642b006aae1c4af3 100644 (file)
@@ -3,6 +3,13 @@ if ARCH_IMX8
 config IMX8
        bool
 
+config MU_BASE_SPL
+       hex "MU base address used in SPL"
+       default 0x5d1b0000
+       help
+         SPL runs in EL3 mode, it use MU0_A to communicate with SCU.
+         So we could not reuse the one in dts which is for normal U-Boot.
+
 config IMX8QXP
        select IMX8
        select SUPPORT_SPL
index 15101b3e5f240269fcd282bacd53166c94c1051d..1b9c49c99c9c7c3c2464c85a1377dd54e05e4e94 100644 (file)
@@ -191,7 +191,11 @@ static int imx8_scu_probe(struct udevice *dev)
        if (addr == FDT_ADDR_T_NONE)
                return -EINVAL;
 
+#ifdef CONFIG_SPL_BUILD
+       plat->base = (struct mu_type *)CONFIG_MU_BASE_SPL;
+#else
        plat->base = (struct mu_type *)addr;
+#endif
 
        /* U-Boot not enable interrupts, so need to enable RX interrupts */
        mu_hal_init(plat->base);