psci: support hotplug cpu on/off 61/150761/4 accepted/tizen/4.0/unified/20171012.074514 accepted/tizen/unified/20171012.075106 submit/tizen/20171011.123005 submit/tizen_4.0/20171011.123522 tizen_4.0.IoT.p1_release
authoregukim <egukim@dignsys.com>
Mon, 18 Sep 2017 10:30:18 +0000 (19:30 +0900)
committeregukim <egukim@dignsys.com>
Wed, 27 Sep 2017 05:29:08 +0000 (14:29 +0900)
this patch not include suspend/standby

Change-Id: Ifc7d44a1fc5bacead81023c6445800628cf83983
Signed-off-by: egukim <egukim@dignsys.com>
plat/rpi3/aarch64/plat_helpers.S
plat/rpi3/bl31_plat_setup.c
plat/rpi3/plat_pm.c
plat/rpi3/rpi3_private.h
services/std_svc/psci/psci_entry.S

index eae85f7..07e6472 100644 (file)
@@ -44,7 +44,7 @@
        .globl  platform_get_core_pos
        .globl  platform_mem_init
        .globl  platform_set_el0_stack
-       .globl  platform_spin_core
+       .globl  psci_power_down_wfi
        .globl  plat_print_gic_regs
        .globl  plat_print_interconnect_regs
        .globl  plat_interrupt_type_to_line
@@ -192,7 +192,7 @@ func plat_ic_get_pending_interrupt_type
 func platform_mem_init
        ret
 
-func platform_spin_core
+func psci_power_down_wfi
        /*
         * MPIDR_EL1 Fields:
         * MPIDR[1:0] = AFF0_CPUID <- Core ID (0,1)
@@ -231,6 +231,7 @@ slave_cpu:
        mov     x1, #1
        cbz     x1, slave_exit
 slave_exit:
+       str     xzr, [x11]
        br      x0                      /* branch to the given address */
 
 .section .rodata.rev_err_str, "aS"
index b7775fd..88ba4f5 100644 (file)
@@ -39,6 +39,7 @@
 #include <stddef.h>
 #include <string.h>
 #include <platform_def.h>
+#include <psci.h>
 #include "rpi3_def.h"
 #include "rpi3_private.h"
 #include "debug.h"
@@ -114,7 +115,7 @@ uint64_t *bl31_get_spin_tbl_addr(void)
 uint64_t bl31_getspin(void)
 {
        memset(&__spin_table[0], 0, sizeof(__spin_table));
-       return(uint64_t)(platform_spin_core);
+       return(uint64_t)(psci_power_down_wfi);
 }
 
 /*******************************************************************************
index d7c6fc3..904cc42 100644 (file)
@@ -130,6 +130,11 @@ void rpi3_affinst_on_finish(uint32_t afflvl, uint32_t state)
        (void)linear_id;
 }
 
+void rpi3_affinst_off(unsigned int afflvl, unsigned int state)
+{
+       /* Determine if any platform actions need to be executed */
+       disable_mmu_el3();
+}
 
 static void __dead2 rpi3_system_off(void)
 {
@@ -185,7 +190,7 @@ static void __dead2 rpi3_system_reset(void)
 static const plat_pm_ops_t rpi3_ops = {
   .affinst_on          = rpi3_affinst_on,
   .affinst_on_finish   = rpi3_affinst_on_finish,
-  .affinst_off         = NULL,
+  .affinst_off         = rpi3_affinst_off,
   .affinst_standby     = NULL,
   .affinst_suspend     = NULL,
   .affinst_suspend_finish      = NULL,
index 86c643e..15bfc96 100644 (file)
@@ -63,6 +63,5 @@ void configure_mmu_el3(unsigned long total_base,
 extern void plat_gic_init(void);
 
 extern uint64_t *bl31_get_spin_tbl_addr(void);
-extern void platform_spin_core(void);
 
 #endif /* __RPI3_PRIVATE_H__ */
index 3e67d34..25d8a2d 100644 (file)
@@ -36,6 +36,7 @@
        .globl  psci_aff_on_finish_entry
        .globl  psci_aff_suspend_finish_entry
        .globl  psci_power_down_wfi
+       .weak   psci_power_down_wfi
 
        /* -----------------------------------------------------
         * This cpu has been physically powered up. Depending