diff options
Diffstat (limited to 'arch/powerpc/platforms/pseries/papr-hvpipe.c')
-rw-r--r-- | arch/powerpc/platforms/pseries/papr-hvpipe.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/pseries/papr-hvpipe.c b/arch/powerpc/platforms/pseries/papr-hvpipe.c index eb312594b1f0..65368dbb134b 100644 --- a/arch/powerpc/platforms/pseries/papr-hvpipe.c +++ b/arch/powerpc/platforms/pseries/papr-hvpipe.c @@ -15,6 +15,7 @@ #include <asm/machdep.h> #include <asm/rtas.h> #include <asm/rtas-work-area.h> +#include <asm/papr-sysparm.h> #include <uapi/asm/papr-hvpipe.h> #include "pseries.h" #include "papr-hvpipe.h" @@ -648,6 +649,32 @@ static irqreturn_t hvpipe_event_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } +/* + * Enable hvpipe by system parameter set with parameter + * token = 64 and with 1 byte buffer data: + * 0 = hvpipe not in use/disable + * 1 = hvpipe in use/enable + */ +static int set_hvpipe_sys_param(u8 val) +{ + struct papr_sysparm_buf *buf; + int ret; + + buf = papr_sysparm_buf_alloc(); + if (!buf) + return -ENOMEM; + + buf->len = cpu_to_be16(1); + buf->val[0] = val; + ret = papr_sysparm_set(PAPR_SYSPARM_HVPIPE_ENABLE, buf); + if (ret) + pr_err("Can not enable hvpipe %d\n", ret); + + papr_sysparm_buf_free(buf); + + return ret; +} + static int __init enable_hvpipe_IRQ(void) { struct device_node *np; @@ -705,8 +732,11 @@ static int __init papr_hvpipe_init(void) } ret = enable_hvpipe_IRQ(); - if (!ret) - ret = misc_register(&papr_hvpipe_dev); + if (!ret) { + ret = set_hvpipe_sys_param(1); + if (!ret) + ret = misc_register(&papr_hvpipe_dev); + } if (!ret) { pr_info("hvpipe feature is enabled\n"); |