Lines Matching full:rtas
4 * Procedures for interfacing to the RTAS on CHRP machines.
10 #define pr_fmt(fmt) "rtas: " fmt
42 #include <asm/rtas-work-area.h>
43 #include <asm/rtas.h>
62 * struct rtas_function - Descriptor for RTAS functions.
64 * @token: Value of @name if it exists under the /rtas node.
66 * @filter: If non-NULL, invoking this function via the rtas syscall is
92 * Per-function locks for sequence-based RTAS functions.
382 * "ibm,reset-pe-dma-windows" (plural), but RTAS
487 .name = "rtas-last-error",
540 * Nearly all RTAS calls need to be serialized. All uses of the
543 * Exceptions to the RTAS serialization requirement (e.g. stop-self)
550 * rtas_function_token() - RTAS function token lookup.
565 * Various drivers attempt token lookups on non-RTAS in rtas_function_token()
568 if (!rtas.dev) in rtas_function_token()
675 srr_regs_clobbered(); /* rtas uses SRRs, invalidate */ in __do_enter_rtas()
738 struct rtas_t rtas; variable
764 if (!rtas.base) in call_rtas_display_status()
805 * hardcode rtas.base/entry etc.
814 if (!rtas.base) in udbg_rtascon_putc()
833 if (!rtas.base) in udbg_rtascon_getc_poll()
874 if (!rtas.base) in rtas_progress()
879 if ((root = of_find_node_by_path("/rtas"))) { in rtas_progress()
948 /* RTAS wants CR-LF, not just LF */ in rtas_progress()
986 if (rtas.dev == NULL) in rtas_token()
994 * RTAS function. Either it's a function that needs to be in rtas_token()
996 * access non-function properties of the /rtas node. Warn and in rtas_token()
1002 tokp = of_get_property(rtas.dev, service, NULL); in rtas_token()
1013 * for all rtas calls that require an error buffer argument.
1014 * This includes 'check-exception' and 'rtas-last-error'.
1023 static const char propname[] __initconst = "rtas-error-log-max"; in init_error_log_max()
1026 if (of_property_read_u32(rtas.dev, propname, &max)) { in init_error_log_max()
1045 * most recent failed call to rtas. Because the error text
1046 * might go stale if there are any other intervening rtas calls,
1125 * rtas_call_unlocked() - Invoke an RTAS firmware function without synchronization.
1126 * @args: RTAS parameter block to be used for the call, must obey RTAS addressing
1133 * Invokes the RTAS function indicated by @token, which the caller
1137 * limited set of RTAS calls specifically exempted from the general
1138 * requirement that only one RTAS call may be in progress at any
1157 * rtas_call() - Invoke an RTAS firmware function.
1164 * Invokes the RTAS function indicated by @token, which the caller
1168 * output parameters specified for the RTAS function.
1170 * rtas_call() returns RTAS status codes, not conventional Linux errno
1172 * in syscall context. Most callers of RTAS functions that can return
1176 * The return value descriptions are adapted from 7.2.8 [RTAS] Return
1184 * * 0 - RTAS function call succeeded.
1185 * * -1 - RTAS function encountered a hardware or
1192 * respect to current RTAS implementations. What it
1194 * could not be completed while meeting RTAS's
1205 * contention for RTAS-internal resources. Other
1206 * RTAS call sequences in progress should be
1224 if (!rtas.entry || token == RTAS_UNKNOWN_SERVICE) in rtas_call()
1231 * RTAS status, not an errno. in rtas_call()
1245 /* We use the global rtas args buffer */ in rtas_call()
1275 * rtas_busy_delay_time() - From an RTAS status value, calculate the
1279 * the status of a RTAS function call.
1353 * rtas_busy_delay() - helper for RTAS busy and extended delay statuses
1356 * the status of a RTAS function call.
1364 * Generally the caller should reattempt the RTAS call which
1532 indicators = of_get_property(rtas.dev, "rtas-indicators", &proplen); in rtas_indicator_present()
1568 * Ignoring RTAS extended delay
1592 * @fw_status: RTAS call status will be placed here if not NULL.
1699 * Keep calling as long as RTAS returns a "try again" status, in rtas_os_term()
1746 * get_pseries_errorlog() - Find a specific pseries error log in an RTAS
1748 * @log: RTAS error/event log
1785 * arbitrary physical addresses to RTAS calls. A number of RTAS calls
1792 * subset of RTAS calls.
1794 * Accordingly, we filter RTAS requests to check that the call is
1879 pr_err_ratelimited("sys_rtas: RTAS call blocked - exploit attempt?\n"); in block_rtas_call()
1886 SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs) in SYSCALL_DEFINE1() argument
1898 if (!rtas.entry) in SYSCALL_DEFINE1()
2040 for_each_property_of_node(rtas.dev, prop) { in rtas_function_table_init()
2057 * Call early during boot, before mem init, to retrieve the RTAS
2067 /* Get RTAS dev node and fill up our "rtas" structure with infos in rtas_initialize()
2070 rtas.dev = of_find_node_by_name(NULL, "rtas"); in rtas_initialize()
2071 if (!rtas.dev) in rtas_initialize()
2074 no_base = of_property_read_u32(rtas.dev, "linux,rtas-base", &base); in rtas_initialize()
2075 no_size = of_property_read_u32(rtas.dev, "rtas-size", &size); in rtas_initialize()
2077 of_node_put(rtas.dev); in rtas_initialize()
2078 rtas.dev = NULL; in rtas_initialize()
2082 rtas.base = base; in rtas_initialize()
2083 rtas.size = size; in rtas_initialize()
2084 no_entry = of_property_read_u32(rtas.dev, "linux,rtas-entry", &entry); in rtas_initialize()
2085 rtas.entry = no_entry ? rtas.base : entry; in rtas_initialize()
2096 ibm_extended_os_term = of_property_read_bool(rtas.dev, "ibm,extended-os-term"); in rtas_initialize()
2098 /* If RTAS was found, allocate the RMO buffer for it and look for in rtas_initialize()
2108 panic("ERROR: RTAS: Failed to allocate %lx bytes below %pa\n", in rtas_initialize()
2119 if (depth != 1 || strcmp(uname, "rtas") != 0) in early_init_dt_scan_rtas()
2122 basep = of_get_flat_dt_prop(node, "linux,rtas-base", NULL); in early_init_dt_scan_rtas()
2123 entryp = of_get_flat_dt_prop(node, "linux,rtas-entry", NULL); in early_init_dt_scan_rtas()
2124 sizep = of_get_flat_dt_prop(node, "rtas-size", NULL); in early_init_dt_scan_rtas()
2133 rtas.base = *basep; in early_init_dt_scan_rtas()
2134 rtas.entry = *entryp; in early_init_dt_scan_rtas()
2135 rtas.size = *sizep; in early_init_dt_scan_rtas()