MLK-18793 imx8mq: config: add jailhouse env
authorPeng Fan <peng.fan@nxp.com>
Fri, 6 Jul 2018 06:07:02 +0000 (14:07 +0800)
committerYe Li <ye.li@nxp.com>
Wed, 28 Apr 2021 20:41:55 +0000 (13:41 -0700)
Add jailhouse env. Currently need to pass clk_ignore_unused to bootargs
to avoid linux root cell shutdown clocks used by inmates.

If only want a minimal clk being on in inmates, the clks could
be added in clk_inits_on in linux kernel drivers/clk/imx/clk-imx8mq.c

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 0d33db00e96e7addb6910a7097a62222ff75480f)
(cherry picked from commit 56ea0d9280b22ce3e260851e88782cb877fad6ec)
(cherry picked from commit a0371a771d102b3f90e043056ecdf477cd31ec20)
(cherry picked from commit b0790eaf28814d484c12c1b971a1518179fbb83a)

include/configs/imx8mq_evk.h

index 7fc63a7..5eb5c52 100644 (file)
 #define BOOTENV
 #endif
 
+/*
+ * Another approach is add the clocks for inmates into clks_init_on
+ * in clk-imx8mq.c, then clk_ingore_unused could be removed.
+ */
+#define JAILHOUSE_ENV \
+       "jh_clk= \0 " \
+       "jh_mmcboot=setenv fdt_file fsl-imx8mq-evk-root.dtb; setenv jh_clk clk_ignore_unused; run mmcboot\0 " \
+       "jh_netboot=setenv fdt_file fsl-imx8mq-evk-root.dtb; setenv jh_clk clk_ignore_unused; run netboot\0 "
+
 /* Initial environment variables */
 #define CONFIG_EXTRA_ENV_SETTINGS              \
        BOOTENV \
+       JAILHOUSE_ENV \
        "scriptaddr=0x43500000\0" \
        "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
        "bsp_script=boot.scr\0" \
@@ -85,7 +95,7 @@
        "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
        "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
        "mmcautodetect=yes\0" \
-       "mmcargs=setenv bootargs console=${console} root=${mmcroot}\0 " \
+       "mmcargs=setenv bootargs ${jh_clk} console=${console} root=${mmcroot}\0 " \
        "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bsp_script};\0" \
        "bootscript=echo Running bootscript from mmc ...; " \
                "source\0" \
                "else " \
                        "echo wait for boot; " \
                "fi;\0" \
-       "netargs=setenv bootargs console=${console} " \
+       "netargs=setenv bootargs ${jh_clk} console=${console} " \
                "root=/dev/nfs " \
                "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
        "netboot=echo Booting from net ...; " \