aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi
diff options
context:
space:
mode:
authorSudeep Dutt <sudeep.dutt@intel.com>2013-09-05 19:41:55 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-26 16:50:56 -0400
commit3a6a9201897c6482573ad07ee880574147761006 (patch)
tree85b2c67221f0e003a64637d815d43585718870d3 /include/uapi
parenta01e28f692088e9789ebb0c374fdac83de59899b (diff)
Intel MIC Host Driver, card OS state management.
This patch enables the following features: a) Boots and shuts down the card via sysfs entries. b) Allocates and maps a device page for communication with the card driver and updates the device page address via scratchpad registers. c) Provides sysfs entries for shutdown status, kernel command line, ramdisk and log buffer information. Co-author: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Caz Yokoyama <Caz.Yokoyama@intel.com> Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com> Signed-off-by: Harshavardhan R Kharche <harshavardhan.r.kharche@intel.com> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Acked-by: Yaozu (Eddie) Dong <eddie.dong@intel.com> Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/linux/Kbuild1
-rw-r--r--include/uapi/linux/mic_common.h74
2 files changed, 75 insertions, 0 deletions
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index 115add2515aa..d37263fbdca7 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -241,6 +241,7 @@ header-y += media.h
241header-y += mei.h 241header-y += mei.h
242header-y += mempolicy.h 242header-y += mempolicy.h
243header-y += meye.h 243header-y += meye.h
244header-y += mic_common.h
244header-y += mii.h 245header-y += mii.h
245header-y += minix_fs.h 246header-y += minix_fs.h
246header-y += mman.h 247header-y += mman.h
diff --git a/include/uapi/linux/mic_common.h b/include/uapi/linux/mic_common.h
new file mode 100644
index 000000000000..a9091e529183
--- /dev/null
+++ b/include/uapi/linux/mic_common.h
@@ -0,0 +1,74 @@
1/*
2 * Intel MIC Platform Software Stack (MPSS)
3 *
4 * Copyright(c) 2013 Intel Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License, version 2, as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * The full GNU General Public License is included in this distribution in
16 * the file called "COPYING".
17 *
18 * Intel MIC driver.
19 *
20 */
21#ifndef __MIC_COMMON_H_
22#define __MIC_COMMON_H_
23
24#include <linux/types.h>
25
26/**
27 * struct mic_bootparam: Virtio device independent information in device page
28 *
29 * @magic: A magic value used by the card to ensure it can see the host
30 * @c2h_shutdown_db: Card to Host shutdown doorbell set by host
31 * @h2c_shutdown_db: Host to Card shutdown doorbell set by card
32 * @h2c_config_db: Host to Card Virtio config doorbell set by card
33 * @shutdown_status: Card shutdown status set by card
34 * @shutdown_card: Set to 1 by the host when a card shutdown is initiated
35 */
36struct mic_bootparam {
37 __u32 magic;
38 __s8 c2h_shutdown_db;
39 __s8 h2c_shutdown_db;
40 __s8 h2c_config_db;
41 __u8 shutdown_status;
42 __u8 shutdown_card;
43} __aligned(8);
44
45/* Device page size */
46#define MIC_DP_SIZE 4096
47
48#define MIC_MAGIC 0xc0ffee00
49
50/**
51 * enum mic_states - MIC states.
52 */
53enum mic_states {
54 MIC_OFFLINE = 0,
55 MIC_ONLINE,
56 MIC_SHUTTING_DOWN,
57 MIC_RESET_FAILED,
58 MIC_LAST
59};
60
61/**
62 * enum mic_status - MIC status reported by card after
63 * a host or card initiated shutdown or a card crash.
64 */
65enum mic_status {
66 MIC_NOP = 0,
67 MIC_CRASHED,
68 MIC_HALTED,
69 MIC_POWER_OFF,
70 MIC_RESTART,
71 MIC_STATUS_LAST
72};
73
74#endif