2 * QEMU PowerPC pSeries Logical Partition (aka sPAPR) hardware System Emulator
4 * Hypercall based emulated RTAS
6 * Copyright (c) 2010-2011 David Gibson, IBM Corporation.
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28 #include "sysemu/sysemu.h"
29 #include "sysemu/char.h"
31 #include "sysemu/device_tree.h"
32 #include "sysemu/cpus.h"
34 #include "hw/ppc/spapr.h"
35 #include "hw/ppc/spapr_vio.h"
36 #include "qapi-event.h"
37 #include "hw/boards.h"
40 #include "hw/ppc/spapr_drc.h"
42 /* #define DEBUG_SPAPR */
45 #define DPRINTF(fmt, ...) \
46 do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
48 #define DPRINTF(fmt, ...) \
52 static sPAPRConfigureConnectorState
*spapr_ccs_find(sPAPRMachineState
*spapr
,
55 sPAPRConfigureConnectorState
*ccs
= NULL
;
57 QTAILQ_FOREACH(ccs
, &spapr
->ccs_list
, next
) {
58 if (ccs
->drc_index
== drc_index
) {
66 static void spapr_ccs_add(sPAPRMachineState
*spapr
,
67 sPAPRConfigureConnectorState
*ccs
)
69 g_assert(!spapr_ccs_find(spapr
, ccs
->drc_index
));
70 QTAILQ_INSERT_HEAD(&spapr
->ccs_list
, ccs
, next
);
73 static void spapr_ccs_remove(sPAPRMachineState
*spapr
,
74 sPAPRConfigureConnectorState
*ccs
)
76 QTAILQ_REMOVE(&spapr
->ccs_list
, ccs
, next
);
80 void spapr_ccs_reset_hook(void *opaque
)
82 sPAPRMachineState
*spapr
= opaque
;
83 sPAPRConfigureConnectorState
*ccs
, *ccs_tmp
;
85 QTAILQ_FOREACH_SAFE(ccs
, &spapr
->ccs_list
, next
, ccs_tmp
) {
86 spapr_ccs_remove(spapr
, ccs
);
90 static void rtas_display_character(PowerPCCPU
*cpu
, sPAPRMachineState
*spapr
,
91 uint32_t token
, uint32_t nargs
,
93 uint32_t nret
, target_ulong rets
)
95 uint8_t c
= rtas_ld(args
, 0);
96 VIOsPAPRDevice
*sdev
= vty_lookup(spapr
, 0);
99 rtas_st(rets
, 0, RTAS_OUT_HW_ERROR
);
101 vty_putchars(sdev
, &c
, sizeof(c
));
102 rtas_st(rets
, 0, RTAS_OUT_SUCCESS
);
106 static void rtas_power_off(PowerPCCPU
*cpu
, sPAPRMachineState
*spapr
,
107 uint32_t token
, uint32_t nargs
, target_ulong args
,
108 uint32_t nret
, target_ulong rets
)
110 if (nargs
!= 2 || nret
!= 1) {
111 rtas_st(rets
, 0, RTAS_OUT_PARAM_ERROR
);
114 qemu_system_shutdown_request();
115 rtas_st(rets
, 0, RTAS_OUT_SUCCESS
);
118 static void rtas_system_reboot(PowerPCCPU
*cpu
, sPAPRMachineState
*spapr
,
119 uint32_t token
, uint32_t nargs
,
121 uint32_t nret
, target_ulong rets
)
123 if (nargs
!= 0 || nret
!= 1) {
124 rtas_st(rets
, 0, RTAS_OUT_PARAM_ERROR
);
127 qemu_system_reset_request();
128 rtas_st(rets
, 0, RTAS_OUT_SUCCESS
);
131 static void rtas_query_cpu_stopped_state(PowerPCCPU
*cpu_
,
132 sPAPRMachineState
*spapr
,
133 uint32_t token
, uint32_t nargs
,
135 uint32_t nret
, target_ulong rets
)
140 if (nargs
!= 1 || nret
!= 2) {
141 rtas_st(rets
, 0, RTAS_OUT_PARAM_ERROR
);
145 id
= rtas_ld(args
, 0);
146 cpu
= ppc_get_vcpu_by_dt_id(id
);
148 if (CPU(cpu
)->halted
) {
154 rtas_st(rets
, 0, RTAS_OUT_SUCCESS
);
158 /* Didn't find a matching cpu */
159 rtas_st(rets
, 0, RTAS_OUT_PARAM_ERROR
);
162 static void rtas_start_cpu(PowerPCCPU
*cpu_
, sPAPRMachineState
*spapr
,
163 uint32_t token
, uint32_t nargs
,
165 uint32_t nret
, target_ulong rets
)
167 target_ulong id
, start
, r3
;
170 if (nargs
!= 3 || nret
!= 1) {
171 rtas_st(rets
, 0, RTAS_OUT_PARAM_ERROR
);
175 id
= rtas_ld(args
, 0);
176 start
= rtas_ld(args
, 1);
177 r3
= rtas_ld(args
, 2);
179 cpu
= ppc_get_vcpu_by_dt_id(id
);
181 CPUState
*cs
= CPU(cpu
);
182 CPUPPCState
*env
= &cpu
->env
;
185 rtas_st(rets
, 0, RTAS_OUT_HW_ERROR
);
189 /* This will make sure qemu state is up to date with kvm, and
190 * mark it dirty so our changes get flushed back before the
192 kvm_cpu_synchronize_state(cs
);
194 env
->msr
= (1ULL << MSR_SF
) | (1ULL << MSR_ME
);
201 rtas_st(rets
, 0, RTAS_OUT_SUCCESS
);
205 /* Didn't find a matching cpu */
206 rtas_st(rets
, 0, RTAS_OUT_PARAM_ERROR
);
209 static void rtas_stop_self(PowerPCCPU
*cpu
, sPAPRMachineState
*spapr
,
210 uint32_t token
, uint32_t nargs
,
212 uint32_t nret
, target_ulong rets
)
214 CPUState
*cs
= CPU(cpu
);
215 CPUPPCState
*env
= &cpu
->env
;
220 * While stopping a CPU, the guest calls H_CPPR which
221 * effectively disables interrupts on XICS level.
222 * However decrementer interrupts in TCG can still
223 * wake the CPU up so here we disable interrupts in MSR
225 * As rtas_start_cpu() resets the whole MSR anyway, there is
226 * no need to bother with specific bits, we just clear it.
231 static void rtas_ibm_get_system_parameter(PowerPCCPU
*cpu
,
232 sPAPRMachineState
*spapr
,
233 uint32_t token
, uint32_t nargs
,
235 uint32_t nret
, target_ulong rets
)
237 target_ulong parameter
= rtas_ld(args
, 0);
238 target_ulong buffer
= rtas_ld(args
, 1);
239 target_ulong length
= rtas_ld(args
, 2);
240 target_ulong ret
= RTAS_OUT_SUCCESS
;
243 case RTAS_SYSPARM_SPLPAR_CHARACTERISTICS
: {
244 char *param_val
= g_strdup_printf("MaxEntCap=%d,"
249 current_machine
->ram_size
/ M_BYTE
,
252 rtas_st_buffer(buffer
, length
, (uint8_t *)param_val
, strlen(param_val
));
256 case RTAS_SYSPARM_DIAGNOSTICS_RUN_MODE
: {
257 uint8_t param_val
= DIAGNOSTICS_RUN_MODE_DISABLED
;
259 rtas_st_buffer(buffer
, length
, ¶m_val
, sizeof(param_val
));
262 case RTAS_SYSPARM_UUID
:
263 rtas_st_buffer(buffer
, length
, qemu_uuid
, (qemu_uuid_set
? 16 : 0));
266 ret
= RTAS_OUT_NOT_SUPPORTED
;
269 rtas_st(rets
, 0, ret
);
272 static void rtas_ibm_set_system_parameter(PowerPCCPU
*cpu
,
273 sPAPRMachineState
*spapr
,
274 uint32_t token
, uint32_t nargs
,
276 uint32_t nret
, target_ulong rets
)
278 target_ulong parameter
= rtas_ld(args
, 0);
279 target_ulong ret
= RTAS_OUT_NOT_SUPPORTED
;
282 case RTAS_SYSPARM_SPLPAR_CHARACTERISTICS
:
283 case RTAS_SYSPARM_DIAGNOSTICS_RUN_MODE
:
284 case RTAS_SYSPARM_UUID
:
285 ret
= RTAS_OUT_NOT_AUTHORIZED
;
289 rtas_st(rets
, 0, ret
);
292 static void rtas_ibm_os_term(PowerPCCPU
*cpu
,
293 sPAPRMachineState
*spapr
,
294 uint32_t token
, uint32_t nargs
,
296 uint32_t nret
, target_ulong rets
)
298 target_ulong ret
= 0;
300 qapi_event_send_guest_panicked(GUEST_PANIC_ACTION_PAUSE
, &error_abort
);
302 rtas_st(rets
, 0, ret
);
305 static void rtas_set_power_level(PowerPCCPU
*cpu
, sPAPRMachineState
*spapr
,
306 uint32_t token
, uint32_t nargs
,
307 target_ulong args
, uint32_t nret
,
310 int32_t power_domain
;
312 if (nargs
!= 2 || nret
!= 2) {
313 rtas_st(rets
, 0, RTAS_OUT_PARAM_ERROR
);
317 /* we currently only use a single, "live insert" powerdomain for
318 * hotplugged/dlpar'd resources, so the power is always live/full (100)
320 power_domain
= rtas_ld(args
, 0);
321 if (power_domain
!= -1) {
322 rtas_st(rets
, 0, RTAS_OUT_NOT_SUPPORTED
);
326 rtas_st(rets
, 0, RTAS_OUT_SUCCESS
);
327 rtas_st(rets
, 1, 100);
330 static void rtas_get_power_level(PowerPCCPU
*cpu
, sPAPRMachineState
*spapr
,
331 uint32_t token
, uint32_t nargs
,
332 target_ulong args
, uint32_t nret
,
335 int32_t power_domain
;
337 if (nargs
!= 1 || nret
!= 2) {
338 rtas_st(rets
, 0, RTAS_OUT_PARAM_ERROR
);
342 /* we currently only use a single, "live insert" powerdomain for
343 * hotplugged/dlpar'd resources, so the power is always live/full (100)
345 power_domain
= rtas_ld(args
, 0);
346 if (power_domain
!= -1) {
347 rtas_st(rets
, 0, RTAS_OUT_NOT_SUPPORTED
);
351 rtas_st(rets
, 0, RTAS_OUT_SUCCESS
);
352 rtas_st(rets
, 1, 100);
355 static bool sensor_type_is_dr(uint32_t sensor_type
)
357 switch (sensor_type
) {
358 case RTAS_SENSOR_TYPE_ISOLATION_STATE
:
359 case RTAS_SENSOR_TYPE_DR
:
360 case RTAS_SENSOR_TYPE_ALLOCATION_STATE
:
367 static void rtas_set_indicator(PowerPCCPU
*cpu
, sPAPRMachineState
*spapr
,
368 uint32_t token
, uint32_t nargs
,
369 target_ulong args
, uint32_t nret
,
372 uint32_t sensor_type
;
373 uint32_t sensor_index
;
374 uint32_t sensor_state
;
375 uint32_t ret
= RTAS_OUT_SUCCESS
;
376 sPAPRDRConnector
*drc
;
377 sPAPRDRConnectorClass
*drck
;
379 if (nargs
!= 3 || nret
!= 1) {
380 ret
= RTAS_OUT_PARAM_ERROR
;
384 sensor_type
= rtas_ld(args
, 0);
385 sensor_index
= rtas_ld(args
, 1);
386 sensor_state
= rtas_ld(args
, 2);
388 if (!sensor_type_is_dr(sensor_type
)) {
389 goto out_unimplemented
;
392 /* if this is a DR sensor we can assume sensor_index == drc_index */
393 drc
= spapr_dr_connector_by_index(sensor_index
);
395 DPRINTF("rtas_set_indicator: invalid sensor/DRC index: %xh\n",
397 ret
= RTAS_OUT_PARAM_ERROR
;
400 drck
= SPAPR_DR_CONNECTOR_GET_CLASS(drc
);
402 switch (sensor_type
) {
403 case RTAS_SENSOR_TYPE_ISOLATION_STATE
:
404 /* if the guest is configuring a device attached to this
405 * DRC, we should reset the configuration state at this
406 * point since it may no longer be reliable (guest released
407 * device and needs to start over, or unplug occurred so
408 * the FDT is no longer valid)
410 if (sensor_state
== SPAPR_DR_ISOLATION_STATE_ISOLATED
) {
411 sPAPRConfigureConnectorState
*ccs
= spapr_ccs_find(spapr
,
414 spapr_ccs_remove(spapr
, ccs
);
417 ret
= drck
->set_isolation_state(drc
, sensor_state
);
419 case RTAS_SENSOR_TYPE_DR
:
420 ret
= drck
->set_indicator_state(drc
, sensor_state
);
422 case RTAS_SENSOR_TYPE_ALLOCATION_STATE
:
423 ret
= drck
->set_allocation_state(drc
, sensor_state
);
426 goto out_unimplemented
;
430 rtas_st(rets
, 0, ret
);
434 /* currently only DR-related sensors are implemented */
435 DPRINTF("rtas_set_indicator: sensor/indicator not implemented: %d\n",
437 rtas_st(rets
, 0, RTAS_OUT_NOT_SUPPORTED
);
440 static void rtas_get_sensor_state(PowerPCCPU
*cpu
, sPAPRMachineState
*spapr
,
441 uint32_t token
, uint32_t nargs
,
442 target_ulong args
, uint32_t nret
,
445 uint32_t sensor_type
;
446 uint32_t sensor_index
;
447 uint32_t sensor_state
= 0;
448 sPAPRDRConnector
*drc
;
449 sPAPRDRConnectorClass
*drck
;
450 uint32_t ret
= RTAS_OUT_SUCCESS
;
452 if (nargs
!= 2 || nret
!= 2) {
453 ret
= RTAS_OUT_PARAM_ERROR
;
457 sensor_type
= rtas_ld(args
, 0);
458 sensor_index
= rtas_ld(args
, 1);
460 if (sensor_type
!= RTAS_SENSOR_TYPE_ENTITY_SENSE
) {
461 /* currently only DR-related sensors are implemented */
462 DPRINTF("rtas_get_sensor_state: sensor/indicator not implemented: %d\n",
464 ret
= RTAS_OUT_NOT_SUPPORTED
;
468 drc
= spapr_dr_connector_by_index(sensor_index
);
470 DPRINTF("rtas_get_sensor_state: invalid sensor/DRC index: %xh\n",
472 ret
= RTAS_OUT_PARAM_ERROR
;
475 drck
= SPAPR_DR_CONNECTOR_GET_CLASS(drc
);
476 ret
= drck
->entity_sense(drc
, &sensor_state
);
479 rtas_st(rets
, 0, ret
);
480 rtas_st(rets
, 1, sensor_state
);
483 /* configure-connector work area offsets, int32_t units for field
484 * indexes, bytes for field offset/len values.
486 * as documented by PAPR+ v2.7, 13.5.3.5
488 #define CC_IDX_NODE_NAME_OFFSET 2
489 #define CC_IDX_PROP_NAME_OFFSET 2
490 #define CC_IDX_PROP_LEN 3
491 #define CC_IDX_PROP_DATA_OFFSET 4
492 #define CC_VAL_DATA_OFFSET ((CC_IDX_PROP_DATA_OFFSET + 1) * 4)
493 #define CC_WA_LEN 4096
495 static void rtas_ibm_configure_connector(PowerPCCPU
*cpu
,
496 sPAPRMachineState
*spapr
,
497 uint32_t token
, uint32_t nargs
,
498 target_ulong args
, uint32_t nret
,
504 sPAPRDRConnector
*drc
;
505 sPAPRDRConnectorClass
*drck
;
506 sPAPRConfigureConnectorState
*ccs
;
507 sPAPRDRCCResponse resp
= SPAPR_DR_CC_RESPONSE_CONTINUE
;
511 if (nargs
!= 2 || nret
!= 1) {
512 rtas_st(rets
, 0, RTAS_OUT_PARAM_ERROR
);
516 wa_addr
= ((uint64_t)rtas_ld(args
, 1) << 32) | rtas_ld(args
, 0);
518 drc_index
= rtas_ld(wa_addr
, 0);
519 drc
= spapr_dr_connector_by_index(drc_index
);
521 DPRINTF("rtas_ibm_configure_connector: invalid DRC index: %xh\n",
523 rc
= RTAS_OUT_PARAM_ERROR
;
527 drck
= SPAPR_DR_CONNECTOR_GET_CLASS(drc
);
528 fdt
= drck
->get_fdt(drc
, NULL
);
530 DPRINTF("rtas_ibm_configure_connector: Missing FDT for DRC index: %xh\n",
532 rc
= SPAPR_DR_CC_RESPONSE_NOT_CONFIGURABLE
;
536 ccs
= spapr_ccs_find(spapr
, drc_index
);
538 ccs
= g_new0(sPAPRConfigureConnectorState
, 1);
539 (void)drck
->get_fdt(drc
, &ccs
->fdt_offset
);
540 ccs
->drc_index
= drc_index
;
541 spapr_ccs_add(spapr
, ccs
);
547 const struct fdt_property
*prop
;
548 int fdt_offset_next
, prop_len
;
550 tag
= fdt_next_tag(fdt
, ccs
->fdt_offset
, &fdt_offset_next
);
555 name
= fdt_get_name(fdt
, ccs
->fdt_offset
, NULL
);
557 /* provide the name of the next OF node */
558 wa_offset
= CC_VAL_DATA_OFFSET
;
559 rtas_st(wa_addr
, CC_IDX_NODE_NAME_OFFSET
, wa_offset
);
560 rtas_st_buffer_direct(wa_addr
+ wa_offset
, CC_WA_LEN
- wa_offset
,
561 (uint8_t *)name
, strlen(name
) + 1);
562 resp
= SPAPR_DR_CC_RESPONSE_NEXT_CHILD
;
566 if (ccs
->fdt_depth
== 0) {
567 /* done sending the device tree, don't need to track
570 drck
->set_configured(drc
);
571 spapr_ccs_remove(spapr
, ccs
);
573 resp
= SPAPR_DR_CC_RESPONSE_SUCCESS
;
575 resp
= SPAPR_DR_CC_RESPONSE_PREV_PARENT
;
579 prop
= fdt_get_property_by_offset(fdt
, ccs
->fdt_offset
,
581 name
= fdt_string(fdt
, fdt32_to_cpu(prop
->nameoff
));
583 /* provide the name of the next OF property */
584 wa_offset
= CC_VAL_DATA_OFFSET
;
585 rtas_st(wa_addr
, CC_IDX_PROP_NAME_OFFSET
, wa_offset
);
586 rtas_st_buffer_direct(wa_addr
+ wa_offset
, CC_WA_LEN
- wa_offset
,
587 (uint8_t *)name
, strlen(name
) + 1);
589 /* provide the length and value of the OF property. data gets
590 * placed immediately after NULL terminator of the OF property's
593 wa_offset
+= strlen(name
) + 1,
594 rtas_st(wa_addr
, CC_IDX_PROP_LEN
, prop_len
);
595 rtas_st(wa_addr
, CC_IDX_PROP_DATA_OFFSET
, wa_offset
);
596 rtas_st_buffer_direct(wa_addr
+ wa_offset
, CC_WA_LEN
- wa_offset
,
597 (uint8_t *)((struct fdt_property
*)prop
)->data
,
599 resp
= SPAPR_DR_CC_RESPONSE_NEXT_PROPERTY
;
602 resp
= SPAPR_DR_CC_RESPONSE_ERROR
;
604 /* keep seeking for an actionable tag */
608 ccs
->fdt_offset
= fdt_offset_next
;
610 } while (resp
== SPAPR_DR_CC_RESPONSE_CONTINUE
);
614 rtas_st(rets
, 0, rc
);
617 static struct rtas_call
{
620 } rtas_table
[RTAS_TOKEN_MAX
- RTAS_TOKEN_BASE
];
622 target_ulong
spapr_rtas_call(PowerPCCPU
*cpu
, sPAPRMachineState
*spapr
,
623 uint32_t token
, uint32_t nargs
, target_ulong args
,
624 uint32_t nret
, target_ulong rets
)
626 if ((token
>= RTAS_TOKEN_BASE
) && (token
< RTAS_TOKEN_MAX
)) {
627 struct rtas_call
*call
= rtas_table
+ (token
- RTAS_TOKEN_BASE
);
630 call
->fn(cpu
, spapr
, token
, nargs
, args
, nret
, rets
);
635 /* HACK: Some Linux early debug code uses RTAS display-character,
636 * but assumes the token value is 0xa (which it is on some real
637 * machines) without looking it up in the device tree. This
638 * special case makes this work */
640 rtas_display_character(cpu
, spapr
, 0xa, nargs
, args
, nret
, rets
);
644 hcall_dprintf("Unknown RTAS token 0x%x\n", token
);
645 rtas_st(rets
, 0, RTAS_OUT_PARAM_ERROR
);
649 void spapr_rtas_register(int token
, const char *name
, spapr_rtas_fn fn
)
651 if (!((token
>= RTAS_TOKEN_BASE
) && (token
< RTAS_TOKEN_MAX
))) {
652 fprintf(stderr
, "RTAS invalid token 0x%x\n", token
);
656 token
-= RTAS_TOKEN_BASE
;
657 if (rtas_table
[token
].name
) {
658 fprintf(stderr
, "RTAS call \"%s\" is registered already as 0x%x\n",
659 rtas_table
[token
].name
, token
);
663 rtas_table
[token
].name
= name
;
664 rtas_table
[token
].fn
= fn
;
667 int spapr_rtas_device_tree_setup(void *fdt
, hwaddr rtas_addr
,
672 uint32_t lrdr_capacity
[5];
673 MachineState
*machine
= MACHINE(qdev_get_machine());
675 ret
= fdt_add_mem_rsv(fdt
, rtas_addr
, rtas_size
);
677 fprintf(stderr
, "Couldn't add RTAS reserve entry: %s\n",
682 ret
= qemu_fdt_setprop_cell(fdt
, "/rtas", "linux,rtas-base",
685 fprintf(stderr
, "Couldn't add linux,rtas-base property: %s\n",
690 ret
= qemu_fdt_setprop_cell(fdt
, "/rtas", "linux,rtas-entry",
693 fprintf(stderr
, "Couldn't add linux,rtas-entry property: %s\n",
698 ret
= qemu_fdt_setprop_cell(fdt
, "/rtas", "rtas-size",
701 fprintf(stderr
, "Couldn't add rtas-size property: %s\n",
706 for (i
= 0; i
< RTAS_TOKEN_MAX
- RTAS_TOKEN_BASE
; i
++) {
707 struct rtas_call
*call
= &rtas_table
[i
];
713 ret
= qemu_fdt_setprop_cell(fdt
, "/rtas", call
->name
,
714 i
+ RTAS_TOKEN_BASE
);
716 fprintf(stderr
, "Couldn't add rtas token for %s: %s\n",
717 call
->name
, fdt_strerror(ret
));
723 lrdr_capacity
[0] = cpu_to_be32(((uint64_t)machine
->maxram_size
) >> 32);
724 lrdr_capacity
[1] = cpu_to_be32(machine
->maxram_size
& 0xffffffff);
725 lrdr_capacity
[2] = 0;
726 lrdr_capacity
[3] = cpu_to_be32(SPAPR_MEMORY_BLOCK_SIZE
);
727 lrdr_capacity
[4] = cpu_to_be32(max_cpus
/smp_threads
);
728 ret
= qemu_fdt_setprop(fdt
, "/rtas", "ibm,lrdr-capacity", lrdr_capacity
,
729 sizeof(lrdr_capacity
));
731 fprintf(stderr
, "Couldn't add ibm,lrdr-capacity rtas property\n");
738 static void core_rtas_register_types(void)
740 spapr_rtas_register(RTAS_DISPLAY_CHARACTER
, "display-character",
741 rtas_display_character
);
742 spapr_rtas_register(RTAS_POWER_OFF
, "power-off", rtas_power_off
);
743 spapr_rtas_register(RTAS_SYSTEM_REBOOT
, "system-reboot",
745 spapr_rtas_register(RTAS_QUERY_CPU_STOPPED_STATE
, "query-cpu-stopped-state",
746 rtas_query_cpu_stopped_state
);
747 spapr_rtas_register(RTAS_START_CPU
, "start-cpu", rtas_start_cpu
);
748 spapr_rtas_register(RTAS_STOP_SELF
, "stop-self", rtas_stop_self
);
749 spapr_rtas_register(RTAS_IBM_GET_SYSTEM_PARAMETER
,
750 "ibm,get-system-parameter",
751 rtas_ibm_get_system_parameter
);
752 spapr_rtas_register(RTAS_IBM_SET_SYSTEM_PARAMETER
,
753 "ibm,set-system-parameter",
754 rtas_ibm_set_system_parameter
);
755 spapr_rtas_register(RTAS_IBM_OS_TERM
, "ibm,os-term",
757 spapr_rtas_register(RTAS_SET_POWER_LEVEL
, "set-power-level",
758 rtas_set_power_level
);
759 spapr_rtas_register(RTAS_GET_POWER_LEVEL
, "get-power-level",
760 rtas_get_power_level
);
761 spapr_rtas_register(RTAS_SET_INDICATOR
, "set-indicator",
763 spapr_rtas_register(RTAS_GET_SENSOR_STATE
, "get-sensor-state",
764 rtas_get_sensor_state
);
765 spapr_rtas_register(RTAS_IBM_CONFIGURE_CONNECTOR
, "ibm,configure-connector",
766 rtas_ibm_configure_connector
);
769 type_init(core_rtas_register_types
)