imx8: scu_api: add sc_pm_get_resource_power_mode
PATCH 1/4 imx8: scu_api: add sc_pm_get_resource_power_mode
Add sc_pm_get_resource_power_mode to get resource power mode
Signed-off-by Peng Fan <[email protected]>
--- arch/arm/include/asm/arch-imx8/sci/sci.h | 2 ++ drivers/misc/imx8/scu_api.c | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+)
arch/arm/include/asm/arch-imx8/sci/sci.h +2 -0
@@ -58,6 +58,8 @@ static inline int sc_err_to_linux(sc_err_t err)/* PM API*/ int sc_pm_set_resource_power_mode (sc_ipc_t ipc,sc_rsrc_t resource,sc_pm_power_mode_t mode); +int sc_pm_get_resource_power_mode (sc_ipc_t ipc,sc_rsrc_t resource, +sc_pm_power_mode_t *mode);int sc_pm_set_clock_rate (sc_ipc_t ipc,sc_rsrc_t resource,sc_pm_clk_t clk,sc_pm_clock_rate_t *rate); int sc_pm_get_clock_rate(sc_ipc_t ipc, sc_rsrc_t resource, sc_pm_clk_t clk,
drivers/misc/imx8/scu_api.c +25 -0
@@ -119,6 +119,31 @@ int sc_pm_set_resource_power_mode(sc_ipc_t ipc, sc_rsrc_t resource,return ret; } +int sc_pm_get_resource_power_mode (sc_ipc_t ipc,sc_rsrc_t resource, +sc_pm_power_mode_t *mode) +{ +struct udevice *dev = gd->arch.scu_dev; +struct sc_rpc_msg_s msg; +int size =sizeof (struct sc_rpc_msg_s ); +int ret; + +RPC_VER (&msg) =SC_RPC_VERSION ; +RPC_SVC (&msg) = (u8)(SC_RPC_SVC_PM ); +RPC_FUNC (&msg) = (u8)(PM_FUNC_GET_RESOURCE_POWER_MODE ); +RPC_U16 (&msg,0U ) = (u16)(resource); +RPC_SIZE (&msg) =2U ; + + ret =misc_call (dev,SC_FALSE , &msg, size, &msg, size); +if (ret) +printf ("%s: resource:%d: res:%d\n" , + __func__, resource,RPC_R8 (&msg)); + +if (mode) + *mode =RPC_U8 (&msg,0U ); + +return ret; +} +/* PAD */ int sc_pad_set (sc_ipc_t ipc,sc_pad_t pad,u32 val) {
Signature · 1 line
2.16.4
PATCH 2/4 imx: scu_api: add sc_pm_cpu_start
Add sc_pm_cpu_start to start M4 and DSP core.
Signed-off-by Peng Fan <[email protected]>
--- arch/arm/include/asm/arch-imx8/sci/sci.h | 3 +++ drivers/misc/imx8/scu_api.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+)
arch/arm/include/asm/arch-imx8/sci/sci.h +3 -0
@@ -83,4 +83,7 @@ sc_bool_t sc_rm_is_resource_owned(sc_ipc_t ipc, sc_rsrc_t resource);/* PAD API */ int sc_pad_set (sc_ipc_t ipc,sc_pad_t pad,u32 val); + +int sc_pm_cpu_start (sc_ipc_t ipc,sc_rsrc_t resource,sc_bool_t enable, +sc_faddr_t address);#endif
drivers/misc/imx8/scu_api.c +30 -0
@@ -13,6 +13,8 @@DECLARE_GLOBAL_DATA_PTR ; +#define B2U8 (X ) (((X) != SC_FALSE) ? (u8)(0x01U) : (u8)(0x00U)) +/* CLK and PM */ int sc_pm_set_clock_rate (sc_ipc_t ipc,sc_rsrc_t resource,sc_pm_clk_t clk,sc_pm_clock_rate_t *rate)
@@ -390,3 +392,31 @@ sc_bool_t sc_rm_is_resource_owned(sc_ipc_t ipc, sc_rsrc_t resource)return !!result; } + +int sc_pm_cpu_start (sc_ipc_t ipc,sc_rsrc_t resource,sc_bool_t enable, +sc_faddr_t address) +{ +struct udevice *dev = gd->arch.scu_dev; +struct sc_rpc_msg_s msg; +int size =sizeof (struct sc_rpc_msg_s ); +int ret; + +if (!dev) +hang (); + +RPC_VER (&msg) =SC_RPC_VERSION ; +RPC_SVC (&msg) = (u8)(SC_RPC_SVC_PM ); +RPC_FUNC (&msg) = (u8)(PM_FUNC_CPU_START ); +RPC_U32 (&msg,0U ) = (u32)(address >>32ULL ); +RPC_U32 (&msg,4U ) = (u32)(address); +RPC_U16 (&msg,8U ) = (u16)(resource); +RPC_U8 (&msg,10U ) =B2U8 (enable); +RPC_SIZE (&msg) =4U ; + + ret =misc_call (dev,SC_FALSE , &msg, size, &msg, size); +if (ret) +printf ("%s: resource:%d address:0x%llx: res:%d\n" , + __func__, resource, address,RPC_R8 (&msg)); + +return ret; +}
Signature · 1 line
2.16.4
PATCH 3/4 imx: Kconfig: make bootaux available for i.MX8M
In reply to Peng FanMake i.MX8M able to use bootaux command.
Signed-off-by Peng Fan <[email protected]>
--- arch/arm/mach-imx/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-imx/Kconfig +1 -1
@@ -23,7 +23,7 @@ config IMX_RDC config IMX_BOOTAUX bool "Support boot auxiliary core" - depends on ARCH_MX7 || ARCH_MX6 || ARCH_VF610 + depends on ARCH_IMX8M || ARCH_MX7 || ARCH_MX6 || ARCH_VF610 help bootaux [addr] to boot auxiliary core.
Signature · 1 line
2.16.4
PATCH 4/4 imx8: add bootaux support
In reply to Peng FanAdd bootaux to kick M4 and DSP. When M4 is not kicked by ROM/SCU, we could use U-Boot to kick as i.MX6/7.
Signed-off-by Peng Fan <[email protected]>
--- arch/arm/mach-imx/Kconfig | 2 +- arch/arm/mach-imx/imx8/Makefile | 1 + arch/arm/mach-imx/imx8/bootaux.c | 225 +++++++++++++++++++++++++++++++++++++++ arch/arm/mach-imx/imx_bootaux.c | 2 + 4 files changed, 229 insertions(+), 1 deletion(-) create mode 100644 arch/arm/mach-imx/imx8/bootaux.c
arch/arm/mach-imx/Kconfig +1 -1
@@ -23,7 +23,7 @@ config IMX_RDC config IMX_BOOTAUX bool "Support boot auxiliary core" - depends on ARCH_IMX8M || ARCH_MX7 || ARCH_MX6 || ARCH_VF610 + depends on ARCH_IMX8M || ARCH_IMX8 || ARCH_MX7 || ARCH_MX6 || ARCH_VF610 help bootaux [addr] to boot auxiliary core.
arch/arm/mach-imx/imx8/Makefile +1 -0
@@ -5,3 +5,4 @@ # obj-y += cpu.o iomux.o +obj-$(CONFIG_IMX_BOOTAUX) += bootaux.o
arch/arm/mach-imx/imx8/bootaux.c new file +225 -0
225 lines not on this page · raw message
arch/arm/mach-imx/imx_bootaux.c +2 -0
@@ -10,6 +10,7 @@#include <imx_sip.h> #include <linux/compiler.h> +#ifndef CONFIG_IMX8 int arch_auxiliary_core_up (u32 core_id,ulong boot_private_data) {ulong stack, pc;
@@ -50,6 +51,7 @@ int arch_auxiliary_core_check_up(u32 core_id)return 1 ; #endif } +#endif /* * To i.MX6SX and i.MX7D, the image supported by bootaux needs
Signature · 1 line
2.16.4