diff mbox

[4/7] powerpc: add Freescale hypervisor partition control functions

Message ID 1305813272-31826-5-git-send-email-timur@freescale.com (mailing list archive)
State Accepted, archived
Commit d173ea6b4078f37320b49d06f9656ba76ee1ba6c
Delegated to: Kumar Gala
Headers show

Commit Message

Timur Tabi May 19, 2011, 1:54 p.m. UTC
Add functions to restart and halt the current partition when running under
the Freescale hypervisor.  These functions should be assigned to various
function pointers of the ppc_md structure during the .probe() function for
the board:

	ppc_md.restart = fsl_hv_restart;
	ppc_md.power_off = fsl_hv_halt;
	ppc_md.halt = fsl_hv_halt;

Signed-off-by: Timur Tabi <timur@freescale.com>
---
 arch/powerpc/sysdev/fsl_soc.c |   27 +++++++++++++++++++++++++++
 arch/powerpc/sysdev/fsl_soc.h |    3 +++
 2 files changed, 30 insertions(+), 0 deletions(-)

Comments

Kumar Gala June 22, 2011, 11:41 a.m. UTC | #1
On May 19, 2011, at 8:54 AM, Timur Tabi wrote:

> Add functions to restart and halt the current partition when running under
> the Freescale hypervisor.  These functions should be assigned to various
> function pointers of the ppc_md structure during the .probe() function for
> the board:
> 
> 	ppc_md.restart = fsl_hv_restart;
> 	ppc_md.power_off = fsl_hv_halt;
> 	ppc_md.halt = fsl_hv_halt;
> 
> Signed-off-by: Timur Tabi <timur@freescale.com>
> ---
> arch/powerpc/sysdev/fsl_soc.c |   27 +++++++++++++++++++++++++++
> arch/powerpc/sysdev/fsl_soc.h |    3 +++
> 2 files changed, 30 insertions(+), 0 deletions(-)

applied to next

- k
diff mbox

Patch

diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 19e5015..265313e 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -41,6 +41,7 @@ 
 #include <sysdev/fsl_soc.h>
 #include <mm/mmu_decl.h>
 #include <asm/cpm2.h>
+#include <asm/fsl_hcalls.h>	/* For the Freescale hypervisor */
 
 extern void init_fcc_ioports(struct fs_platform_info*);
 extern void init_fec_ioports(struct fs_platform_info*);
@@ -252,3 +253,29 @@  void fsl_rstcr_restart(char *cmd)
 struct platform_diu_data_ops diu_ops;
 EXPORT_SYMBOL(diu_ops);
 #endif
+
+/*
+ * Restart the current partition
+ *
+ * This function should be assigned to the ppc_md.restart function pointer,
+ * to initiate a partition restart when we're running under the Freescale
+ * hypervisor.
+ */
+void fsl_hv_restart(char *cmd)
+{
+	pr_info("hv restart\n");
+	fh_partition_restart(-1);
+}
+
+/*
+ * Halt the current partition
+ *
+ * This function should be assigned to the ppc_md.power_off and ppc_md.halt
+ * function pointers, to shut down the partition when we're running under
+ * the Freescale hypervisor.
+ */
+void fsl_hv_halt(void)
+{
+	pr_info("hv exit\n");
+	fh_partition_stop(-1);
+}
diff --git a/arch/powerpc/sysdev/fsl_soc.h b/arch/powerpc/sysdev/fsl_soc.h
index 5360948..2ece02b 100644
--- a/arch/powerpc/sysdev/fsl_soc.h
+++ b/arch/powerpc/sysdev/fsl_soc.h
@@ -36,5 +36,8 @@  struct platform_diu_data_ops {
 extern struct platform_diu_data_ops diu_ops;
 #endif
 
+void fsl_hv_restart(char *cmd);
+void fsl_hv_halt(void);
+
 #endif
 #endif