2 * PowerNV OPAL high level interfaces
4 * Copyright 2011 IBM Corp.
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
12 #define pr_fmt(fmt) "opal: " fmt
14 #include <linux/printk.h>
15 #include <linux/types.h>
17 #include <linux/of_fdt.h>
18 #include <linux/of_platform.h>
19 #include <linux/interrupt.h>
20 #include <linux/notifier.h>
21 #include <linux/slab.h>
22 #include <linux/sched.h>
23 #include <linux/kobject.h>
24 #include <linux/delay.h>
25 #include <linux/memblock.h>
26 #include <linux/kthread.h>
27 #include <linux/freezer.h>
29 #include <asm/machdep.h>
31 #include <asm/firmware.h>
36 /* /sys/firmware/opal */
37 struct kobject *opal_kobj;
45 struct mcheck_recoverable_range {
51 static struct mcheck_recoverable_range *mc_recoverable_range;
52 static int mc_recoverable_range_len;
54 struct device_node *opal_node;
55 static DEFINE_SPINLOCK(opal_write_lock);
56 static unsigned int *opal_irqs;
57 static unsigned int opal_irq_count;
58 static ATOMIC_NOTIFIER_HEAD(opal_notifier_head);
59 static struct atomic_notifier_head opal_msg_notifier_head[OPAL_MSG_TYPE_MAX];
60 static DEFINE_SPINLOCK(opal_notifier_lock);
61 static uint64_t last_notified_mask = 0x0ul;
62 static atomic_t opal_notifier_hold = ATOMIC_INIT(0);
63 static uint32_t opal_heartbeat;
65 static void opal_reinit_cores(void)
67 /* Do the actual re-init, This will clobber all FPRs, VRs, etc...
69 * It will preserve non volatile GPRs and HSPRG0/1. It will
70 * also restore HIDs and other SPRs to their original value
71 * but it might clobber a bunch.
74 opal_reinit_cpus(OPAL_REINIT_CPUS_HILE_BE);
76 opal_reinit_cpus(OPAL_REINIT_CPUS_HILE_LE);
80 int __init early_init_dt_scan_opal(unsigned long node,
81 const char *uname, int depth, void *data)
83 const void *basep, *entryp, *sizep;
84 int basesz, entrysz, runtimesz;
86 if (depth != 1 || strcmp(uname, "ibm,opal") != 0)
89 basep = of_get_flat_dt_prop(node, "opal-base-address", &basesz);
90 entryp = of_get_flat_dt_prop(node, "opal-entry-address", &entrysz);
91 sizep = of_get_flat_dt_prop(node, "opal-runtime-size", &runtimesz);
93 if (!basep || !entryp || !sizep)
96 opal.base = of_read_number(basep, basesz/4);
97 opal.entry = of_read_number(entryp, entrysz/4);
98 opal.size = of_read_number(sizep, runtimesz/4);
100 pr_debug("OPAL Base = 0x%llx (basep=%p basesz=%d)\n",
101 opal.base, basep, basesz);
102 pr_debug("OPAL Entry = 0x%llx (entryp=%p basesz=%d)\n",
103 opal.entry, entryp, entrysz);
104 pr_debug("OPAL Entry = 0x%llx (sizep=%p runtimesz=%d)\n",
105 opal.size, sizep, runtimesz);
107 powerpc_firmware_features |= FW_FEATURE_OPAL;
108 if (of_flat_dt_is_compatible(node, "ibm,opal-v3")) {
109 powerpc_firmware_features |= FW_FEATURE_OPALv2;
110 powerpc_firmware_features |= FW_FEATURE_OPALv3;
111 pr_info("OPAL V3 detected !\n");
112 } else if (of_flat_dt_is_compatible(node, "ibm,opal-v2")) {
113 powerpc_firmware_features |= FW_FEATURE_OPALv2;
114 pr_info("OPAL V2 detected !\n");
116 pr_info("OPAL V1 detected !\n");
119 /* Reinit all cores with the right endian */
122 /* Restore some bits */
123 if (cur_cpu_spec->cpu_restore)
124 cur_cpu_spec->cpu_restore();
129 int __init early_init_dt_scan_recoverable_ranges(unsigned long node,
130 const char *uname, int depth, void *data)
135 if (depth != 1 || strcmp(uname, "ibm,opal") != 0)
138 prop = of_get_flat_dt_prop(node, "mcheck-recoverable-ranges", &psize);
143 pr_debug("Found machine check recoverable ranges.\n");
146 * Calculate number of available entries.
148 * Each recoverable address range entry is (start address, len,
149 * recovery address), 2 cells each for start and recovery address,
150 * 1 cell for len, totalling 5 cells per entry.
152 mc_recoverable_range_len = psize / (sizeof(*prop) * 5);
155 if (!mc_recoverable_range_len)
158 /* Size required to hold all the entries. */
159 size = mc_recoverable_range_len *
160 sizeof(struct mcheck_recoverable_range);
163 * Allocate a buffer to hold the MC recoverable ranges. We would be
164 * accessing them in real mode, hence it needs to be within
167 mc_recoverable_range =__va(memblock_alloc_base(size, __alignof__(u64),
169 memset(mc_recoverable_range, 0, size);
171 for (i = 0; i < mc_recoverable_range_len; i++) {
172 mc_recoverable_range[i].start_addr =
173 of_read_number(prop + (i * 5) + 0, 2);
174 mc_recoverable_range[i].end_addr =
175 mc_recoverable_range[i].start_addr +
176 of_read_number(prop + (i * 5) + 2, 1);
177 mc_recoverable_range[i].recover_addr =
178 of_read_number(prop + (i * 5) + 3, 2);
180 pr_debug("Machine check recoverable range: %llx..%llx: %llx\n",
181 mc_recoverable_range[i].start_addr,
182 mc_recoverable_range[i].end_addr,
183 mc_recoverable_range[i].recover_addr);
188 static int __init opal_register_exception_handlers(void)
190 #ifdef __BIG_ENDIAN__
193 if (!(powerpc_firmware_features & FW_FEATURE_OPAL))
196 /* Hookup some exception handlers except machine check. We use the
197 * fwnmi area at 0x7000 to provide the glue space to OPAL
202 * Check if we are running on newer firmware that exports
203 * OPAL_HANDLE_HMI token. If yes, then don't ask OPAL to patch
204 * the HMI interrupt and we catch it directly in Linux.
206 * For older firmware (i.e currently released POWER8 System Firmware
207 * as of today <= SV810_087), we fallback to old behavior and let OPAL
208 * patch the HMI vector and handle it inside OPAL firmware.
210 * For newer firmware (in development/yet to be released) we will
211 * start catching/handling HMI directly in Linux.
213 if (!opal_check_token(OPAL_HANDLE_HMI)) {
214 pr_info("Old firmware detected, OPAL handles HMIs.\n");
215 opal_register_exception_handler(
216 OPAL_HYPERVISOR_MAINTENANCE_HANDLER,
221 opal_register_exception_handler(OPAL_SOFTPATCH_HANDLER, 0, glue);
226 machine_early_initcall(powernv, opal_register_exception_handlers);
228 int opal_notifier_register(struct notifier_block *nb)
231 pr_warning("%s: Invalid argument (%p)\n",
236 atomic_notifier_chain_register(&opal_notifier_head, nb);
239 EXPORT_SYMBOL_GPL(opal_notifier_register);
241 int opal_notifier_unregister(struct notifier_block *nb)
244 pr_warning("%s: Invalid argument (%p)\n",
249 atomic_notifier_chain_unregister(&opal_notifier_head, nb);
252 EXPORT_SYMBOL_GPL(opal_notifier_unregister);
254 static void opal_do_notifier(uint64_t events)
257 uint64_t changed_mask;
259 if (atomic_read(&opal_notifier_hold))
262 spin_lock_irqsave(&opal_notifier_lock, flags);
263 changed_mask = last_notified_mask ^ events;
264 last_notified_mask = events;
265 spin_unlock_irqrestore(&opal_notifier_lock, flags);
268 * We feed with the event bits and changed bits for
269 * enough information to the callback.
271 atomic_notifier_call_chain(&opal_notifier_head,
272 events, (void *)changed_mask);
275 void opal_notifier_update_evt(uint64_t evt_mask,
280 spin_lock_irqsave(&opal_notifier_lock, flags);
281 last_notified_mask &= ~evt_mask;
282 last_notified_mask |= evt_val;
283 spin_unlock_irqrestore(&opal_notifier_lock, flags);
286 void opal_notifier_enable(void)
291 atomic_set(&opal_notifier_hold, 0);
293 /* Process pending events */
294 rc = opal_poll_events(&evt);
295 if (rc == OPAL_SUCCESS && evt)
296 opal_do_notifier(be64_to_cpu(evt));
299 void opal_notifier_disable(void)
301 atomic_set(&opal_notifier_hold, 1);
305 * Opal message notifier based on message type. Allow subscribers to get
306 * notified for specific messgae type.
308 int opal_message_notifier_register(enum opal_msg_type msg_type,
309 struct notifier_block *nb)
311 if (!nb || msg_type >= OPAL_MSG_TYPE_MAX) {
312 pr_warning("%s: Invalid arguments, msg_type:%d\n",
317 return atomic_notifier_chain_register(
318 &opal_msg_notifier_head[msg_type], nb);
321 int opal_message_notifier_unregister(enum opal_msg_type msg_type,
322 struct notifier_block *nb)
324 return atomic_notifier_chain_unregister(
325 &opal_msg_notifier_head[msg_type], nb);
328 static void opal_message_do_notify(uint32_t msg_type, void *msg)
330 /* notify subscribers */
331 atomic_notifier_call_chain(&opal_msg_notifier_head[msg_type],
335 static void opal_handle_message(void)
339 * TODO: pre-allocate a message buffer depending on opal-msg-size
340 * value in /proc/device-tree.
342 static struct opal_msg msg;
345 ret = opal_get_msg(__pa(&msg), sizeof(msg));
346 /* No opal message pending. */
347 if (ret == OPAL_RESOURCE)
350 /* check for errors. */
352 pr_warning("%s: Failed to retrieve opal message, err=%lld\n",
357 type = be32_to_cpu(msg.msg_type);
360 if (type >= OPAL_MSG_TYPE_MAX) {
361 pr_warning("%s: Unknown message type: %u\n", __func__, type);
364 opal_message_do_notify(type, (void *)&msg);
367 static int opal_message_notify(struct notifier_block *nb,
368 unsigned long events, void *change)
370 if (events & OPAL_EVENT_MSG_PENDING)
371 opal_handle_message();
375 static struct notifier_block opal_message_nb = {
376 .notifier_call = opal_message_notify,
381 static int __init opal_message_init(void)
385 for (i = 0; i < OPAL_MSG_TYPE_MAX; i++)
386 ATOMIC_INIT_NOTIFIER_HEAD(&opal_msg_notifier_head[i]);
388 ret = opal_notifier_register(&opal_message_nb);
390 pr_err("%s: Can't register OPAL event notifier (%d)\n",
396 machine_early_initcall(powernv, opal_message_init);
398 int opal_get_chars(uint32_t vtermno, char *buf, int count)
405 opal_poll_events(&evt);
406 if ((be64_to_cpu(evt) & OPAL_EVENT_CONSOLE_INPUT) == 0)
408 len = cpu_to_be64(count);
409 rc = opal_console_read(vtermno, &len, buf);
410 if (rc == OPAL_SUCCESS)
411 return be64_to_cpu(len);
415 int opal_put_chars(uint32_t vtermno, const char *data, int total_len)
426 /* We want put_chars to be atomic to avoid mangling of hvsi
427 * packets. To do that, we first test for room and return
428 * -EAGAIN if there isn't enough.
430 * Unfortunately, opal_console_write_buffer_space() doesn't
431 * appear to work on opal v1, so we just assume there is
432 * enough room and be done with it
434 spin_lock_irqsave(&opal_write_lock, flags);
435 if (firmware_has_feature(FW_FEATURE_OPALv2)) {
436 rc = opal_console_write_buffer_space(vtermno, &olen);
437 len = be64_to_cpu(olen);
438 if (rc || len < total_len) {
439 spin_unlock_irqrestore(&opal_write_lock, flags);
440 /* Closed -> drop characters */
443 opal_poll_events(NULL);
448 /* We still try to handle partial completions, though they
449 * should no longer happen.
452 while(total_len > 0 && (rc == OPAL_BUSY ||
453 rc == OPAL_BUSY_EVENT || rc == OPAL_SUCCESS)) {
454 olen = cpu_to_be64(total_len);
455 rc = opal_console_write(vtermno, &olen, data);
456 len = be64_to_cpu(olen);
458 /* Closed or other error drop */
459 if (rc != OPAL_SUCCESS && rc != OPAL_BUSY &&
460 rc != OPAL_BUSY_EVENT) {
464 if (rc == OPAL_SUCCESS) {
469 /* This is a bit nasty but we need that for the console to
470 * flush when there aren't any interrupts. We will clean
471 * things a bit later to limit that to synchronous path
472 * such as the kernel console and xmon/udbg
475 opal_poll_events(&evt);
476 while(rc == OPAL_SUCCESS &&
477 (be64_to_cpu(evt) & OPAL_EVENT_CONSOLE_OUTPUT));
479 spin_unlock_irqrestore(&opal_write_lock, flags);
483 static int opal_recover_mce(struct pt_regs *regs,
484 struct machine_check_event *evt)
487 uint64_t ea = get_mce_fault_addr(evt);
489 if (!(regs->msr & MSR_RI)) {
490 /* If MSR_RI isn't set, we cannot recover */
492 } else if (evt->disposition == MCE_DISPOSITION_RECOVERED) {
493 /* Platform corrected itself */
495 } else if (ea && !is_kernel_addr(ea)) {
497 * Faulting address is not in kernel text. We should be fine.
498 * We need to find which process uses this address.
499 * For now, kill the task if we have received exception when
502 * TODO: Queue up this address for hwpoisioning later.
504 if (user_mode(regs) && !is_global_init(current)) {
505 _exception(SIGBUS, regs, BUS_MCEERR_AR, regs->nip);
509 } else if (user_mode(regs) && !is_global_init(current) &&
510 evt->severity == MCE_SEV_ERROR_SYNC) {
512 * If we have received a synchronous error when in userspace
515 _exception(SIGBUS, regs, BUS_MCEERR_AR, regs->nip);
521 int opal_machine_check(struct pt_regs *regs)
523 struct machine_check_event evt;
525 if (!get_mce_event(&evt, MCE_EVENT_RELEASE))
528 /* Print things out */
529 if (evt.version != MCE_V1) {
530 pr_err("Machine Check Exception, Unknown event version %d !\n",
534 machine_check_print_event_info(&evt);
536 if (opal_recover_mce(regs, &evt))
541 /* Early hmi handler called in real mode. */
542 int opal_hmi_exception_early(struct pt_regs *regs)
547 * call opal hmi handler. Pass paca address as token.
548 * The return value OPAL_SUCCESS is an indication that there is
549 * an HMI event generated waiting to pull by Linux.
551 rc = opal_handle_hmi();
552 if (rc == OPAL_SUCCESS) {
553 local_paca->hmi_event_available = 1;
559 /* HMI exception handler called in virtual mode during check_irq_replay. */
560 int opal_handle_hmi_exception(struct pt_regs *regs)
566 * Check if HMI event is available.
567 * if Yes, then call opal_poll_events to pull opal messages and
570 if (!local_paca->hmi_event_available)
573 local_paca->hmi_event_available = 0;
574 rc = opal_poll_events(&evt);
575 if (rc == OPAL_SUCCESS && evt)
576 opal_do_notifier(be64_to_cpu(evt));
581 static uint64_t find_recovery_address(uint64_t nip)
585 for (i = 0; i < mc_recoverable_range_len; i++)
586 if ((nip >= mc_recoverable_range[i].start_addr) &&
587 (nip < mc_recoverable_range[i].end_addr))
588 return mc_recoverable_range[i].recover_addr;
592 bool opal_mce_check_early_recovery(struct pt_regs *regs)
594 uint64_t recover_addr = 0;
596 if (!opal.base || !opal.size)
599 if ((regs->nip >= opal.base) &&
600 (regs->nip <= (opal.base + opal.size)))
601 recover_addr = find_recovery_address(regs->nip);
604 * Setup regs->nip to rfi into fixup address.
607 regs->nip = recover_addr;
610 return !!recover_addr;
613 static irqreturn_t opal_interrupt(int irq, void *data)
617 opal_handle_interrupt(virq_to_hw(irq), &events);
619 opal_do_notifier(be64_to_cpu(events));
624 static int opal_sysfs_init(void)
626 opal_kobj = kobject_create_and_add("opal", firmware_kobj);
628 pr_warn("kobject_create_and_add opal failed\n");
635 static ssize_t symbol_map_read(struct file *fp, struct kobject *kobj,
636 struct bin_attribute *bin_attr,
637 char *buf, loff_t off, size_t count)
639 return memory_read_from_buffer(buf, count, &off, bin_attr->private,
643 static BIN_ATTR_RO(symbol_map, 0);
645 static void opal_export_symmap(void)
649 struct device_node *fw;
652 fw = of_find_node_by_path("/ibm,opal/firmware");
655 syms = of_get_property(fw, "symbol-map", &size);
656 if (!syms || size != 2 * sizeof(__be64))
659 /* Setup attributes */
660 bin_attr_symbol_map.private = __va(be64_to_cpu(syms[0]));
661 bin_attr_symbol_map.size = be64_to_cpu(syms[1]);
663 rc = sysfs_create_bin_file(opal_kobj, &bin_attr_symbol_map);
665 pr_warn("Error %d creating OPAL symbols file\n", rc);
668 static void __init opal_dump_region_init(void)
674 if (!opal_check_token(OPAL_REGISTER_DUMP_REGION))
677 /* Register kernel log buffer */
678 addr = log_buf_addr_get();
682 size = log_buf_len_get();
686 rc = opal_register_dump_region(OPAL_DUMP_REGION_LOG_BUF,
688 /* Don't warn if this is just an older OPAL that doesn't
689 * know about that call
691 if (rc && rc != OPAL_UNSUPPORTED)
692 pr_warn("DUMP: Failed to register kernel log buffer. "
696 static void opal_ipmi_init(struct device_node *opal_node)
698 struct device_node *np;
700 for_each_child_of_node(opal_node, np)
701 if (of_device_is_compatible(np, "ibm,opal-ipmi"))
702 of_platform_device_create(np, NULL, NULL);
705 static void opal_i2c_create_devs(void)
707 struct device_node *np;
709 for_each_compatible_node(np, NULL, "ibm,opal-i2c")
710 of_platform_device_create(np, NULL, NULL);
713 static void __init opal_irq_init(struct device_node *dn)
718 /* Get interrupt property */
719 irqs = of_get_property(opal_node, "opal-interrupts", &irqlen);
720 opal_irq_count = irqs ? (irqlen / 4) : 0;
721 pr_debug("Found %d interrupts reserved for OPAL\n", opal_irq_count);
725 /* Install interrupt handlers */
726 opal_irqs = kzalloc(opal_irq_count * sizeof(unsigned int), GFP_KERNEL);
727 for (i = 0; irqs && i < opal_irq_count; i++, irqs++) {
728 unsigned int irq, virq;
731 /* Get hardware and virtual IRQ */
732 irq = be32_to_cpup(irqs);
733 virq = irq_create_mapping(NULL, irq);
734 if (virq == NO_IRQ) {
735 pr_warn("Failed to map irq 0x%x\n", irq);
739 /* Install interrupt handler */
740 rc = request_irq(virq, opal_interrupt, 0, "opal", NULL);
742 irq_dispose_mapping(virq);
743 pr_warn("Error %d requesting irq %d (0x%x)\n",
753 static int kopald(void *unused)
758 opal_poll_events(NULL);
759 msleep_interruptible(opal_heartbeat);
760 } while (!kthread_should_stop());
765 static void opal_init_heartbeat(void)
767 /* Old firwmware, we assume the HVC heartbeat is sufficient */
768 if (of_property_read_u32(opal_node, "ibm,heartbeat-ms",
769 &opal_heartbeat) != 0)
773 kthread_run(kopald, NULL, "kopald");
776 static int __init opal_init(void)
778 struct device_node *np, *consoles;
781 opal_node = of_find_node_by_path("/ibm,opal");
783 pr_warn("Device node not found\n");
787 /* Register OPAL consoles if any ports */
788 if (firmware_has_feature(FW_FEATURE_OPALv2))
789 consoles = of_find_node_by_path("/ibm,opal/consoles");
791 consoles = of_node_get(opal_node);
793 for_each_child_of_node(consoles, np) {
794 if (strcmp(np->name, "serial"))
796 of_platform_device_create(np, NULL, NULL);
798 of_node_put(consoles);
801 /* Create i2c platform devices */
802 opal_i2c_create_devs();
804 /* Setup a heatbeat thread if requested by OPAL */
805 opal_init_heartbeat();
807 /* Find all OPAL interrupts and request them */
808 opal_irq_init(opal_node);
810 /* Create "opal" kobject under /sys/firmware */
811 rc = opal_sysfs_init();
813 /* Export symbol map to userspace */
814 opal_export_symmap();
815 /* Setup dump region interface */
816 opal_dump_region_init();
817 /* Setup error log interface */
818 rc = opal_elog_init();
819 /* Setup code update interface */
821 /* Setup platform dump extract interface */
822 opal_platform_dump_init();
823 /* Setup system parameters interface */
824 opal_sys_param_init();
825 /* Setup message log interface. */
829 /* Initialize OPAL IPMI backend */
830 opal_ipmi_init(opal_node);
834 machine_subsys_initcall(powernv, opal_init);
836 void opal_shutdown(void)
841 /* First free interrupts, which will also mask them */
842 for (i = 0; i < opal_irq_count; i++) {
844 free_irq(opal_irqs[i], NULL);
849 * Then sync with OPAL which ensure anything that can
850 * potentially write to our memory has completed such
851 * as an ongoing dump retrieval
853 while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) {
854 rc = opal_sync_host_reboot();
856 opal_poll_events(NULL);
861 /* Unregister memory dump region */
862 if (opal_check_token(OPAL_UNREGISTER_DUMP_REGION))
863 opal_unregister_dump_region(OPAL_DUMP_REGION_LOG_BUF);
866 /* Export this so that test modules can use it */
867 EXPORT_SYMBOL_GPL(opal_invalid_call);
868 EXPORT_SYMBOL_GPL(opal_ipmi_send);
869 EXPORT_SYMBOL_GPL(opal_ipmi_recv);
871 /* Convert a region of vmalloc memory to an opal sg list */
872 struct opal_sg_list *opal_vmalloc_to_sg_list(void *vmalloc_addr,
873 unsigned long vmalloc_size)
875 struct opal_sg_list *sg, *first = NULL;
878 sg = kzalloc(PAGE_SIZE, GFP_KERNEL);
884 while (vmalloc_size > 0) {
885 uint64_t data = vmalloc_to_pfn(vmalloc_addr) << PAGE_SHIFT;
886 uint64_t length = min(vmalloc_size, PAGE_SIZE);
888 sg->entry[i].data = cpu_to_be64(data);
889 sg->entry[i].length = cpu_to_be64(length);
892 if (i >= SG_ENTRIES_PER_NODE) {
893 struct opal_sg_list *next;
895 next = kzalloc(PAGE_SIZE, GFP_KERNEL);
899 sg->length = cpu_to_be64(
900 i * sizeof(struct opal_sg_entry) + 16);
902 sg->next = cpu_to_be64(__pa(next));
906 vmalloc_addr += length;
907 vmalloc_size -= length;
910 sg->length = cpu_to_be64(i * sizeof(struct opal_sg_entry) + 16);
915 pr_err("%s : Failed to allocate memory\n", __func__);
916 opal_free_sg_list(first);
920 void opal_free_sg_list(struct opal_sg_list *sg)
923 uint64_t next = be64_to_cpu(sg->next);
934 int opal_error_code(int rc)
937 case OPAL_SUCCESS: return 0;
939 case OPAL_PARAMETER: return -EINVAL;
940 case OPAL_ASYNC_COMPLETION: return -EINPROGRESS;
941 case OPAL_BUSY_EVENT: return -EBUSY;
942 case OPAL_NO_MEM: return -ENOMEM;
944 case OPAL_UNSUPPORTED: return -EIO;
945 case OPAL_HARDWARE: return -EIO;
946 case OPAL_INTERNAL_ERROR: return -EIO;
948 pr_err("%s: unexpected OPAL error %d\n", __func__, rc);
953 EXPORT_SYMBOL_GPL(opal_poll_events);
954 EXPORT_SYMBOL_GPL(opal_rtc_read);
955 EXPORT_SYMBOL_GPL(opal_rtc_write);
956 EXPORT_SYMBOL_GPL(opal_tpo_read);
957 EXPORT_SYMBOL_GPL(opal_tpo_write);
958 EXPORT_SYMBOL_GPL(opal_i2c_request);