Commit 6f68b5e2c6c04e9cf0e3074f884da36957ce9aae
Committed by
Benjamin Herrenschmidt
1 parent
ef1313deaf
Exists in
master
and in
16 other branches
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: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Showing 2 changed files with 22 additions and 0 deletions Side-by-side Diff
arch/powerpc/include/asm/opal.h
arch/powerpc/platforms/powernv/opal.c
... | ... | @@ -17,11 +17,15 @@ |
17 | 17 | #include <linux/interrupt.h> |
18 | 18 | #include <linux/notifier.h> |
19 | 19 | #include <linux/slab.h> |
20 | +#include <linux/kobject.h> | |
20 | 21 | #include <asm/opal.h> |
21 | 22 | #include <asm/firmware.h> |
22 | 23 | |
23 | 24 | #include "powernv.h" |
24 | 25 | |
26 | +/* /sys/firmware/opal */ | |
27 | +struct kobject *opal_kobj; | |
28 | + | |
25 | 29 | struct opal { |
26 | 30 | u64 base; |
27 | 31 | u64 entry; |
... | ... | @@ -375,6 +379,17 @@ |
375 | 379 | return IRQ_HANDLED; |
376 | 380 | } |
377 | 381 | |
382 | +static int opal_sysfs_init(void) | |
383 | +{ | |
384 | + opal_kobj = kobject_create_and_add("opal", firmware_kobj); | |
385 | + if (!opal_kobj) { | |
386 | + pr_warn("kobject_create_and_add opal failed\n"); | |
387 | + return -ENOMEM; | |
388 | + } | |
389 | + | |
390 | + return 0; | |
391 | +} | |
392 | + | |
378 | 393 | static int __init opal_init(void) |
379 | 394 | { |
380 | 395 | struct device_node *np, *consoles; |
... | ... | @@ -420,6 +435,10 @@ |
420 | 435 | " (0x%x)\n", rc, irq, hwirq); |
421 | 436 | opal_irqs[i] = irq; |
422 | 437 | } |
438 | + | |
439 | + /* Create "opal" kobject under /sys/firmware */ | |
440 | + rc = opal_sysfs_init(); | |
441 | + | |
423 | 442 | return 0; |
424 | 443 | } |
425 | 444 | subsys_initcall(opal_init); |