Stephen Boyd | 6d67d25 | 2011-09-27 11:50:05 -0700 | [diff] [blame^] | 1 | /* Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2 | * |
| 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 Boyd | e4174b2 | 2011-09-20 00:19:43 -0700 | [diff] [blame] | 12 | #ifndef __MSM_PERIPHERAL_LOADER_H |
| 13 | #define __MSM_PERIPHERAL_LOADER_H |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 14 | |
Stephen Boyd | 3f4da32 | 2011-08-30 01:03:23 -0700 | [diff] [blame] | 15 | struct device; |
Stephen Boyd | 6d67d25 | 2011-09-27 11:50:05 -0700 | [diff] [blame^] | 16 | struct module; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 17 | |
Stephen Boyd | 3f4da32 | 2011-08-30 01:03:23 -0700 | [diff] [blame] | 18 | struct pil_desc { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 19 | const char *name; |
| 20 | const char *depends_on; |
Stephen Boyd | 3f4da32 | 2011-08-30 01:03:23 -0700 | [diff] [blame] | 21 | struct device *dev; |
| 22 | const struct pil_reset_ops *ops; |
Stephen Boyd | 6d67d25 | 2011-09-27 11:50:05 -0700 | [diff] [blame^] | 23 | struct module *owner; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 24 | }; |
| 25 | |
Stephen Boyd | 5bd999a | 2011-08-02 18:50:57 -0700 | [diff] [blame] | 26 | struct pil_reset_ops { |
Stephen Boyd | 3f4da32 | 2011-08-30 01:03:23 -0700 | [diff] [blame] | 27 | int (*init_image)(struct pil_desc *pil, const u8 *metadata, |
Stephen Boyd | 5bd999a | 2011-08-02 18:50:57 -0700 | [diff] [blame] | 28 | size_t size); |
Stephen Boyd | 3f4da32 | 2011-08-30 01:03:23 -0700 | [diff] [blame] | 29 | int (*verify_blob)(struct pil_desc *pil, u32 phy_addr, size_t size); |
| 30 | int (*auth_and_reset)(struct pil_desc *pil); |
| 31 | int (*shutdown)(struct pil_desc *pil); |
Stephen Boyd | 5bd999a | 2011-08-02 18:50:57 -0700 | [diff] [blame] | 32 | }; |
| 33 | |
Stephen Boyd | 6d67d25 | 2011-09-27 11:50:05 -0700 | [diff] [blame^] | 34 | struct pil_device; |
| 35 | |
| 36 | extern struct pil_device *msm_pil_register(struct pil_desc *desc); |
| 37 | extern void msm_pil_unregister(struct pil_device *pil); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 38 | |
| 39 | #endif |