114a43e69SBenjamin Herrenschmidt/*
214a43e69SBenjamin Herrenschmidt * PowerNV OPAL API wrappers
314a43e69SBenjamin Herrenschmidt *
414a43e69SBenjamin Herrenschmidt * Copyright 2011 IBM Corp.
514a43e69SBenjamin Herrenschmidt *
614a43e69SBenjamin Herrenschmidt * This program is free software; you can redistribute it and/or
714a43e69SBenjamin Herrenschmidt * modify it under the terms of the GNU General Public License
814a43e69SBenjamin Herrenschmidt * as published by the Free Software Foundation; either version
914a43e69SBenjamin Herrenschmidt * 2 of the License, or (at your option) any later version.
1014a43e69SBenjamin Herrenschmidt */
1114a43e69SBenjamin Herrenschmidt
1258995a9aSAnton Blanchard#include <linux/jump_label.h>
1314a43e69SBenjamin Herrenschmidt#include <asm/ppc_asm.h>
1414a43e69SBenjamin Herrenschmidt#include <asm/hvcall.h>
1514a43e69SBenjamin Herrenschmidt#include <asm/asm-offsets.h>
1614a43e69SBenjamin Herrenschmidt#include <asm/opal.h>
17ec0c464cSChristophe Leroy#include <asm/asm-compat.h>
18c49f6353SAnton Blanchard
19c49f6353SAnton Blanchard	.section	".text"
20c49f6353SAnton Blanchard
21c49f6353SAnton Blanchard#ifdef CONFIG_TRACEPOINTS
221bc9e47aSAnton Blanchard#ifdef HAVE_JUMP_LABEL
23c49f6353SAnton Blanchard#define OPAL_BRANCH(LABEL)					\
24c49f6353SAnton Blanchard	ARCH_STATIC_BRANCH(LABEL, opal_tracepoint_key)
25c49f6353SAnton Blanchard#else
26c49f6353SAnton Blanchard
27c49f6353SAnton Blanchard	.section	".toc","aw"
28c49f6353SAnton Blanchard
29c49f6353SAnton Blanchard	.globl opal_tracepoint_refcount
30c49f6353SAnton Blanchardopal_tracepoint_refcount:
31eb039161STobin C. Harding	.8byte	0
32c49f6353SAnton Blanchard
33c49f6353SAnton Blanchard	.section	".text"
34c49f6353SAnton Blanchard
35c49f6353SAnton Blanchard/*
36c49f6353SAnton Blanchard * We branch around this in early init by using an unconditional cpu
37c49f6353SAnton Blanchard * feature.
38c49f6353SAnton Blanchard */
39c49f6353SAnton Blanchard#define OPAL_BRANCH(LABEL)					\
40c49f6353SAnton BlanchardBEGIN_FTR_SECTION;						\
41c49f6353SAnton Blanchard	b	1f;						\
42c49f6353SAnton BlanchardEND_FTR_SECTION(0, 1);						\
432a9c4f40SAlexey Kardashevskiy	ld	r11,opal_tracepoint_refcount@toc(r2);		\
442a9c4f40SAlexey Kardashevskiy	cmpdi	r11,0;						\
45c49f6353SAnton Blanchard	bne-	LABEL;						\
46c49f6353SAnton Blanchard1:
47c49f6353SAnton Blanchard
48c49f6353SAnton Blanchard#endif
49c49f6353SAnton Blanchard
50c49f6353SAnton Blanchard#else
51c49f6353SAnton Blanchard#define OPAL_BRANCH(LABEL)
52c49f6353SAnton Blanchard#endif
5314a43e69SBenjamin Herrenschmidt
54c3a08e93SOliver O'Halloran/*
55c3a08e93SOliver O'Halloran * DO_OPAL_CALL assumes:
56c3a08e93SOliver O'Halloran * r0  = opal call token
57c3a08e93SOliver O'Halloran * r12 = msr
58c3a08e93SOliver O'Halloran * LR has been saved
5914a43e69SBenjamin Herrenschmidt */
60c3a08e93SOliver O'Halloran#define DO_OPAL_CALL()			\
61ab9bad0eSBenjamin Herrenschmidt	mfcr	r11;			\
62ab9bad0eSBenjamin Herrenschmidt	stw	r11,8(r1);		\
63c49f6353SAnton Blanchard	li	r11,0;			\
64c49f6353SAnton Blanchard	ori	r11,r11,MSR_EE;		\
6514a43e69SBenjamin Herrenschmidt	std	r12,PACASAVEDMSR(r13);	\
66c49f6353SAnton Blanchard	andc	r12,r12,r11;		\
6714a43e69SBenjamin Herrenschmidt	mtmsrd	r12,1;			\
68c49f6353SAnton Blanchard	LOAD_REG_ADDR(r11,opal_return);	\
69c49f6353SAnton Blanchard	mtlr	r11;			\
70c49f6353SAnton Blanchard	li	r11,MSR_DR|MSR_IR|MSR_LE;\
71c49f6353SAnton Blanchard	andc	r12,r12,r11;		\
7214a43e69SBenjamin Herrenschmidt	mtspr	SPRN_HSRR1,r12;		\
7314a43e69SBenjamin Herrenschmidt	LOAD_REG_ADDR(r11,opal);	\
7414a43e69SBenjamin Herrenschmidt	ld	r12,8(r11);		\
7514a43e69SBenjamin Herrenschmidt	ld	r2,0(r11);		\
7614a43e69SBenjamin Herrenschmidt	mtspr	SPRN_HSRR0,r12;		\
7714a43e69SBenjamin Herrenschmidt	hrfid
7814a43e69SBenjamin Herrenschmidt
79c3a08e93SOliver O'Halloran#define OPAL_CALL(name, token)		\
80c3a08e93SOliver O'Halloran _GLOBAL_TOC(name);			\
81c3a08e93SOliver O'Halloran	mfmsr	r12;			\
82c3a08e93SOliver O'Halloran	mflr	r0;			\
83c3a08e93SOliver O'Halloran	andi.	r11,r12,MSR_IR|MSR_DR; 	\
84c3a08e93SOliver O'Halloran	std	r0,PPC_LR_STKOFF(r1);	\
85c3a08e93SOliver O'Halloran	li	r0,token;		\
86c3a08e93SOliver O'Halloran	beq	opal_real_call;         \
87c3a08e93SOliver O'Halloran	OPAL_BRANCH(opal_tracepoint_entry) \
88c3a08e93SOliver O'Halloran	DO_OPAL_CALL()
89c3a08e93SOliver O'Halloran
90c3a08e93SOliver O'Halloran
91ad0289e4SAnton Blanchardopal_return:
92be401b37SBenjamin Herrenschmidt	/*
93be401b37SBenjamin Herrenschmidt	 * Fixup endian on OPAL return... we should be able to simplify
94be401b37SBenjamin Herrenschmidt	 * this by instead converting the below trampoline to a set of
95be401b37SBenjamin Herrenschmidt	 * bytes (always BE) since MSR:LE will end up fixed up as a side
96be401b37SBenjamin Herrenschmidt	 * effect of the rfid.
97be401b37SBenjamin Herrenschmidt	 */
9863c9d8a4SNicholas Piggin	FIXUP_ENDIAN_HV
9914a43e69SBenjamin Herrenschmidt	ld	r2,PACATOC(r13);
100bbe30b3bSAnton Blanchard	lwz	r4,8(r1);
10169c592edSBenjamin Herrenschmidt	ld	r5,PPC_LR_STKOFF(r1);
10214a43e69SBenjamin Herrenschmidt	ld	r6,PACASAVEDMSR(r13);
10314a43e69SBenjamin Herrenschmidt	mtcr	r4;
104c07e1b8aSNicholas Piggin	mtspr	SPRN_HSRR0,r5;
105c07e1b8aSNicholas Piggin	mtspr	SPRN_HSRR1,r6;
106c07e1b8aSNicholas Piggin	hrfid
10714a43e69SBenjamin Herrenschmidt
108ab9bad0eSBenjamin Herrenschmidtopal_real_call:
109ab9bad0eSBenjamin Herrenschmidt	mfcr	r11
110ab9bad0eSBenjamin Herrenschmidt	stw	r11,8(r1)
111ab9bad0eSBenjamin Herrenschmidt	/* Set opal return address */
112ab9bad0eSBenjamin Herrenschmidt	LOAD_REG_ADDR(r11, opal_return_realmode)
113ab9bad0eSBenjamin Herrenschmidt	mtlr	r11
114ab9bad0eSBenjamin Herrenschmidt	li	r11,MSR_LE
115ab9bad0eSBenjamin Herrenschmidt	andc	r12,r12,r11
116ab9bad0eSBenjamin Herrenschmidt	mtspr	SPRN_HSRR1,r12
117ab9bad0eSBenjamin Herrenschmidt	LOAD_REG_ADDR(r11,opal)
118ab9bad0eSBenjamin Herrenschmidt	ld	r12,8(r11)
119ab9bad0eSBenjamin Herrenschmidt	ld	r2,0(r11)
120ab9bad0eSBenjamin Herrenschmidt	mtspr	SPRN_HSRR0,r12
121ab9bad0eSBenjamin Herrenschmidt	hrfid
122ab9bad0eSBenjamin Herrenschmidt
123ab9bad0eSBenjamin Herrenschmidtopal_return_realmode:
12463c9d8a4SNicholas Piggin	FIXUP_ENDIAN_HV
125ab9bad0eSBenjamin Herrenschmidt	ld	r2,PACATOC(r13);
126ab9bad0eSBenjamin Herrenschmidt	lwz	r11,8(r1);
127ab9bad0eSBenjamin Herrenschmidt	ld	r12,PPC_LR_STKOFF(r1)
128ab9bad0eSBenjamin Herrenschmidt	mtcr	r11;
129ab9bad0eSBenjamin Herrenschmidt	mtlr	r12
130ab9bad0eSBenjamin Herrenschmidt	blr
131ab9bad0eSBenjamin Herrenschmidt
132c49f6353SAnton Blanchard#ifdef CONFIG_TRACEPOINTS
133c49f6353SAnton Blanchardopal_tracepoint_entry:
134c49f6353SAnton Blanchard	stdu	r1,-STACKFRAMESIZE(r1)
135c49f6353SAnton Blanchard	std	r0,STK_REG(R23)(r1)
136c49f6353SAnton Blanchard	std	r3,STK_REG(R24)(r1)
137c49f6353SAnton Blanchard	std	r4,STK_REG(R25)(r1)
138c49f6353SAnton Blanchard	std	r5,STK_REG(R26)(r1)
139c49f6353SAnton Blanchard	std	r6,STK_REG(R27)(r1)
140c49f6353SAnton Blanchard	std	r7,STK_REG(R28)(r1)
141c49f6353SAnton Blanchard	std	r8,STK_REG(R29)(r1)
142c49f6353SAnton Blanchard	std	r9,STK_REG(R30)(r1)
143c49f6353SAnton Blanchard	std	r10,STK_REG(R31)(r1)
144c49f6353SAnton Blanchard	mr	r3,r0
145c49f6353SAnton Blanchard	addi	r4,r1,STK_REG(R24)
146c49f6353SAnton Blanchard	bl	__trace_opal_entry
147c49f6353SAnton Blanchard	ld	r0,STK_REG(R23)(r1)
148c49f6353SAnton Blanchard	ld	r3,STK_REG(R24)(r1)
149c49f6353SAnton Blanchard	ld	r4,STK_REG(R25)(r1)
150c49f6353SAnton Blanchard	ld	r5,STK_REG(R26)(r1)
151c49f6353SAnton Blanchard	ld	r6,STK_REG(R27)(r1)
152c49f6353SAnton Blanchard	ld	r7,STK_REG(R28)(r1)
153c49f6353SAnton Blanchard	ld	r8,STK_REG(R29)(r1)
154c49f6353SAnton Blanchard	ld	r9,STK_REG(R30)(r1)
155c49f6353SAnton Blanchard	ld	r10,STK_REG(R31)(r1)
156c3a08e93SOliver O'Halloran
157c3a08e93SOliver O'Halloran	/* setup LR so we return via tracepoint_return */
158c49f6353SAnton Blanchard	LOAD_REG_ADDR(r11,opal_tracepoint_return)
159c49f6353SAnton Blanchard	std	r11,16(r1)
160c3a08e93SOliver O'Halloran
161c49f6353SAnton Blanchard	mfmsr	r12
162c3a08e93SOliver O'Halloran	DO_OPAL_CALL()
163c49f6353SAnton Blanchard
164c49f6353SAnton Blanchardopal_tracepoint_return:
165c49f6353SAnton Blanchard	std	r3,STK_REG(R31)(r1)
166c49f6353SAnton Blanchard	mr	r4,r3
167a7e0fb6cSMichael Ellerman	ld	r3,STK_REG(R23)(r1)
168c49f6353SAnton Blanchard	bl	__trace_opal_exit
169c49f6353SAnton Blanchard	ld	r3,STK_REG(R31)(r1)
170c49f6353SAnton Blanchard	addi	r1,r1,STACKFRAMESIZE
171c49f6353SAnton Blanchard	ld	r0,16(r1)
172c49f6353SAnton Blanchard	mtlr	r0
173c49f6353SAnton Blanchard	blr
174c49f6353SAnton Blanchard#endif
175c49f6353SAnton Blanchard
17669c592edSBenjamin Herrenschmidt
177e28b05e7SJoel StanleyOPAL_CALL(opal_invalid_call,			OPAL_INVALID_CALL);
17814a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_console_write,			OPAL_CONSOLE_WRITE);
17914a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_console_read,			OPAL_CONSOLE_READ);
18014a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_console_write_buffer_space,	OPAL_CONSOLE_WRITE_BUFFER_SPACE);
18114a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_rtc_read,			OPAL_RTC_READ);
18214a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_rtc_write,			OPAL_RTC_WRITE);
18314a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_cec_power_down,			OPAL_CEC_POWER_DOWN);
18414a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_cec_reboot,			OPAL_CEC_REBOOT);
185e784b649SMahesh SalgaonkarOPAL_CALL(opal_cec_reboot2,			OPAL_CEC_REBOOT2);
18614a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_read_nvram,			OPAL_READ_NVRAM);
18714a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_write_nvram,			OPAL_WRITE_NVRAM);
18814a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_handle_interrupt,		OPAL_HANDLE_INTERRUPT);
18914a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_poll_events,			OPAL_POLL_EVENTS);
19014a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_set_hub_tce_memory,		OPAL_PCI_SET_HUB_TCE_MEMORY);
19114a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_set_phb_tce_memory,		OPAL_PCI_SET_PHB_TCE_MEMORY);
19214a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_config_read_byte,		OPAL_PCI_CONFIG_READ_BYTE);
19314a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_config_read_half_word,	OPAL_PCI_CONFIG_READ_HALF_WORD);
19414a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_config_read_word,		OPAL_PCI_CONFIG_READ_WORD);
19514a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_config_write_byte,		OPAL_PCI_CONFIG_WRITE_BYTE);
19614a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_config_write_half_word,	OPAL_PCI_CONFIG_WRITE_HALF_WORD);
19714a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_config_write_word,		OPAL_PCI_CONFIG_WRITE_WORD);
19814a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_set_xive,			OPAL_SET_XIVE);
19914a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_get_xive,			OPAL_GET_XIVE);
20014a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_register_exception_handler,	OPAL_REGISTER_OPAL_EXCEPTION_HANDLER);
20114a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_eeh_freeze_status,		OPAL_PCI_EEH_FREEZE_STATUS);
20214a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_eeh_freeze_clear,		OPAL_PCI_EEH_FREEZE_CLEAR);
2035ca27efbSGavin ShanOPAL_CALL(opal_pci_eeh_freeze_set,		OPAL_PCI_EEH_FREEZE_SET);
2045b642340SGavin ShanOPAL_CALL(opal_pci_err_inject,			OPAL_PCI_ERR_INJECT);
20514a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_shpc,			OPAL_PCI_SHPC);
20614a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_phb_mmio_enable,		OPAL_PCI_PHB_MMIO_ENABLE);
20714a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_set_phb_mem_window,		OPAL_PCI_SET_PHB_MEM_WINDOW);
20814a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_map_pe_mmio_window,		OPAL_PCI_MAP_PE_MMIO_WINDOW);
20914a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_set_phb_table_memory,	OPAL_PCI_SET_PHB_TABLE_MEMORY);
21014a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_set_pe,			OPAL_PCI_SET_PE);
21114a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_set_peltv,			OPAL_PCI_SET_PELTV);
21214a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_set_mve,			OPAL_PCI_SET_MVE);
21314a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_set_mve_enable,		OPAL_PCI_SET_MVE_ENABLE);
21414a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_get_xive_reissue,		OPAL_PCI_GET_XIVE_REISSUE);
21514a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_set_xive_reissue,		OPAL_PCI_SET_XIVE_REISSUE);
21614a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_set_xive_pe,			OPAL_PCI_SET_XIVE_PE);
21714a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_get_xive_source,			OPAL_GET_XIVE_SOURCE);
21814a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_get_msi_32,			OPAL_GET_MSI_32);
21914a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_get_msi_64,			OPAL_GET_MSI_64);
22014a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_start_cpu,			OPAL_START_CPU);
22114a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_query_cpu_status,		OPAL_QUERY_CPU_STATUS);
22214a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_write_oppanel,			OPAL_WRITE_OPPANEL);
22314a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_map_pe_dma_window,		OPAL_PCI_MAP_PE_DMA_WINDOW);
22414a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_map_pe_dma_window_real,	OPAL_PCI_MAP_PE_DMA_WINDOW_REAL);
22514a43e69SBenjamin HerrenschmidtOPAL_CALL(opal_pci_reset,			OPAL_PCI_RESET);
226f11fe552SBenjamin HerrenschmidtOPAL_CALL(opal_pci_get_hub_diag_data,		OPAL_PCI_GET_HUB_DIAG_DATA);
227f11fe552SBenjamin HerrenschmidtOPAL_CALL(opal_pci_get_phb_diag_data,		OPAL_PCI_GET_PHB_DIAG_DATA);
228f11fe552SBenjamin HerrenschmidtOPAL_CALL(opal_pci_fence_phb,			OPAL_PCI_FENCE_PHB);
229f11fe552SBenjamin HerrenschmidtOPAL_CALL(opal_pci_reinit,			OPAL_PCI_REINIT);
230f11fe552SBenjamin HerrenschmidtOPAL_CALL(opal_pci_mask_pe_error,		OPAL_PCI_MASK_PE_ERROR);
231f11fe552SBenjamin HerrenschmidtOPAL_CALL(opal_set_slot_led_status,		OPAL_SET_SLOT_LED_STATUS);
232f11fe552SBenjamin HerrenschmidtOPAL_CALL(opal_get_epow_status,			OPAL_GET_EPOW_STATUS);
2333b476aadSVipin K ParasharOPAL_CALL(opal_get_dpo_status,			OPAL_GET_DPO_STATUS);
234f11fe552SBenjamin HerrenschmidtOPAL_CALL(opal_set_system_attention_led,	OPAL_SET_SYSTEM_ATTENTION_LED);
23523773230SGavin ShanOPAL_CALL(opal_pci_next_error,			OPAL_PCI_NEXT_ERROR);
23623773230SGavin ShanOPAL_CALL(opal_pci_poll,			OPAL_PCI_POLL);
237137436c9SGavin ShanOPAL_CALL(opal_pci_msi_eoi,			OPAL_PCI_MSI_EOI);
23823773230SGavin ShanOPAL_CALL(opal_pci_get_phb_diag_data2,		OPAL_PCI_GET_PHB_DIAG_DATA2);
239cc0efb57SBenjamin HerrenschmidtOPAL_CALL(opal_xscom_read,			OPAL_XSCOM_READ);
240cc0efb57SBenjamin HerrenschmidtOPAL_CALL(opal_xscom_write,			OPAL_XSCOM_WRITE);
241cc0efb57SBenjamin HerrenschmidtOPAL_CALL(opal_lpc_read,			OPAL_LPC_READ);
242cc0efb57SBenjamin HerrenschmidtOPAL_CALL(opal_lpc_write,			OPAL_LPC_WRITE);
24313906db6SBenjamin HerrenschmidtOPAL_CALL(opal_return_cpu,			OPAL_RETURN_CPU);
2444926616cSBenjamin HerrenschmidtOPAL_CALL(opal_reinit_cpus,			OPAL_REINIT_CPUS);
245774fea1aSStewart SmithOPAL_CALL(opal_read_elog,			OPAL_ELOG_READ);
246774fea1aSStewart SmithOPAL_CALL(opal_send_ack_elog,			OPAL_ELOG_ACK);
247774fea1aSStewart SmithOPAL_CALL(opal_get_elog_size,			OPAL_ELOG_SIZE);
248774fea1aSStewart SmithOPAL_CALL(opal_resend_pending_logs,		OPAL_ELOG_RESEND);
249774fea1aSStewart SmithOPAL_CALL(opal_write_elog,			OPAL_ELOG_WRITE);
25050bd6153SVasant HegdeOPAL_CALL(opal_validate_flash,			OPAL_FLASH_VALIDATE);
25150bd6153SVasant HegdeOPAL_CALL(opal_manage_flash,			OPAL_FLASH_MANAGE);
25250bd6153SVasant HegdeOPAL_CALL(opal_update_flash,			OPAL_FLASH_UPDATE);
25397eb001fSVaidyanathan SrinivasanOPAL_CALL(opal_resync_timebase,			OPAL_RESYNC_TIMEBASE);
254bffe6bdaSMichael NeulingOPAL_CALL(opal_check_token,			OPAL_CHECK_TOKEN);
255c7e64b9cSStewart SmithOPAL_CALL(opal_dump_init,			OPAL_DUMP_INIT);
256c7e64b9cSStewart SmithOPAL_CALL(opal_dump_info,			OPAL_DUMP_INFO);
257c7e64b9cSStewart SmithOPAL_CALL(opal_dump_info2,			OPAL_DUMP_INFO2);
258c7e64b9cSStewart SmithOPAL_CALL(opal_dump_read,			OPAL_DUMP_READ);
259c7e64b9cSStewart SmithOPAL_CALL(opal_dump_ack,			OPAL_DUMP_ACK);
26024366360SMahesh SalgaonkarOPAL_CALL(opal_get_msg,				OPAL_GET_MSG);
26143a1dd9bSSuraj Jitindar SinghOPAL_CALL(opal_write_oppanel_async,		OPAL_WRITE_OPPANEL_ASYNC);
26224366360SMahesh SalgaonkarOPAL_CALL(opal_check_completion,		OPAL_CHECK_ASYNC_COMPLETION);
263c7e64b9cSStewart SmithOPAL_CALL(opal_dump_resend_notification,	OPAL_DUMP_RESEND);
264f7d98d18SVasant HegdeOPAL_CALL(opal_sync_host_reboot,		OPAL_SYNC_HOST_REBOOT);
2657224adbbSNeelesh GuptaOPAL_CALL(opal_sensor_read,			OPAL_SENSOR_READ);
2664029cd66SNeelesh GuptaOPAL_CALL(opal_get_param,			OPAL_GET_PARAM);
2674029cd66SNeelesh GuptaOPAL_CALL(opal_set_param,			OPAL_SET_PARAM);
2680ef95b41SMahesh SalgaonkarOPAL_CALL(opal_handle_hmi,			OPAL_HANDLE_HMI);
2695703d2f4SShreyas B. PrabhuOPAL_CALL(opal_config_cpu_idle_state,		OPAL_CONFIG_CPU_IDLE_STATE);
27077b54e9fSShreyas B. PrabhuOPAL_CALL(opal_slw_set_reg,			OPAL_SLW_SET_REG);
271b09c2ec4SVasant HegdeOPAL_CALL(opal_register_dump_region,		OPAL_REGISTER_DUMP_REGION);
272b09c2ec4SVasant HegdeOPAL_CALL(opal_unregister_dump_region,		OPAL_UNREGISTER_DUMP_REGION);
273d7cf83fcSMichael EllermanOPAL_CALL(opal_pci_set_phb_cxl_mode,		OPAL_PCI_SET_PHB_CAPI_MODE);
27416b1d26eSNeelesh GuptaOPAL_CALL(opal_tpo_write,			OPAL_WRITE_TPO);
27516b1d26eSNeelesh GuptaOPAL_CALL(opal_tpo_read,			OPAL_READ_TPO);
276608b286dSJeremy KerrOPAL_CALL(opal_ipmi_send,			OPAL_IPMI_SEND);
277608b286dSJeremy KerrOPAL_CALL(opal_ipmi_recv,			OPAL_IPMI_RECV);
27847083450SNeelesh GuptaOPAL_CALL(opal_i2c_request,			OPAL_I2C_REQUEST);
279ed59190eSCyril BurOPAL_CALL(opal_flash_read,			OPAL_FLASH_READ);
280ed59190eSCyril BurOPAL_CALL(opal_flash_write,			OPAL_FLASH_WRITE);
281ed59190eSCyril BurOPAL_CALL(opal_flash_erase,			OPAL_FLASH_ERASE);
2820d7cd855SJeremy KerrOPAL_CALL(opal_prd_msg,				OPAL_PRD_MSG);
2838a8d9181SAnshuman KhandualOPAL_CALL(opal_leds_get_ind,			OPAL_LEDS_GET_INDICATOR);
2848a8d9181SAnshuman KhandualOPAL_CALL(opal_leds_set_ind,			OPAL_LEDS_SET_INDICATOR);
285affddff6SRussell CurreyOPAL_CALL(opal_console_flush,			OPAL_CONSOLE_FLUSH);
286ea0d856cSGavin ShanOPAL_CALL(opal_get_device_tree,			OPAL_GET_DEVICE_TREE);
287ea0d856cSGavin ShanOPAL_CALL(opal_pci_get_presence_state,		OPAL_PCI_GET_PRESENCE_STATE);
288ea0d856cSGavin ShanOPAL_CALL(opal_pci_get_power_state,		OPAL_PCI_GET_POWER_STATE);
289ea0d856cSGavin ShanOPAL_CALL(opal_pci_set_power_state,		OPAL_PCI_SET_POWER_STATE);
2909fedd3f8SBenjamin HerrenschmidtOPAL_CALL(opal_int_get_xirr,			OPAL_INT_GET_XIRR);
2919fedd3f8SBenjamin HerrenschmidtOPAL_CALL(opal_int_set_cppr,			OPAL_INT_SET_CPPR);
2929fedd3f8SBenjamin HerrenschmidtOPAL_CALL(opal_int_eoi,				OPAL_INT_EOI);
2939fedd3f8SBenjamin HerrenschmidtOPAL_CALL(opal_int_set_mfrr,			OPAL_INT_SET_MFRR);
29469c592edSBenjamin HerrenschmidtOPAL_CALL(opal_pci_tce_kill,			OPAL_PCI_TCE_KILL);
2951d0761d2SAlistair PoppleOPAL_CALL(opal_nmmu_set_ptcr,			OPAL_NMMU_SET_PTCR);
296eeea1a43SBenjamin HerrenschmidtOPAL_CALL(opal_xive_reset,			OPAL_XIVE_RESET);
297eeea1a43SBenjamin HerrenschmidtOPAL_CALL(opal_xive_get_irq_info,		OPAL_XIVE_GET_IRQ_INFO);
298eeea1a43SBenjamin HerrenschmidtOPAL_CALL(opal_xive_get_irq_config,		OPAL_XIVE_GET_IRQ_CONFIG);
299eeea1a43SBenjamin HerrenschmidtOPAL_CALL(opal_xive_set_irq_config,		OPAL_XIVE_SET_IRQ_CONFIG);
300eeea1a43SBenjamin HerrenschmidtOPAL_CALL(opal_xive_get_queue_info,		OPAL_XIVE_GET_QUEUE_INFO);
301eeea1a43SBenjamin HerrenschmidtOPAL_CALL(opal_xive_set_queue_info,		OPAL_XIVE_SET_QUEUE_INFO);
302eeea1a43SBenjamin HerrenschmidtOPAL_CALL(opal_xive_donate_page,		OPAL_XIVE_DONATE_PAGE);
303eeea1a43SBenjamin HerrenschmidtOPAL_CALL(opal_xive_alloc_vp_block,		OPAL_XIVE_ALLOCATE_VP_BLOCK);
304eeea1a43SBenjamin HerrenschmidtOPAL_CALL(opal_xive_free_vp_block,		OPAL_XIVE_FREE_VP_BLOCK);
305eeea1a43SBenjamin HerrenschmidtOPAL_CALL(opal_xive_allocate_irq,		OPAL_XIVE_ALLOCATE_IRQ);
306eeea1a43SBenjamin HerrenschmidtOPAL_CALL(opal_xive_free_irq,			OPAL_XIVE_FREE_IRQ);
307eeea1a43SBenjamin HerrenschmidtOPAL_CALL(opal_xive_get_vp_info,		OPAL_XIVE_GET_VP_INFO);
308eeea1a43SBenjamin HerrenschmidtOPAL_CALL(opal_xive_set_vp_info,		OPAL_XIVE_SET_VP_INFO);
309eeea1a43SBenjamin HerrenschmidtOPAL_CALL(opal_xive_sync,			OPAL_XIVE_SYNC);
310eeea1a43SBenjamin HerrenschmidtOPAL_CALL(opal_xive_dump,			OPAL_XIVE_DUMP);
311e36d0a2eSNicholas PigginOPAL_CALL(opal_signal_system_reset,		OPAL_SIGNAL_SYSTEM_RESET);
3121ab66d1fSAlistair PoppleOPAL_CALL(opal_npu_init_context,		OPAL_NPU_INIT_CONTEXT);
3131ab66d1fSAlistair PoppleOPAL_CALL(opal_npu_destroy_context,		OPAL_NPU_DESTROY_CONTEXT);
3141ab66d1fSAlistair PoppleOPAL_CALL(opal_npu_map_lpar,			OPAL_NPU_MAP_LPAR);
31528a5db00SMadhavan SrinivasanOPAL_CALL(opal_imc_counters_init,		OPAL_IMC_COUNTERS_INIT);
31628a5db00SMadhavan SrinivasanOPAL_CALL(opal_imc_counters_start,		OPAL_IMC_COUNTERS_START);
31728a5db00SMadhavan SrinivasanOPAL_CALL(opal_imc_counters_stop,		OPAL_IMC_COUNTERS_STOP);
31825529100SFrederic BarratOPAL_CALL(opal_pci_set_p2p,			OPAL_PCI_SET_P2P);
319cb8b340dSShilpasri G BhatOPAL_CALL(opal_get_powercap,			OPAL_GET_POWERCAP);
320cb8b340dSShilpasri G BhatOPAL_CALL(opal_set_powercap,			OPAL_SET_POWERCAP);
3218e84b2d1SShilpasri G BhatOPAL_CALL(opal_get_power_shift_ratio,		OPAL_GET_POWER_SHIFT_RATIO);
3228e84b2d1SShilpasri G BhatOPAL_CALL(opal_set_power_shift_ratio,		OPAL_SET_POWER_SHIFT_RATIO);
323bf957155SShilpasri G BhatOPAL_CALL(opal_sensor_group_clear,		OPAL_SENSOR_GROUP_CLEAR);
324ee03b9b4SNicholas PigginOPAL_CALL(opal_quiesce,				OPAL_QUIESCE);
32574d656d2SFrederic BarratOPAL_CALL(opal_npu_spa_setup,			OPAL_NPU_SPA_SETUP);
32674d656d2SFrederic BarratOPAL_CALL(opal_npu_spa_clear_cache,		OPAL_NPU_SPA_CLEAR_CACHE);
32774d656d2SFrederic BarratOPAL_CALL(opal_npu_tl_set,			OPAL_NPU_TL_SET);
328d6a90bb8SPhilippe BergheaudOPAL_CALL(opal_pci_get_pbcq_tunnel_bar,		OPAL_PCI_GET_PBCQ_TUNNEL_BAR);
329d6a90bb8SPhilippe BergheaudOPAL_CALL(opal_pci_set_pbcq_tunnel_bar,		OPAL_PCI_SET_PBCQ_TUNNEL_BAR);
3305cdcb01eSShilpasri G BhatOPAL_CALL(opal_sensor_read_u64,			OPAL_SENSOR_READ_U64);
331