1 /*
2  * exynos-nocp.h - EXYNOS NoC (Network on Chip) Probe header file
3  *
4  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
5  * Author : Chanwoo Choi <cw00.choi@samsung.com>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  */
11 
12 #ifndef __EXYNOS_NOCP_H__
13 #define __EXYNOS_NOCP_H__
14 
15 enum nocp_reg {
16 	NOCP_ID_REVISION_ID		= 0x04,
17 	NOCP_MAIN_CTL			= 0x08,
18 	NOCP_CFG_CTL			= 0x0C,
19 
20 	NOCP_STAT_PERIOD		= 0x24,
21 	NOCP_STAT_GO			= 0x28,
22 	NOCP_STAT_ALARM_MIN		= 0x2C,
23 	NOCP_STAT_ALARM_MAX		= 0x30,
24 	NOCP_STAT_ALARM_STATUS		= 0x34,
25 	NOCP_STAT_ALARM_CLR		= 0x38,
26 
27 	NOCP_COUNTERS_0_SRC		= 0x138,
28 	NOCP_COUNTERS_0_ALARM_MODE	= 0x13C,
29 	NOCP_COUNTERS_0_VAL		= 0x140,
30 
31 	NOCP_COUNTERS_1_SRC		= 0x14C,
32 	NOCP_COUNTERS_1_ALARM_MODE	= 0x150,
33 	NOCP_COUNTERS_1_VAL		= 0x154,
34 
35 	NOCP_COUNTERS_2_SRC		= 0x160,
36 	NOCP_COUNTERS_2_ALARM_MODE	= 0x164,
37 	NOCP_COUNTERS_2_VAL		= 0x168,
38 
39 	NOCP_COUNTERS_3_SRC		= 0x174,
40 	NOCP_COUNTERS_3_ALARM_MODE	= 0x178,
41 	NOCP_COUNTERS_3_VAL		= 0x17C,
42 };
43 
44 /* NOCP_MAIN_CTL register */
45 #define NOCP_MAIN_CTL_ERREN_MASK		BIT(0)
46 #define NOCP_MAIN_CTL_TRACEEN_MASK		BIT(1)
47 #define NOCP_MAIN_CTL_PAYLOADEN_MASK		BIT(2)
48 #define NOCP_MAIN_CTL_STATEN_MASK		BIT(3)
49 #define NOCP_MAIN_CTL_ALARMEN_MASK		BIT(4)
50 #define NOCP_MAIN_CTL_STATCONDDUMP_MASK	BIT(5)
51 #define NOCP_MAIN_CTL_INTRUSIVEMODE_MASK	BIT(6)
52 
53 /* NOCP_CFG_CTL register */
54 #define NOCP_CFG_CTL_GLOBALEN_MASK		BIT(0)
55 #define NOCP_CFG_CTL_ACTIVE_MASK		BIT(1)
56 
57 /* NOCP_COUNTERS_x_SRC register */
58 #define NOCP_CNT_SRC_INTEVENT_SHIFT		0
59 #define NOCP_CNT_SRC_INTEVENT_MASK		(0x1F << NOCP_CNT_SRC_INTEVENT_SHIFT)
60 #define NOCP_CNT_SRC_INTEVENT_OFF_MASK		(0x0 << NOCP_CNT_SRC_INTEVENT_SHIFT)
61 #define NOCP_CNT_SRC_INTEVENT_CYCLE_MASK	(0x1 << NOCP_CNT_SRC_INTEVENT_SHIFT)
62 #define NOCP_CNT_SRC_INTEVENT_IDLE_MASK		(0x2 << NOCP_CNT_SRC_INTEVENT_SHIFT)
63 #define NOCP_CNT_SRC_INTEVENT_XFER_MASK		(0x3 << NOCP_CNT_SRC_INTEVENT_SHIFT)
64 #define NOCP_CNT_SRC_INTEVENT_BUSY_MASK		(0x4 << NOCP_CNT_SRC_INTEVENT_SHIFT)
65 #define NOCP_CNT_SRC_INTEVENT_WAIT_MASK		(0x5 << NOCP_CNT_SRC_INTEVENT_SHIFT)
66 #define NOCP_CNT_SRC_INTEVENT_PKT_MASK		(0x6 << NOCP_CNT_SRC_INTEVENT_SHIFT)
67 #define NOCP_CNT_SRC_INTEVENT_BYTE_MASK		(0x8 << NOCP_CNT_SRC_INTEVENT_SHIFT)
68 #define NOCP_CNT_SRC_INTEVENT_CHAIN_MASK	(0x10 << NOCP_CNT_SRC_INTEVENT_SHIFT)
69 
70 /* NOCP_COUNTERS_x_ALARM_MODE register */
71 #define NOCP_CNT_ALARM_MODE_SHIFT		0
72 #define NOCP_CNT_ALARM_MODE_MASK		(0x3 << NOCP_CNT_ALARM_MODE_SHIFT)
73 #define NOCP_CNT_ALARM_MODE_OFF_MASK		(0x0 << NOCP_CNT_ALARM_MODE_SHIFT)
74 #define NOCP_CNT_ALARM_MODE_MIN_MASK		(0x1 << NOCP_CNT_ALARM_MODE_SHIFT)
75 #define NOCP_CNT_ALARM_MODE_MAX_MASK		(0x2 << NOCP_CNT_ALARM_MODE_SHIFT)
76 #define NOCP_CNT_ALARM_MODE_MIN_MAX_MASK	(0x3 << NOCP_CNT_ALARM_MODE_SHIFT)
77 
78 #endif /* __EXYNOS_NOCP_H__ */
79