blob: 0395beda2b798cb3f2d6831bdbd97b4a56d5e75b [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;
24 const char *depends;
25 const unsigned pas_id;
Matt Wagantall6e4aafb2011-09-09 17:53:54 -070026 int bus_port;
Stephen Boydeb819882011-08-29 14:46:30 -070027};
Stephen Boydbdb53f32012-06-05 18:39:47 -070028
29struct clk;
30struct pil_device;
31struct regulator;
32
33/**
34 * struct q6v4_data - Q6 processor
35 */
36struct q6v4_data {
37 void __iomem *base;
Stephen Boyd2efa9962012-06-12 14:20:12 -070038 void __iomem *wdog_base;
Stephen Boydbdb53f32012-06-05 18:39:47 -070039 unsigned long start_addr;
40 unsigned long strap_tcm_base;
41 unsigned long strap_ahb_upper;
42 unsigned long strap_ahb_lower;
43 void __iomem *aclk_reg;
44 void __iomem *jtag_clk_reg;
45 unsigned pas_id;
46 int bus_port;
Stephen Boyd2efa9962012-06-12 14:20:12 -070047 int wdog_irq;
Stephen Boydbdb53f32012-06-05 18:39:47 -070048
49 struct regulator *vreg;
50 struct regulator *pll_supply;
51 bool vreg_enabled;
52 struct clk *xo;
53
54 struct pil_device *pil;
55 struct pil_desc desc;
56};
57
58#define pil_to_q6v4_data(p) container_of(p, struct q6v4_data, desc)
59
60extern int pil_q6v4_init_image(struct pil_desc *pil, const u8 *metadata,
61 size_t size);
62extern int pil_q6v4_make_proxy_votes(struct pil_desc *pil);
63extern void pil_q6v4_remove_proxy_votes(struct pil_desc *pil);
64extern int pil_q6v4_power_up(struct q6v4_data *drv);
65extern void pil_q6v4_power_down(struct q6v4_data *drv);
66extern int pil_q6v4_boot(struct pil_desc *pil);
67extern int pil_q6v4_shutdown(struct pil_desc *pil);
68
69extern int pil_q6v4_init_image_trusted(struct pil_desc *pil,
70 const u8 *metadata, size_t size);
71extern int pil_q6v4_boot_trusted(struct pil_desc *pil);
72extern int pil_q6v4_shutdown_trusted(struct pil_desc *pil);
73extern void __devinit
74pil_q6v4_init(struct q6v4_data *drv, const struct pil_q6v4_pdata *p);
75
Stephen Boydeb819882011-08-29 14:46:30 -070076#endif