aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-04 12:11:57 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-04 12:11:57 -0400
commit4d6d367232813af09d9a1d90e3259e3ac42ee8a8 (patch)
treef8921106542eb5bac53f1ef5ac9fee46f1def42f /include
parentd66e6737d454553e1e62109d8298ede5351178a4 (diff)
parentd09f53a735bae43806a77754312a45d3f1198342 (diff)
Merge tag 'remoteproc-for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc
Pull remoteproc update from Ohad Ben-Cohen: - Remoteproc Recovery - by Fernando Guzman Lugo When a remote processor crash is detected, this mechanism will remove all virtio children devices, wait until their drivers let go, hard reset the remote processor and reload the firmware (resulting in the relevant virtio children devices re-added). Essentially the entire software stack is reset, together with the relevant hardware, so users don't have to reset the entire phone. - STE Modem driver is added - by Sjur Brændeland - OMAP DSP boot address support is added - by Juan Gutierrez - A handful of fixes/cleanups - Sjur Brændeland, Dan Carpenter, Emil Goode * tag 'remoteproc-for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc: remoteproc: Fix use of format specifyer remoteproc: fix a potential NULL-dereference on cleanup remoteproc: select VIRTIO to avoid build breakage remoteproc: return -EFAULT on copy_from_user failure remoteproc: snprintf() can return more than was printed remoteproc: Add STE modem driver remtoteproc: maintain max notifyid remoteproc: create a 'recovery' debugfs entry remoteproc: add actual recovery implementation remoteproc: add rproc_report_crash function to notify rproc crashes remoteproc: Add dependency to HAS_DMA remoteproc/omap: set bootaddr support
Diffstat (limited to 'include')
-rw-r--r--include/linux/platform_data/remoteproc-omap.h2
-rw-r--r--include/linux/remoteproc.h24
-rw-r--r--include/linux/ste_modem_shm.h56
3 files changed, 82 insertions, 0 deletions
diff --git a/include/linux/platform_data/remoteproc-omap.h b/include/linux/platform_data/remoteproc-omap.h
index b10eac89e2e9..3c1c6444ec4b 100644
--- a/include/linux/platform_data/remoteproc-omap.h
+++ b/include/linux/platform_data/remoteproc-omap.h
@@ -30,6 +30,7 @@ struct platform_device;
30 * @ops: start/stop rproc handlers 30 * @ops: start/stop rproc handlers
31 * @device_enable: omap-specific handler for enabling a device 31 * @device_enable: omap-specific handler for enabling a device
32 * @device_shutdown: omap-specific handler for shutting down a device 32 * @device_shutdown: omap-specific handler for shutting down a device
33 * @set_bootaddr: omap-specific handler for setting the rproc boot address
33 */ 34 */
34struct omap_rproc_pdata { 35struct omap_rproc_pdata {
35 const char *name; 36 const char *name;
@@ -40,6 +41,7 @@ struct omap_rproc_pdata {
40 const struct rproc_ops *ops; 41 const struct rproc_ops *ops;
41 int (*device_enable) (struct platform_device *pdev); 42 int (*device_enable) (struct platform_device *pdev);
42 int (*device_shutdown) (struct platform_device *pdev); 43 int (*device_shutdown) (struct platform_device *pdev);
44 void(*set_bootaddr)(u32);
43}; 45};
44 46
45#if defined(CONFIG_OMAP_REMOTEPROC) || defined(CONFIG_OMAP_REMOTEPROC_MODULE) 47#if defined(CONFIG_OMAP_REMOTEPROC) || defined(CONFIG_OMAP_REMOTEPROC_MODULE)
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
index 131b53957b9f..faf33324c78f 100644
--- a/include/linux/remoteproc.h
+++ b/include/linux/remoteproc.h
@@ -361,6 +361,19 @@ enum rproc_state {
361}; 361};
362 362
363/** 363/**
364 * enum rproc_crash_type - remote processor crash types
365 * @RPROC_MMUFAULT: iommu fault
366 *
367 * Each element of the enum is used as an array index. So that, the value of
368 * the elements should be always something sane.
369 *
370 * Feel free to add more types when needed.
371 */
372enum rproc_crash_type {
373 RPROC_MMUFAULT,
374};
375
376/**
364 * struct rproc - represents a physical remote processor device 377 * struct rproc - represents a physical remote processor device
365 * @node: klist node of this rproc object 378 * @node: klist node of this rproc object
366 * @domain: iommu domain 379 * @domain: iommu domain
@@ -383,6 +396,11 @@ enum rproc_state {
383 * @rvdevs: list of remote virtio devices 396 * @rvdevs: list of remote virtio devices
384 * @notifyids: idr for dynamically assigning rproc-wide unique notify ids 397 * @notifyids: idr for dynamically assigning rproc-wide unique notify ids
385 * @index: index of this rproc device 398 * @index: index of this rproc device
399 * @crash_handler: workqueue for handling a crash
400 * @crash_cnt: crash counter
401 * @crash_comp: completion used to sync crash handler and the rproc reload
402 * @recovery_disabled: flag that state if recovery was disabled
403 * @max_notifyid: largest allocated notify id.
386 */ 404 */
387struct rproc { 405struct rproc {
388 struct klist_node node; 406 struct klist_node node;
@@ -406,6 +424,11 @@ struct rproc {
406 struct list_head rvdevs; 424 struct list_head rvdevs;
407 struct idr notifyids; 425 struct idr notifyids;
408 int index; 426 int index;
427 struct work_struct crash_handler;
428 unsigned crash_cnt;
429 struct completion crash_comp;
430 bool recovery_disabled;
431 int max_notifyid;
409}; 432};
410 433
411/* we currently support only two vrings per rvdev */ 434/* we currently support only two vrings per rvdev */
@@ -460,6 +483,7 @@ int rproc_del(struct rproc *rproc);
460 483
461int rproc_boot(struct rproc *rproc); 484int rproc_boot(struct rproc *rproc);
462void rproc_shutdown(struct rproc *rproc); 485void rproc_shutdown(struct rproc *rproc);
486void rproc_report_crash(struct rproc *rproc, enum rproc_crash_type type);
463 487
464static inline struct rproc_vdev *vdev_to_rvdev(struct virtio_device *vdev) 488static inline struct rproc_vdev *vdev_to_rvdev(struct virtio_device *vdev)
465{ 489{
diff --git a/include/linux/ste_modem_shm.h b/include/linux/ste_modem_shm.h
new file mode 100644
index 000000000000..8444a4eff1bb
--- /dev/null
+++ b/include/linux/ste_modem_shm.h
@@ -0,0 +1,56 @@
1/*
2 * Copyright (C) ST-Ericsson AB 2012
3 * Author: Sjur Brendeland / sjur.brandeland@stericsson.com
4 *
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#ifndef __INC_MODEM_DEV_H
9#define __INC_MODEM_DEV_H
10#include <linux/types.h>
11#include <linux/platform_device.h>
12
13struct ste_modem_device;
14
15/**
16 * struct ste_modem_dev_cb - Callbacks for modem initiated events.
17 * @kick: Called when the modem kicks the host.
18 *
19 * This structure contains callbacks for actions triggered by the modem.
20 */
21struct ste_modem_dev_cb {
22 void (*kick)(struct ste_modem_device *mdev, int notify_id);
23};
24
25/**
26 * struct ste_modem_dev_ops - Functions to control modem and modem interface.
27 *
28 * @power: Main power switch, used for cold-start or complete power off.
29 * @kick: Kick the modem.
30 * @kick_subscribe: Subscribe for notifications from the modem.
31 * @setup: Provide callback functions to modem device.
32 *
33 * This structure contains functions used by the ste remoteproc driver
34 * to manage the modem.
35 */
36struct ste_modem_dev_ops {
37 int (*power)(struct ste_modem_device *mdev, bool on);
38 int (*kick)(struct ste_modem_device *mdev, int notify_id);
39 int (*kick_subscribe)(struct ste_modem_device *mdev, int notify_id);
40 int (*setup)(struct ste_modem_device *mdev,
41 struct ste_modem_dev_cb *cfg);
42};
43
44/**
45 * struct ste_modem_device - represent the STE modem device
46 * @pdev: Reference to platform device
47 * @ops: Operations used to manage the modem.
48 * @drv_data: Driver private data.
49 */
50struct ste_modem_device {
51 struct platform_device pdev;
52 struct ste_modem_dev_ops ops;
53 void *drv_data;
54};
55
56#endif /*INC_MODEM_DEV_H*/