Lines Matching full:rtas
4 * Procedures for interfacing to the RTAS on CHRP machines.
10 #define pr_fmt(fmt) "rtas: " fmt
40 #include <asm/rtas-work-area.h>
41 #include <asm/rtas.h>
60 * struct rtas_function - Descriptor for RTAS functions.
62 * @token: Value of @name if it exists under the /rtas node.
64 * @filter: If non-NULL, invoking this function via the rtas syscall is
410 .name = "rtas-last-error",
458 * Nearly all RTAS calls need to be serialized. All uses of the
461 * Exceptions to the RTAS serialization requirement (e.g. stop-self)
468 * rtas_function_token() - RTAS function token lookup.
483 * Various drivers attempt token lookups on non-RTAS in rtas_function_token()
486 if (!rtas.dev) in rtas_function_token()
568 srr_regs_clobbered(); /* rtas uses SRRs, invalidate */ in __do_enter_rtas()
634 struct rtas_t rtas; variable
660 if (!rtas.base) in call_rtas_display_status()
701 * hardcode rtas.base/entry etc.
710 if (!rtas.base) in udbg_rtascon_putc()
729 if (!rtas.base) in udbg_rtascon_getc_poll()
770 if (!rtas.base) in rtas_progress()
775 if ((root = of_find_node_by_path("/rtas"))) { in rtas_progress()
844 /* RTAS wants CR-LF, not just LF */ in rtas_progress()
882 if (rtas.dev == NULL) in rtas_token()
890 * RTAS function. Either it's a function that needs to be in rtas_token()
892 * access non-function properties of the /rtas node. Warn and in rtas_token()
898 tokp = of_get_property(rtas.dev, service, NULL); in rtas_token()
914 * for all rtas calls that require an error buffer argument.
915 * This includes 'check-exception' and 'rtas-last-error'.
924 static const char propname[] __initconst = "rtas-error-log-max"; in init_error_log_max()
927 if (of_property_read_u32(rtas.dev, propname, &max)) { in init_error_log_max()
946 * most recent failed call to rtas. Because the error text
947 * might go stale if there are any other intervening rtas calls,
1026 * rtas_call_unlocked() - Invoke an RTAS firmware function without synchronization.
1027 * @args: RTAS parameter block to be used for the call, must obey RTAS addressing
1034 * Invokes the RTAS function indicated by @token, which the caller
1038 * limited set of RTAS calls specifically exempted from the general
1039 * requirement that only one RTAS call may be in progress at any
1058 * rtas_call() - Invoke an RTAS firmware function.
1065 * Invokes the RTAS function indicated by @token, which the caller
1069 * output parameters specified for the RTAS function.
1071 * rtas_call() returns RTAS status codes, not conventional Linux errno
1073 * in syscall context. Most callers of RTAS functions that can return
1077 * The return value descriptions are adapted from 7.2.8 [RTAS] Return
1085 * * 0 - RTAS function call succeeded.
1086 * * -1 - RTAS function encountered a hardware or
1093 * respect to current RTAS implementations. What it
1095 * could not be completed while meeting RTAS's
1106 * contention for RTAS-internal resources. Other
1107 * RTAS call sequences in progress should be
1125 if (!rtas.entry || token == RTAS_UNKNOWN_SERVICE) in rtas_call()
1132 * RTAS status, not an errno. in rtas_call()
1146 /* We use the global rtas args buffer */ in rtas_call()
1176 * rtas_busy_delay_time() - From an RTAS status value, calculate the
1180 * the status of a RTAS function call.
1254 * rtas_busy_delay() - helper for RTAS busy and extended delay statuses
1257 * the status of a RTAS function call.
1265 * Generally the caller should reattempt the RTAS call which
1440 indicators = of_get_property(rtas.dev, "rtas-indicators", &proplen); in rtas_indicator_present()
1476 * Ignoring RTAS extended delay
1500 * @fw_status: RTAS call status will be placed here if not NULL.
1607 * Keep calling as long as RTAS returns a "try again" status, in rtas_os_term()
1650 * get_pseries_errorlog() - Find a specific pseries error log in an RTAS
1652 * @log: RTAS error/event log
1689 * arbitrary physical addresses to RTAS calls. A number of RTAS calls
1696 * subset of RTAS calls.
1698 * Accordingly, we filter RTAS requests to check that the call is
1789 pr_err_ratelimited("sys_rtas: RTAS call blocked - exploit attempt?\n"); in block_rtas_call()
1796 SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs) in SYSCALL_DEFINE1() argument
1807 if (!rtas.entry) in SYSCALL_DEFINE1()
1929 for_each_property_of_node(rtas.dev, prop) { in rtas_function_table_init()
1946 * Call early during boot, before mem init, to retrieve the RTAS
1956 /* Get RTAS dev node and fill up our "rtas" structure with infos in rtas_initialize()
1959 rtas.dev = of_find_node_by_name(NULL, "rtas"); in rtas_initialize()
1960 if (!rtas.dev) in rtas_initialize()
1963 no_base = of_property_read_u32(rtas.dev, "linux,rtas-base", &base); in rtas_initialize()
1964 no_size = of_property_read_u32(rtas.dev, "rtas-size", &size); in rtas_initialize()
1966 of_node_put(rtas.dev); in rtas_initialize()
1967 rtas.dev = NULL; in rtas_initialize()
1971 rtas.base = base; in rtas_initialize()
1972 rtas.size = size; in rtas_initialize()
1973 no_entry = of_property_read_u32(rtas.dev, "linux,rtas-entry", &entry); in rtas_initialize()
1974 rtas.entry = no_entry ? rtas.base : entry; in rtas_initialize()
1985 ibm_extended_os_term = of_property_read_bool(rtas.dev, "ibm,extended-os-term"); in rtas_initialize()
1987 /* If RTAS was found, allocate the RMO buffer for it and look for in rtas_initialize()
1997 panic("ERROR: RTAS: Failed to allocate %lx bytes below %pa\n", in rtas_initialize()
2008 if (depth != 1 || strcmp(uname, "rtas") != 0) in early_init_dt_scan_rtas()
2011 basep = of_get_flat_dt_prop(node, "linux,rtas-base", NULL); in early_init_dt_scan_rtas()
2012 entryp = of_get_flat_dt_prop(node, "linux,rtas-entry", NULL); in early_init_dt_scan_rtas()
2013 sizep = of_get_flat_dt_prop(node, "rtas-size", NULL); in early_init_dt_scan_rtas()
2022 rtas.base = *basep; in early_init_dt_scan_rtas()
2023 rtas.entry = *entryp; in early_init_dt_scan_rtas()
2024 rtas.size = *sizep; in early_init_dt_scan_rtas()