diff options
author | Ye Li <ye.li@nxp.com> | 2019-02-25 01:18:56 -0800 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2019-02-25 01:51:57 -0800 |
commit | 8a57be45e18295ce1b19799723775cf5b205281d (patch) | |
tree | 98b7f7ecd2fbf101f6eb4bd431bddb3637d365f9 /arch | |
parent | 1ae3d2d3859c5f2610c74cd192da2657e2600aff (diff) |
MLK-20980 imx8qm/qxp_mek: Set kernel fdt according to M4 boot
When M4 is booted by ROM, we have to enable RPMSG in kernel, so need
to select the -rpmsg.dtb. If M4 is not enabled, use default kernel dtb.
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/include/asm/arch-imx8/sys_proto.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/imx8/cpu.c | 31 |
2 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-imx8/sys_proto.h b/arch/arm/include/asm/arch-imx8/sys_proto.h index c2641513054..24788e55e28 100644 --- a/arch/arm/include/asm/arch-imx8/sys_proto.h +++ b/arch/arm/include/asm/arch-imx8/sys_proto.h @@ -21,3 +21,4 @@ int init_otg_power(void); void power_off_pd_devices(const char* permanent_on_devices[], int size); extern unsigned long rom_pointer[]; enum boot_device get_boot_device(void); +bool check_m4_parts_boot(void); diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c index 3834cb61fbe..a09989951ce 100644 --- a/arch/arm/mach-imx/imx8/cpu.c +++ b/arch/arm/mach-imx/imx8/cpu.c @@ -1845,6 +1845,37 @@ bool check_owned_udevice(struct udevice *dev) return check_owned_resource(resource_id); } +bool check_m4_parts_boot(void) +{ + sc_rm_pt_t m4_parts[2]; + sc_ipc_t ipc; + sc_err_t err; + + ipc = gd->arch.ipc_channel_handle; + + err = sc_rm_get_resource_owner(ipc, SC_R_M4_0_PID0, &m4_parts[0]); + if (err != SC_ERR_NONE) { + printf("%s get resource [%d] owner error: %d\n", __func__, SC_R_M4_0_PID0, err); + return false; + } + + if (sc_pm_is_partition_started(ipc, m4_parts[0])) + return true; + + if (is_imx8qm()) { + err = sc_rm_get_resource_owner(ipc, SC_R_M4_1_PID0, &m4_parts[1]); + if (err != SC_ERR_NONE) { + printf("%s get resource [%d] owner error: %d\n", __func__, SC_R_M4_1_PID0, err); + return false; + } + + if (sc_pm_is_partition_started(ipc, m4_parts[1])) + return true; + } + + return false; +} + #ifdef CONFIG_IMX_VSERVICE struct udevice * board_imx_vservice_find_mu(struct udevice *dev) { |