"Das U-Boot" Source Tree
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

cpu: imx: implement release_core callback

Release the secondary cores through the PSCI request.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>

authored by

Hou Zhiqiang and committed by
Fabio Estevam
8a73b5b6 01d94d00

+24
+24
drivers/cpu/imx8_cpu.c
··· 7 7 #include <dm.h> 8 8 #include <thermal.h> 9 9 #include <asm/global_data.h> 10 + #include <asm/ptrace.h> 10 11 #include <asm/system.h> 11 12 #include <firmware/imx/sci/sci.h> 12 13 #include <asm/arch/sys_proto.h> ··· 15 16 #include <imx_thermal.h> 16 17 #include <linux/bitops.h> 17 18 #include <linux/clk-provider.h> 19 + #include <linux/psci.h> 18 20 19 21 DECLARE_GLOBAL_DATA_PTR; 20 22 ··· 240 242 return 0; 241 243 } 242 244 245 + static int cpu_imx_release_core(const struct udevice *dev, phys_addr_t addr) 246 + { 247 + struct cpu_imx_plat *plat = dev_get_plat(dev); 248 + struct pt_regs regs; 249 + 250 + regs.regs[0] = PSCI_0_2_FN64_CPU_ON; 251 + regs.regs[1] = plat->mpidr; 252 + regs.regs[2] = addr; 253 + regs.regs[3] = 0; 254 + 255 + smc_call(&regs); 256 + if (regs.regs[0]) { 257 + printf("Failed to release CPU core (mpidr: 0x%x)\n", plat->mpidr); 258 + return -1; 259 + } 260 + 261 + printf("Released CPU core (mpidr: 0x%x) to address 0x%llx\n", plat->mpidr, addr); 262 + 263 + return 0; 264 + } 265 + 243 266 static const struct cpu_ops cpu_imx_ops = { 244 267 .get_desc = cpu_imx_get_desc, 245 268 .get_info = cpu_imx_get_info, 246 269 .get_count = cpu_imx_get_count, 247 270 .get_vendor = cpu_imx_get_vendor, 248 271 .is_current = cpu_imx_is_current, 272 + .release_core = cpu_imx_release_core, 249 273 }; 250 274 251 275 static const struct udevice_id cpu_imx_ids[] = {