Jeremy Kerr | 0d7cd85 | 2015-06-04 21:51:47 +0800 | [diff] [blame] | 1 | /* |
| 2 | * OPAL Runtime Diagnostics interface driver |
| 3 | * Supported on POWERNV platform |
| 4 | * |
| 5 | * (C) Copyright IBM 2015 |
| 6 | * |
| 7 | * Author: Vaidyanathan Srinivasan <svaidy at linux.vnet.ibm.com> |
| 8 | * Author: Jeremy Kerr <jk@ozlabs.org> |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by |
| 12 | * the Free Software Foundation; either version 2, or (at your option) |
| 13 | * any later version. |
| 14 | * |
| 15 | * This program is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
| 19 | */ |
| 20 | |
| 21 | #ifndef _UAPI_ASM_POWERPC_OPAL_PRD_H_ |
| 22 | #define _UAPI_ASM_POWERPC_OPAL_PRD_H_ |
| 23 | |
| 24 | #include <linux/types.h> |
| 25 | |
| 26 | /** |
| 27 | * The version of the kernel interface of the PRD system. This describes the |
| 28 | * interface available for the /dev/opal-prd device. The actual PRD message |
| 29 | * layout and content is private to the firmware <--> userspace interface, so |
| 30 | * is not covered by this versioning. |
| 31 | * |
| 32 | * Future interface versions are backwards-compatible; if a later kernel |
| 33 | * version is encountered, functionality provided in earlier versions |
| 34 | * will work. |
| 35 | */ |
| 36 | #define OPAL_PRD_KERNEL_VERSION 1 |
| 37 | |
| 38 | #define OPAL_PRD_GET_INFO _IOR('o', 0x01, struct opal_prd_info) |
| 39 | #define OPAL_PRD_SCOM_READ _IOR('o', 0x02, struct opal_prd_scom) |
| 40 | #define OPAL_PRD_SCOM_WRITE _IOW('o', 0x03, struct opal_prd_scom) |
| 41 | |
| 42 | #ifndef __ASSEMBLY__ |
| 43 | |
| 44 | struct opal_prd_info { |
| 45 | __u64 version; |
| 46 | __u64 reserved[3]; |
| 47 | }; |
| 48 | |
| 49 | struct opal_prd_scom { |
| 50 | __u64 chip; |
| 51 | __u64 addr; |
| 52 | __u64 data; |
| 53 | __s64 rc; |
| 54 | }; |
| 55 | |
| 56 | #endif /* __ASSEMBLY__ */ |
| 57 | |
| 58 | #endif /* _UAPI_ASM_POWERPC_OPAL_PRD_H */ |