提交 6f68b5e2 编写于 作者: V Vasant Hegde 提交者: Benjamin Herrenschmidt

powerpc/powernv: Create opal sysfs directory

Create /sys/firmware/opal directory. We wil use this
interface to fetch opal error logs, firmware update, etc.
Signed-off-by: NVasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 ef1313de
...@@ -601,6 +601,9 @@ typedef struct oppanel_line { ...@@ -601,6 +601,9 @@ typedef struct oppanel_line {
uint64_t line_len; uint64_t line_len;
} oppanel_line_t; } oppanel_line_t;
/* /sys/firmware/opal */
extern struct kobject *opal_kobj;
/* API functions */ /* API functions */
int64_t opal_console_write(int64_t term_number, __be64 *length, int64_t opal_console_write(int64_t term_number, __be64 *length,
const uint8_t *buffer); const uint8_t *buffer);
......
...@@ -17,11 +17,15 @@ ...@@ -17,11 +17,15 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/notifier.h> #include <linux/notifier.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/kobject.h>
#include <asm/opal.h> #include <asm/opal.h>
#include <asm/firmware.h> #include <asm/firmware.h>
#include "powernv.h" #include "powernv.h"
/* /sys/firmware/opal */
struct kobject *opal_kobj;
struct opal { struct opal {
u64 base; u64 base;
u64 entry; u64 entry;
...@@ -375,6 +379,17 @@ static irqreturn_t opal_interrupt(int irq, void *data) ...@@ -375,6 +379,17 @@ static irqreturn_t opal_interrupt(int irq, void *data)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static int opal_sysfs_init(void)
{
opal_kobj = kobject_create_and_add("opal", firmware_kobj);
if (!opal_kobj) {
pr_warn("kobject_create_and_add opal failed\n");
return -ENOMEM;
}
return 0;
}
static int __init opal_init(void) static int __init opal_init(void)
{ {
struct device_node *np, *consoles; struct device_node *np, *consoles;
...@@ -420,6 +435,10 @@ static int __init opal_init(void) ...@@ -420,6 +435,10 @@ static int __init opal_init(void)
" (0x%x)\n", rc, irq, hwirq); " (0x%x)\n", rc, irq, hwirq);
opal_irqs[i] = irq; opal_irqs[i] = irq;
} }
/* Create "opal" kobject under /sys/firmware */
rc = opal_sysfs_init();
return 0; return 0;
} }
subsys_initcall(opal_init); subsys_initcall(opal_init);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册