aboutsummaryrefslogtreecommitdiff
path: root/include/linux/project_info.h
blob: 81dee170bbee4c140aed0a54144c1030be2bd3aa (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#ifndef _PROJECT_INFO_H_
#define _PROJECT_INFO_H_ 1
typedef		__u32		uint32;
typedef     __u8        uint8;

/*******SECURE_BOOTn = 0x00786078+ 0x4*n, n=[1..14]******/
#define SECURE_BOOT_BASE		0x00786078
#define SECURE_BOOT1			(SECURE_BOOT_BASE + 0x4*1)
#define BUF_SIZE		64

#include <linux/string.h>
#include <linux/kallsyms.h>
//extern uint32_t chip_serial_num;

struct project_info {
    char project_name[8];  //eg, 16859
    uint32  hw_version;  //PCB number, T0, EVT
    uint32  rf_v1;   //v1 for mainboard_rf_version
    uint32  rf_v2;   //v2 for aboard_rf_version
    uint32  rf_v3;
    uint32  modem;
    uint32  operator;
    uint32  ddr_manufacture_info;
    uint32  ddr_row;
    uint32  ddr_column;
    uint32  ddr_fw_version;
    uint32  ddr_reserve_info;
    uint32  platform_id;
    uint32  ftm_uart_boot_mode;
    uint32  feature_id;
    uint32  a_board_version;
};

struct project_info_v2 {
	char project_name[8];  //eg, 15801
	char project_codename[20];
	char reservename[12];
	uint32  prj_version;
	uint32  hw_version;    //PCB number, T0, EVT
	uint32  rf_v1;
	uint32  rf_v2;
	uint32  rf_v3;
	uint32  uart_boot_mode;
	uint32  platform_id;
	uint32  ddr_manufacture_info;
	uint32  ddr_row;
	uint32  ddr_column;
	uint32  ddr_fw_version;
	uint32  ddr_reserve_info;
	uint32  ddr_type;
	uint32  reserve02; /*reserve for feture use*/
	uint32  reserve03;
	uint32  reserve04;
	uint32  reserve05;
	uint32  a_board_version;
	uint32  feature_id;
	uint32  ftm_uart_boot_mode;
	uint32  operator;
	uint32  modem;
};

#define DUMP_REASON_SIZE 256

struct dump_info{
    char    dump_reason[DUMP_REASON_SIZE];  //dump reason
};

struct component_info {
	char *version;
	char *manufacture;
};

enum{
	HW_VERSION__UNKNOWN,
	HW_VERSION__11 = 11,//all EVB
	HW_VERSION__12,	//T0
};

enum COMPONENT_TYPE {
	DDR,
	EMMC,
	F_CAMERA,
	R_CAMERA,
	SECOND_R_CAMERA,
	OIS,
	TP,
	LCD,
	WCN,
	I_SENSOR,
	G_SENSOR,
	M_SENSOR,
	GYRO,
	BACKLIGHT,
	MAINBOARD,
	/*Add new component here*/
	FINGERPRINTS,
	TOUCH_KEY,
	UFS,
	ABOARD,
	NFC,
	FAST_CHARGE,
	CPU,
    RF_VERSION,
	COMPONENT_MAX,
};

char *parse_function_builtin_return_address(unsigned long function_address);
int push_component_info(enum COMPONENT_TYPE type,
	char *version, char *manufacture);
int reset_component_info(enum COMPONENT_TYPE type);
uint32 get_hw_version(void);
void save_dump_reason_to_smem(char *info, char *function_name);


#endif