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