blob: 097d9d7eed7d45e6212e273e21ff3c03468cccca [file] [log] [blame]
Stephen Boyd5bd999a2011-08-02 18:50:57 -07001/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
Stephen Boyde4174b22011-09-20 00:19:43 -070012#ifndef __MSM_PERIPHERAL_LOADER_H
13#define __MSM_PERIPHERAL_LOADER_H
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070014
15#include <linux/list.h>
16#include <linux/mutex.h>
17#include <linux/platform_device.h>
18
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070019struct pil_device {
20 const char *name;
21 const char *depends_on;
22 int count;
23 struct mutex lock;
24 struct platform_device pdev;
25 struct list_head list;
26 struct pil_reset_ops *ops;
27};
28
Stephen Boyd5bd999a2011-08-02 18:50:57 -070029struct pil_reset_ops {
30 int (*init_image)(struct pil_device *pil, const u8 *metadata,
31 size_t size);
32 int (*verify_blob)(struct pil_device *pil, u32 phy_addr, size_t size);
33 int (*auth_and_reset)(struct pil_device *pil);
34 int (*shutdown)(struct pil_device *pil);
35};
36
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070037extern int msm_pil_add_device(struct pil_device *pil);
38
39#endif