summaryrefstree
path: root/kernel/include/linux/sec_ext.h
blob: cea2011a03bcf20fe7049a5d0735913c24830fb8 (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
/* sec_ext.h
 *
 * Copyright (C) 2014 Samsung Electronics
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * 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.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 *
 */

#ifndef SEC_EXT_H
#define SEC_EXT_H

/*
 * PMU register offset : MUST MODIFY ACCORDING TO SoC
 */
#define EXYNOS_PMU_INFORM2 0x0808
#define EXYNOS_PMU_INFORM3 0x080C
#define EXYNOS_PMU_PS_HOLD_CONTROL 0x030C

/*
 * Bootstat @ /proc/boot_stat
 */
#ifdef CONFIG_SEC_BOOTSTAT
extern void sec_bootstat_mct_start(u64 t);
extern void sec_bootstat_add(const char *c);
extern void sec_bootstat_add_initcall(const char *name);

extern void sec_bootstat_get_cpuinfo(int *freq, int *online);
extern void sec_bootstat_get_thermal(int *temp);

#define DEVICE_INIT_TIME_100MS 100000
extern struct list_head device_init_time_list;

struct device_init_time_entry {
	struct list_head next;
	char *buf;
	unsigned long long duration;
};
#else
#define sec_bootstat_mct_start(a)		do { } while (0)
#define sec_bootstat_add(a)			do { } while (0)
#define sec_bootstat_add_initcall(a)		do { } while (0)

#define sec_bootstat_get_cpuinfo(a, b)		do { } while (0)
#define sec_bootstat_get_thermal(a)		do { } while (0)
#endif /* CONFIG_SEC_BOOT_STAT */

/*
 * Initcall log @ /proc/initcall_debug
 * show a sorted execution time list of initcalls.
 */
#ifdef CONFIG_SEC_INITCALL_DEBUG
#define SEC_INITCALL_DEBUG_MIN_TIME		10000
extern void sec_initcall_debug_add(initcall_t fn, unsigned long long t);
#else
#define sec_initcall_debug_add(a, b)		do { } while (0)
#endif /* CONFIG_SEC_INITCALL_DEBUG */

/*
 * Param op.
 */
#ifdef CONFIG_SEC_PARAM
#define CM_OFFSET				CONFIG_CM_OFFSET
#define CM_OFFSET_LIMIT			CM_OFFSET + 4
#define WC_OFFSET				CONFIG_WC_OFFSET
#define WC_OFFSET_LIMIT			WC_OFFSET
#define PD_OFFSET				CONFIG_PD_OFFSET
#define PD_OFFSET_LIMIT			PD_OFFSET + 4
#define FMM_LOCK_OFFSET			CONFIG_FMM_LOCK_OFFSET

enum {
	PARAM_OFF = '0',
	PARAM_ON = '1',
};

extern int sec_set_param(unsigned long offset, char val);
extern int sec_set_param_u32(unsigned long offset, u32 val);
extern int sec_set_param_str(unsigned long offset, const char *val, int size);
extern int sec_set_param_extra(unsigned long offset, void *extra, size_t size);
extern int sec_get_param_u32(unsigned long offset, u32 *val);
extern int sec_get_param_str(unsigned long offset, char *val);
#else
#define sec_set_param(a, b)			(-1)
#define sec_set_param_u32(a, b)			(-1)
#define sec_set_param_str(a, b, c)		(-1)
#define sec_set_param_extra(a, b, c)		(-1)
#define sec_get_param_u32(a, b)			(-1)
#define sec_get_param_str(a, b)			(-1)
#endif /* CONFIG_SEC_PARAM */

#endif /* CONFIG_SEC_EXT */