diff options
Diffstat (limited to 'arch/powerpc/platforms/powernv/opal-wrappers.S')
-rw-r--r-- | arch/powerpc/platforms/powernv/opal-wrappers.S | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/opal-wrappers.S b/arch/powerpc/platforms/powernv/opal-wrappers.S index 0a299be588af..54eca8b3b288 100644 --- a/arch/powerpc/platforms/powernv/opal-wrappers.S +++ b/arch/powerpc/platforms/powernv/opal-wrappers.S | |||
@@ -158,6 +158,43 @@ opal_tracepoint_return: | |||
158 | blr | 158 | blr |
159 | #endif | 159 | #endif |
160 | 160 | ||
161 | /* | ||
162 | * Make opal call in realmode. This is a generic function to be called | ||
163 | * from realmode. It handles endianness. | ||
164 | * | ||
165 | * r13 - paca pointer | ||
166 | * r1 - stack pointer | ||
167 | * r0 - opal token | ||
168 | */ | ||
169 | _GLOBAL(opal_call_realmode) | ||
170 | mflr r12 | ||
171 | std r12,PPC_LR_STKOFF(r1) | ||
172 | ld r2,PACATOC(r13) | ||
173 | /* Set opal return address */ | ||
174 | LOAD_REG_ADDR(r12,return_from_opal_call) | ||
175 | mtlr r12 | ||
176 | |||
177 | mfmsr r12 | ||
178 | #ifdef __LITTLE_ENDIAN__ | ||
179 | /* Handle endian-ness */ | ||
180 | li r11,MSR_LE | ||
181 | andc r12,r12,r11 | ||
182 | #endif | ||
183 | mtspr SPRN_HSRR1,r12 | ||
184 | LOAD_REG_ADDR(r11,opal) | ||
185 | ld r12,8(r11) | ||
186 | ld r2,0(r11) | ||
187 | mtspr SPRN_HSRR0,r12 | ||
188 | hrfid | ||
189 | |||
190 | return_from_opal_call: | ||
191 | #ifdef __LITTLE_ENDIAN__ | ||
192 | FIXUP_ENDIAN | ||
193 | #endif | ||
194 | ld r12,PPC_LR_STKOFF(r1) | ||
195 | mtlr r12 | ||
196 | blr | ||
197 | |||
161 | OPAL_CALL(opal_invalid_call, OPAL_INVALID_CALL); | 198 | OPAL_CALL(opal_invalid_call, OPAL_INVALID_CALL); |
162 | OPAL_CALL(opal_console_write, OPAL_CONSOLE_WRITE); | 199 | OPAL_CALL(opal_console_write, OPAL_CONSOLE_WRITE); |
163 | OPAL_CALL(opal_console_read, OPAL_CONSOLE_READ); | 200 | OPAL_CALL(opal_console_read, OPAL_CONSOLE_READ); |
@@ -247,6 +284,7 @@ OPAL_CALL(opal_sensor_read, OPAL_SENSOR_READ); | |||
247 | OPAL_CALL(opal_get_param, OPAL_GET_PARAM); | 284 | OPAL_CALL(opal_get_param, OPAL_GET_PARAM); |
248 | OPAL_CALL(opal_set_param, OPAL_SET_PARAM); | 285 | OPAL_CALL(opal_set_param, OPAL_SET_PARAM); |
249 | OPAL_CALL(opal_handle_hmi, OPAL_HANDLE_HMI); | 286 | OPAL_CALL(opal_handle_hmi, OPAL_HANDLE_HMI); |
287 | OPAL_CALL(opal_slw_set_reg, OPAL_SLW_SET_REG); | ||
250 | OPAL_CALL(opal_register_dump_region, OPAL_REGISTER_DUMP_REGION); | 288 | OPAL_CALL(opal_register_dump_region, OPAL_REGISTER_DUMP_REGION); |
251 | OPAL_CALL(opal_unregister_dump_region, OPAL_UNREGISTER_DUMP_REGION); | 289 | OPAL_CALL(opal_unregister_dump_region, OPAL_UNREGISTER_DUMP_REGION); |
252 | OPAL_CALL(opal_pci_set_phb_cxl_mode, OPAL_PCI_SET_PHB_CXL_MODE); | 290 | OPAL_CALL(opal_pci_set_phb_cxl_mode, OPAL_PCI_SET_PHB_CXL_MODE); |
@@ -254,3 +292,4 @@ OPAL_CALL(opal_tpo_write, OPAL_WRITE_TPO); | |||
254 | OPAL_CALL(opal_tpo_read, OPAL_READ_TPO); | 292 | OPAL_CALL(opal_tpo_read, OPAL_READ_TPO); |
255 | OPAL_CALL(opal_ipmi_send, OPAL_IPMI_SEND); | 293 | OPAL_CALL(opal_ipmi_send, OPAL_IPMI_SEND); |
256 | OPAL_CALL(opal_ipmi_recv, OPAL_IPMI_RECV); | 294 | OPAL_CALL(opal_ipmi_recv, OPAL_IPMI_RECV); |
295 | OPAL_CALL(opal_i2c_request, OPAL_I2C_REQUEST); | ||