blob: 86e55ea1ff6c314d1f257efef14fd5dbf6f8d755 [file] [log] [blame]
Stephen Boyded630b02012-01-26 15:26:47 -08001/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Stephen Boydeb819882011-08-29 14:46:30 -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 */
12#ifndef __MSM_PIL_Q6V4_H
13#define __MSM_PIL_Q6V4_H
14
Stephen Boydbdb53f32012-06-05 18:39:47 -070015#include "peripheral-loader.h"
16
Stephen Boydeb819882011-08-29 14:46:30 -070017struct 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 Boydeb819882011-08-29 14:46:30 -070023 const char *name;
Stephen Boydeb819882011-08-29 14:46:30 -070024 const unsigned pas_id;
Matt Wagantall6e4aafb2011-09-09 17:53:54 -070025 int bus_port;
Stephen Boydeb819882011-08-29 14:46:30 -070026};
Stephen Boydbdb53f32012-06-05 18:39:47 -070027
28struct clk;
29struct pil_device;
30struct regulator;
31
32/**
33 * struct q6v4_data - Q6 processor
34 */
35struct q6v4_data {
36 void __iomem *base;
Stephen Boyd2efa9962012-06-12 14:20:12 -070037 void __iomem *wdog_base;
Stephen Boydbdb53f32012-06-05 18:39:47 -070038 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 Boyd2efa9962012-06-12 14:20:12 -070045 int wdog_irq;
Stephen Boydbdb53f32012-06-05 18:39:47 -070046
47 struct regulator *vreg;
48 struct regulator *pll_supply;
49 bool vreg_enabled;
50 struct clk *xo;
51
Stephen Boydbdb53f32012-06-05 18:39:47 -070052 struct pil_desc desc;
53};
54
55#define pil_to_q6v4_data(p) container_of(p, struct q6v4_data, desc)
56
Stephen Boydbdb53f32012-06-05 18:39:47 -070057extern int pil_q6v4_make_proxy_votes(struct pil_desc *pil);
58extern void pil_q6v4_remove_proxy_votes(struct pil_desc *pil);
59extern int pil_q6v4_power_up(struct q6v4_data *drv);
60extern void pil_q6v4_power_down(struct q6v4_data *drv);
61extern int pil_q6v4_boot(struct pil_desc *pil);
62extern int pil_q6v4_shutdown(struct pil_desc *pil);
63
64extern int pil_q6v4_init_image_trusted(struct pil_desc *pil,
65 const u8 *metadata, size_t size);
66extern int pil_q6v4_boot_trusted(struct pil_desc *pil);
67extern int pil_q6v4_shutdown_trusted(struct pil_desc *pil);
68extern void __devinit
69pil_q6v4_init(struct q6v4_data *drv, const struct pil_q6v4_pdata *p);
70
Stephen Boydeb819882011-08-29 14:46:30 -070071#endif