summaryrefstree
path: root/kernel/drivers/mhi/mhi_bhi.h
blob: 2fc34521f6248cea83259571b3b6ea8b03a79cc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 */
#ifndef _MHI_BHI_H
#define _MHI_BHI_H
#include "mhi.h"

/** BHI Offsets */
#define BHI_BHIVERSION_MINOR                               (0x00)
#define BHI_BHIVERSION_MAJOR                               (0x04)
#define BHI_IMGADDR_LOW                                    (0x08)
#define BHI_IMGADDR_HIGH                                   (0x0C)
#define BHI_IMGSIZE                                        (0x10)
#define BHI_RSVD1                                          (0x14)
#define BHI_IMGTXDB                                        (0x18)
#define BHI_RSVD2                                          (0x1C)
#define BHI_INTVEC                                         (0x20)
#define BHI_RSVD3                                          (0x24)
#define BHI_EXECENV                                        (0x28)
#define BHI_STATUS                                         (0x2C)
#define BHI_ERRCODE                                        (0x30)
#define BHI_ERRDBG1                                        (0x34)
#define BHI_ERRDBG2                                        (0x38)
#define BHI_ERRDBG3                                        (0x3C)
#define BHI_SERIALNUM                                      (0x40)
#define BHI_SBLANTIROLLVER                                 (0x44)
#define BHI_NUMSEG                                         (0x48)
#define BHI_MSMHWID(n)                                     (0x4C + 0x4 * (n))
#define BHI_OEMPKHASH(n)                                   (0x64 + 0x4 * (n))
#define BHI_RSVD5                                          (0xC4)

#define BHI_MAJOR_VERSION 0x0
#define BHI_MINOR_VERSION 0x1

#define MSMHWID_NUMDWORDS 6    /* Number of dwords that make the MSMHWID */
#define OEMPKHASH_NUMDWORDS 24 /* Number of dwords that make the OEM PK HASH */

#define BHI_READBUF_SIZE sizeof(bhi_info_type)

#define BHI_MAX_IMAGE_SIZE (256 * 1024)

#define BHI_POLL_SLEEP_TIME 1000
#define BHI_POLL_NR_RETRIES 1


int bhi_probe(mhi_pcie_dev_info *mhi_pcie_device);
int bhi_open(struct inode *mhi_inode, struct file *file_handle);
int bhi_release(struct inode *mhi_inode, struct file *file_handle);
ssize_t bhi_write(struct file *file, const char __user *buf,
		size_t count, loff_t *offp);

#endif