/*
* Copyright (C) 2001 Troy D. Armstrong IBM Corporation
* Copyright (C) 2004-2005 Stephen Rothwell IBM Corporation
*
* This modules exists as an interface between a Linux secondary partition
* running on an iSeries and the primary partition's Virtual Service
* Processor (VSP) object. The VSP has final authority over powering on/off
* all partitions in the iSeries. It also provides miscellaneous low-level
* machine facility type operations.
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/bcd.h>
#include <linux/rtc.h>
#include <asm/time.h>
#include <asm/uaccess.h>
#include <asm/paca.h>
#include <asm/abs_addr.h>
#include <asm/firmware.h>
#include <asm/iseries/mf.h>
#include <asm/iseries/hv_lp_config.h>
#include <asm/iseries/hv_lp_event.h>
#include <asm/iseries/it_lp_queue.h>
#include "setup.h"
static int mf_initialized;
/*
* This is the structure layout for the Machine Facilites LPAR event
* flows.
*/
struct vsp_cmd_data {
u64 token;
u16 cmd;
HvLpIndex lp_index;
u8 result_code;
u32 reserved;
union {
u64 state; /* GetStateOut */
u64 ipl_type; /* GetIplTypeOut, Function02SelectIplTypeIn */
u64 ipl_mode; /* GetIplModeOut, Function02SelectIplModeIn */
u64 page[4]; /* GetSrcHistoryIn */
u64 flag; /* GetAutoIplWhenPrimaryIplsOut,
SetAutoIplWhenPrimaryIplsIn,
WhiteButtonPowerOffIn,
Function08FastPowerOffIn,
IsSpcnRackPowerIncompleteOut */
struct {
u64 token;
u64 address_type;
u64 side;
u32 length;
u32 offset;
} kern; /* SetKernelImageIn, GetKernelImageIn,
SetKernelCmdLineIn, GetKernelCmdLineIn */
u32 length_out; /* GetKernelImageOut, GetKernelCmdLineOut */
u8 reserved[80];
} sub_data;
};
struct vsp_rsp_data {
struct completion com;
struct vsp_cmd_data *response;
};
struct alloc_data {
u16 size;
u16 type;
u32 count;
u16 reserved1;
u8 reserved2;
HvLpIndex target_lp;
};
struct ce_msg_data;
typedef void (*ce_msg_comp_hdlr)(void *token, struct ce_msg_data *vsp_cmd_rsp);
struct ce_msg_comp_data {
ce_msg_comp_hdlr handler;
void *token