File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 77#include <dm.h>
88#include <thermal.h>
99#include <asm/global_data.h>
10+ #include <asm/ptrace.h>
1011#include <asm/system.h>
1112#include <firmware/imx/sci/sci.h>
1213#include <asm/arch/sys_proto.h>
1516#include <imx_thermal.h>
1617#include <linux/bitops.h>
1718#include <linux/clk-provider.h>
19+ #include <linux/psci.h>
1820
1921DECLARE_GLOBAL_DATA_PTR ;
2022
@@ -240,12 +242,34 @@ static int cpu_imx_is_current(struct udevice *dev)
240242 return 0 ;
241243}
242244
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+
243266static const struct cpu_ops cpu_imx_ops = {
244267 .get_desc = cpu_imx_get_desc ,
245268 .get_info = cpu_imx_get_info ,
246269 .get_count = cpu_imx_get_count ,
247270 .get_vendor = cpu_imx_get_vendor ,
248271 .is_current = cpu_imx_is_current ,
272+ .release_core = cpu_imx_release_core ,
249273};
250274
251275static const struct udevice_id cpu_imx_ids [] = {
You can’t perform that action at this time.
0 commit comments