aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/rtas.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-powerpc/rtas.h')
-rw-r--r--include/asm-powerpc/rtas.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/asm-powerpc/rtas.h b/include/asm-powerpc/rtas.h
index 82a27e9a041f..d34f9e1f242c 100644
--- a/include/asm-powerpc/rtas.h
+++ b/include/asm-powerpc/rtas.h
@@ -230,5 +230,21 @@ extern unsigned long rtas_rmo_buf;
230 230
231#define GLOBAL_INTERRUPT_QUEUE 9005 231#define GLOBAL_INTERRUPT_QUEUE 9005
232 232
233/**
234 * rtas_config_addr - Format a busno, devfn and reg for RTAS.
235 * @busno: The bus number.
236 * @devfn: The device and function number as encoded by PCI_DEVFN().
237 * @reg: The register number.
238 *
239 * This function encodes the given busno, devfn and register number as
240 * required for RTAS calls that take a "config_addr" parameter.
241 * See PAPR requirement 7.3.4-1 for more info.
242 */
243static inline u32 rtas_config_addr(int busno, int devfn, int reg)
244{
245 return ((reg & 0xf00) << 20) | ((busno & 0xff) << 16) |
246 (devfn << 8) | (reg & 0xff);
247}
248
233#endif /* __KERNEL__ */ 249#endif /* __KERNEL__ */
234#endif /* _POWERPC_RTAS_H */ 250#endif /* _POWERPC_RTAS_H */