Lines Matching +full:power +full:- +full:manager
1 // SPDX-License-Identifier: GPL-2.0-only
3 * PS3 System Manager.
22 * ps3_sys_manager - PS3 system manager driver.
24 * The system manager provides an asynchronous system event notification
28 * The actual system manager is implemented as an application running in the
29 * system policy module in lpar_1. Guests communicate with the system manager
36 * struct ps3_sys_manager_header - System manager message header.
59 pr_debug("%s:%d: version: %xh\n", func, line, h->version); in _dump_sm_header()
60 pr_debug("%s:%d: size: %xh\n", func, line, h->size); in _dump_sm_header()
61 pr_debug("%s:%d: payload_size: %xh\n", func, line, h->payload_size); in _dump_sm_header()
62 pr_debug("%s:%d: service_id: %xh\n", func, line, h->service_id); in _dump_sm_header()
63 pr_debug("%s:%d: request_tag: %xh\n", func, line, h->request_tag); in _dump_sm_header()
67 * @PS3_SM_RX_MSG_LEN_MIN - Shortest received message length.
68 * @PS3_SM_RX_MSG_LEN_MAX - Longest received message length.
70 * Currently all messages received from the system manager are either
82 * enum ps3_sys_manager_service_id - Message header service_id.
83 * @PS3_SM_SERVICE_ID_REQUEST: guest --> sys_manager.
84 * @PS3_SM_SERVICE_ID_REQUEST_ERROR: guest <-- sys_manager.
85 * @PS3_SM_SERVICE_ID_COMMAND: guest <-- sys_manager.
86 * @PS3_SM_SERVICE_ID_RESPONSE: guest --> sys_manager.
87 * @PS3_SM_SERVICE_ID_SET_ATTR: guest --> sys_manager.
88 * @PS3_SM_SERVICE_ID_EXTERN_EVENT: guest <-- sys_manager.
89 * @PS3_SM_SERVICE_ID_SET_NEXT_OP: guest --> sys_manager.
108 * enum ps3_sys_manager_attr - Notification attribute (bit position mask).
109 * @PS3_SM_ATTR_POWER: Power button.
115 * The guest tells the system manager which events it is interested in receiving
116 * notice of by sending the system manager a logical OR of notification
130 * enum ps3_sys_manager_event - External event type, reported by system manager.
153 * enum ps3_sys_manager_button_event - Button event payload values.
164 * enum ps3_sys_manager_next_op - Operation to perform after lpar is destroyed.
175 * enum ps3_sys_manager_wake_source - Next-op wakeup source (bit position mask).
176 * @PS3_SM_WAKE_DEFAULT: Disk insert, power button, eject button.
178 * @PS3_SM_WAKE_P_O_R: Power on reset.
183 * other-os lpar.
194 * user_wake_sources - User specified wakeup sources.
202 * enum ps3_sys_manager_cmd - Command from system manager to guest.
216 * ps3_sm_force_power_off - Poweroff helper.
218 * A global variable used to force a poweroff when the power button has
226 * ps3_sys_manager_write - Helper to write a two part message to the vuart.
235 BUG_ON(header->version != 1); in ps3_sys_manager_write()
236 BUG_ON(header->size != 16); in ps3_sys_manager_write()
237 BUG_ON(header->payload_size != 8 && header->payload_size != 16); in ps3_sys_manager_write()
238 BUG_ON(header->service_id > 8); in ps3_sys_manager_write()
244 result = ps3_vuart_write(dev, payload, header->payload_size); in ps3_sys_manager_write()
250 * ps3_sys_manager_send_attr - Send a 'set attribute' to the system manager.
266 dev_dbg(&dev->core, "%s:%d: %xh\n", __func__, __LINE__, attr); in ps3_sys_manager_send_attr()
282 * ps3_sys_manager_send_next_op - Send a 'set next op' to the system manager.
284 * Tell the system manager what to do after this lpar is destroyed.
303 dev_dbg(&dev->core, "%s:%d: (%xh)\n", __func__, __LINE__, op); in ps3_sys_manager_send_next_op()
321 * ps3_sys_manager_send_request_shutdown - Send 'request' to the system manager.
324 * manager. The reply is a command message from the system manager. In the
326 * the command is then communicated back to the system manager with a response
345 dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__); in ps3_sys_manager_send_request_shutdown()
362 * ps3_sys_manager_send_response - Send a 'response' to the system manager.
365 * The guest sends this message to the system manager to acknowledge success or
366 * failure of a command sent by the system manager.
382 dev_dbg(&dev->core, "%s:%d: (%s)\n", __func__, __LINE__, in ps3_sys_manager_send_response()
399 * ps3_sys_manager_handle_event - Second stage event msg handler.
420 dev_dbg(&dev->core, "%s:%d: unsupported event version (%u)\n", in ps3_sys_manager_handle_event()
422 return -EIO; in ps3_sys_manager_handle_event()
427 dev_dbg(&dev->core, "%s:%d: POWER_PRESSED (%s)\n", in ps3_sys_manager_handle_event()
441 dev_dbg(&dev->core, "%s:%d: POWER_RELEASED (%u ms)\n", in ps3_sys_manager_handle_event()
445 dev_dbg(&dev->core, "%s:%d: RESET_PRESSED (%s)\n", in ps3_sys_manager_handle_event()
459 dev_dbg(&dev->core, "%s:%d: RESET_RELEASED (%u ms)\n", in ps3_sys_manager_handle_event()
463 dev_dbg(&dev->core, "%s:%d: THERMAL_ALERT (zone %u)\n", in ps3_sys_manager_handle_event()
468 dev_dbg(&dev->core, "%s:%d: THERMAL_CLEARED (zone %u)\n", in ps3_sys_manager_handle_event()
472 dev_dbg(&dev->core, "%s:%d: unknown event (%u)\n", in ps3_sys_manager_handle_event()
474 return -EIO; in ps3_sys_manager_handle_event()
480 * ps3_sys_manager_handle_cmd - Second stage command msg handler.
482 * The system manager sends this in reply to a 'request' message from the guest.
496 dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__); in ps3_sys_manager_handle_cmd()
505 dev_dbg(&dev->core, "%s:%d: unsupported cmd version (%u)\n", in ps3_sys_manager_handle_cmd()
507 return -EIO; in ps3_sys_manager_handle_cmd()
511 dev_dbg(&dev->core, "%s:%d: unknown cmd (%u)\n", in ps3_sys_manager_handle_cmd()
513 return -EIO; in ps3_sys_manager_handle_cmd()
521 * ps3_sys_manager_handle_msg - First stage msg handler.
538 dev_dbg(&dev->core, "%s:%d: unsupported header version (%u)\n", in ps3_sys_manager_handle_msg()
554 dev_dbg(&dev->core, "%s:%d: EVENT\n", __func__, __LINE__); in ps3_sys_manager_handle_msg()
557 dev_dbg(&dev->core, "%s:%d: COMMAND\n", __func__, __LINE__); in ps3_sys_manager_handle_msg()
560 dev_dbg(&dev->core, "%s:%d: REQUEST_ERROR\n", __func__, in ps3_sys_manager_handle_msg()
565 dev_dbg(&dev->core, "%s:%d: unknown service_id (%u)\n", in ps3_sys_manager_handle_msg()
573 return -EIO; in ps3_sys_manager_handle_msg()
576 return -EIO; in ps3_sys_manager_handle_msg()
583 pr_emerg("System Halted, OK to turn off power\n"); in ps3_sys_manager_fin()
597 * ps3_sys_manager_final_power_off - The final platform machine_power_off routine.
601 * the shutdown command sent from the system manager. Soon after the
611 dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__); in ps3_sys_manager_final_power_off()
622 * ps3_sys_manager_final_restart - The final platform machine_restart routine.
626 * the shutdown command sent from the system manager. Soon after the
635 dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__); in ps3_sys_manager_final_restart()
637 /* Check if we got here via a power button event. */ in ps3_sys_manager_final_restart()
640 dev_dbg(&dev->core, "%s:%d: forcing poweroff\n", in ps3_sys_manager_final_restart()
655 * ps3_sys_manager_get_wol - Get wake-on-lan setting.
667 * ps3_sys_manager_set_wol - Set wake-on-lan setting.
687 * ps3_sys_manager_work - Asynchronous read handler.
703 dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__); in ps3_sys_manager_probe()
724 dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__); in ps3_sys_manager_remove()
730 dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__); in ps3_sys_manager_shutdown()
745 return -ENODEV; in ps3_sys_manager_init()
755 MODULE_DESCRIPTION("PS3 System Manager");