Stephen Boyd | ed630b0 | 2012-01-26 15:26:47 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. |
Stephen Boyd | eb81988 | 2011-08-29 14:46:30 -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 | */ |
| 12 | #ifndef __MSM_PIL_Q6V4_H |
| 13 | #define __MSM_PIL_Q6V4_H |
| 14 | |
Stephen Boyd | bdb53f3 | 2012-06-05 18:39:47 -0700 | [diff] [blame] | 15 | #include "peripheral-loader.h" |
| 16 | |
Stephen Boyd | eb81988 | 2011-08-29 14:46:30 -0700 | [diff] [blame] | 17 | struct pil_q6v4_pdata { |
| 18 | const unsigned long strap_tcm_base; |
| 19 | const unsigned long strap_ahb_upper; |
| 20 | const unsigned long strap_ahb_lower; |
| 21 | void __iomem *aclk_reg; |
| 22 | void __iomem *jtag_clk_reg; |
Stephen Boyd | eb81988 | 2011-08-29 14:46:30 -0700 | [diff] [blame] | 23 | const char *name; |
Stephen Boyd | eb81988 | 2011-08-29 14:46:30 -0700 | [diff] [blame] | 24 | const unsigned pas_id; |
Matt Wagantall | 6e4aafb | 2011-09-09 17:53:54 -0700 | [diff] [blame] | 25 | int bus_port; |
Stephen Boyd | eb81988 | 2011-08-29 14:46:30 -0700 | [diff] [blame] | 26 | }; |
Stephen Boyd | bdb53f3 | 2012-06-05 18:39:47 -0700 | [diff] [blame] | 27 | |
| 28 | struct clk; |
| 29 | struct pil_device; |
| 30 | struct regulator; |
| 31 | |
| 32 | /** |
| 33 | * struct q6v4_data - Q6 processor |
| 34 | */ |
| 35 | struct q6v4_data { |
| 36 | void __iomem *base; |
Stephen Boyd | 2efa996 | 2012-06-12 14:20:12 -0700 | [diff] [blame] | 37 | void __iomem *wdog_base; |
Stephen Boyd | bdb53f3 | 2012-06-05 18:39:47 -0700 | [diff] [blame] | 38 | unsigned long strap_tcm_base; |
| 39 | unsigned long strap_ahb_upper; |
| 40 | unsigned long strap_ahb_lower; |
| 41 | void __iomem *aclk_reg; |
| 42 | void __iomem *jtag_clk_reg; |
| 43 | unsigned pas_id; |
| 44 | int bus_port; |
Stephen Boyd | 2efa996 | 2012-06-12 14:20:12 -0700 | [diff] [blame] | 45 | int wdog_irq; |
Stephen Boyd | bdb53f3 | 2012-06-05 18:39:47 -0700 | [diff] [blame] | 46 | |
| 47 | struct regulator *vreg; |
| 48 | struct regulator *pll_supply; |
| 49 | bool vreg_enabled; |
| 50 | struct clk *xo; |
| 51 | |
Stephen Boyd | bdb53f3 | 2012-06-05 18:39:47 -0700 | [diff] [blame] | 52 | struct pil_desc desc; |
| 53 | }; |
| 54 | |
| 55 | #define pil_to_q6v4_data(p) container_of(p, struct q6v4_data, desc) |
| 56 | |
Stephen Boyd | bdb53f3 | 2012-06-05 18:39:47 -0700 | [diff] [blame] | 57 | extern int pil_q6v4_make_proxy_votes(struct pil_desc *pil); |
| 58 | extern void pil_q6v4_remove_proxy_votes(struct pil_desc *pil); |
| 59 | extern int pil_q6v4_power_up(struct q6v4_data *drv); |
| 60 | extern void pil_q6v4_power_down(struct q6v4_data *drv); |
| 61 | extern int pil_q6v4_boot(struct pil_desc *pil); |
| 62 | extern int pil_q6v4_shutdown(struct pil_desc *pil); |
| 63 | |
| 64 | extern int pil_q6v4_init_image_trusted(struct pil_desc *pil, |
| 65 | const u8 *metadata, size_t size); |
| 66 | extern int pil_q6v4_boot_trusted(struct pil_desc *pil); |
| 67 | extern int pil_q6v4_shutdown_trusted(struct pil_desc *pil); |
| 68 | extern void __devinit |
| 69 | pil_q6v4_init(struct q6v4_data *drv, const struct pil_q6v4_pdata *p); |
| 70 | |
Stephen Boyd | eb81988 | 2011-08-29 14:46:30 -0700 | [diff] [blame] | 71 | #endif |