mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-02 09:46:37 +03:00
i.MX95 uses System Manager(sm) API to start/stop logical machine or cpu. There are two modes: M7 in a dedicated logical machine, use LMM API M7 and A55 in same logical machine, use CPU API Extend the driver to using LMM and CPU protocol to manage the M7 core: - Detect using LMM or CPU API in probe using API scmi_imx_lmm_info(). - Compare linux LM ID(got using scmi_imx_lmm_info) and M7 LM ID(the ID is fixed as 1 in SM firmware if M7 is in a separate LM), if Linux LM ID is not same as M7 LM ID(linux and M7 in same LM), use LMM protocol to start/stop. Whether using CPU or LMM protocol to start/stop, the M7 status detection could use CPU protocol to detect started or not. So in imx_rproc_is_running, use scmi_imx_cpu_started to check the status of M7. - For above case (2), Use scmi_imx_lmm_power_boot to detect whether the M7 LM is under control of A55 LM. - For above case , after using SCMI_IMX_LMM_POWER_ON to check permission, scmi_imx_lmm_shutdown API should be called to shutdown the M7 LM. - Add a new ops imx_rproc_ops_sm. Signed-off-by: Peng Fan <peng.fan@nxp.com>
60 lines
1.3 KiB
C
60 lines
1.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (c) 2017 Pengutronix, Oleksij Rempel <kernel@pengutronix.de>
|
|
* Copyright 2021 NXP
|
|
*/
|
|
|
|
#ifndef _IMX_RPROC_H
|
|
#define _IMX_RPROC_H
|
|
|
|
/* address translation table */
|
|
struct imx_rproc_att {
|
|
u32 da; /* device address (From Cortex M4 view)*/
|
|
u32 sa; /* system bus address */
|
|
u32 size; /* size of reg range */
|
|
int flags;
|
|
};
|
|
|
|
/* Remote core start/stop method */
|
|
enum imx_rproc_method {
|
|
IMX_RPROC_NONE,
|
|
/* Through syscon regmap */
|
|
IMX_RPROC_MMIO,
|
|
/* Through ARM SMCCC */
|
|
IMX_RPROC_SMC,
|
|
/* Through System Control Unit API */
|
|
IMX_RPROC_SCU_API,
|
|
/* Through Reset Controller API */
|
|
IMX_RPROC_RESET_CONTROLLER,
|
|
/* Through System Manager */
|
|
IMX_RPROC_SM,
|
|
};
|
|
|
|
/* dcfg flags */
|
|
#define IMX_RPROC_NEED_SYSTEM_OFF BIT(0)
|
|
|
|
struct imx_rproc_plat_ops {
|
|
int (*start)(struct udevice *dev);
|
|
int (*stop)(struct udevice *dev);
|
|
int (*is_running)(struct udevice *dev);
|
|
};
|
|
|
|
struct imx_rproc_dcfg {
|
|
u32 src_reg;
|
|
u32 src_mask;
|
|
u32 src_start;
|
|
u32 src_stop;
|
|
u32 gpr_reg;
|
|
u32 gpr_wait;
|
|
const struct imx_rproc_att *att;
|
|
size_t att_size;
|
|
enum imx_rproc_method method;
|
|
u32 flags;
|
|
const struct imx_rproc_plat_ops *ops;
|
|
/* For System Manager(SM) based SoCs, the IDs are from SM firmware */
|
|
u32 cpuid;
|
|
u32 lmid;
|
|
};
|
|
|
|
#endif /* _IMX_RPROC_H */
|