aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mic/cosm/cosm_main.h
diff options
context:
space:
mode:
authorAshutosh Dixit <ashutosh.dixit@intel.com>2015-09-29 21:12:27 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-04 07:46:06 -0400
commitf8487a26b285feea2cb210efec42c49dce9ae708 (patch)
treee592e68a7d1f744bb9f847db59c2aeb5150f5824 /drivers/misc/mic/cosm/cosm_main.h
parenta3283d831a71d53234fcc279e0d9ed262cef94d5 (diff)
misc: mic: Coprocessor State Management (COSM) driver
The COSM driver allows boot, shutdown and reset of Intel MIC devices via sysfs. This functionality was previously present in the Intel MIC host driver but has now been taken out into a separate driver so that it can be shared between multiple generations of Intel MIC products. The sysfs kernel ABI used by the COSM driver is the same as that defined originally for the MIC host driver in Documentation/ABI/testing/sysfs-class-mic.txt. The COSM driver also contains support for dumping the MIC card log_buf and doing a "force reset" for the card via debugfs. The OSPM support present in the MIC host driver has now largely been moved to user space and only a small required OSPM functionality is now present in the driver. Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mic/cosm/cosm_main.h')
-rw-r--r--drivers/misc/mic/cosm/cosm_main.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/drivers/misc/mic/cosm/cosm_main.h b/drivers/misc/mic/cosm/cosm_main.h
new file mode 100644
index 000000000000..f01156fca881
--- /dev/null
+++ b/drivers/misc/mic/cosm/cosm_main.h
@@ -0,0 +1,70 @@
1/*
2 * Intel MIC Platform Software Stack (MPSS)
3 *
4 * Copyright(c) 2015 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 Coprocessor State Management (COSM) Driver
19 *
20 */
21#ifndef _COSM_COSM_H_
22#define _COSM_COSM_H_
23
24#include <linux/scif.h>
25#include "../bus/cosm_bus.h"
26
27#define COSM_HEARTBEAT_SEND_SEC 30
28#define SCIF_COSM_LISTEN_PORT 201
29
30/**
31 * enum COSM msg id's
32 * @COSM_MSG_SHUTDOWN: host->card trigger shutdown
33 * @COSM_MSG_SYNC_TIME: host->card send host time to card to sync time
34 * @COSM_MSG_HEARTBEAT: card->host heartbeat
35 * @COSM_MSG_SHUTDOWN_STATUS: card->host with shutdown status as payload
36 */
37enum cosm_msg_id {
38 COSM_MSG_SHUTDOWN,
39 COSM_MSG_SYNC_TIME,
40 COSM_MSG_HEARTBEAT,
41 COSM_MSG_SHUTDOWN_STATUS,
42};
43
44struct cosm_msg {
45 u64 id;
46 union {
47 u64 shutdown_status;
48 struct timespec64 timespec;
49 };
50};
51
52extern const char * const cosm_state_string[];
53extern const char * const cosm_shutdown_status_string[];
54
55void cosm_sysfs_init(struct cosm_device *cdev);
56int cosm_start(struct cosm_device *cdev);
57void cosm_stop(struct cosm_device *cdev, bool force);
58int cosm_reset(struct cosm_device *cdev);
59int cosm_shutdown(struct cosm_device *cdev);
60void cosm_set_state(struct cosm_device *cdev, u8 state);
61void cosm_set_shutdown_status(struct cosm_device *cdev, u8 status);
62void cosm_init_debugfs(void);
63void cosm_exit_debugfs(void);
64void cosm_create_debug_dir(struct cosm_device *cdev);
65void cosm_delete_debug_dir(struct cosm_device *cdev);
66int cosm_scif_init(void);
67void cosm_scif_exit(void);
68void cosm_scif_work(struct work_struct *work);
69
70#endif