18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * exynos-nocp.h - Exynos NoC (Network on Chip) Probe header file
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (c) 2016 Samsung Electronics Co., Ltd.
68c2ecf20Sopenharmony_ci * Author : Chanwoo Choi <cw00.choi@samsung.com>
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifndef __EXYNOS_NOCP_H__
108c2ecf20Sopenharmony_ci#define __EXYNOS_NOCP_H__
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_cienum nocp_reg {
138c2ecf20Sopenharmony_ci	NOCP_ID_REVISION_ID		= 0x04,
148c2ecf20Sopenharmony_ci	NOCP_MAIN_CTL			= 0x08,
158c2ecf20Sopenharmony_ci	NOCP_CFG_CTL			= 0x0C,
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci	NOCP_STAT_PERIOD		= 0x24,
188c2ecf20Sopenharmony_ci	NOCP_STAT_GO			= 0x28,
198c2ecf20Sopenharmony_ci	NOCP_STAT_ALARM_MIN		= 0x2C,
208c2ecf20Sopenharmony_ci	NOCP_STAT_ALARM_MAX		= 0x30,
218c2ecf20Sopenharmony_ci	NOCP_STAT_ALARM_STATUS		= 0x34,
228c2ecf20Sopenharmony_ci	NOCP_STAT_ALARM_CLR		= 0x38,
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci	NOCP_COUNTERS_0_SRC		= 0x138,
258c2ecf20Sopenharmony_ci	NOCP_COUNTERS_0_ALARM_MODE	= 0x13C,
268c2ecf20Sopenharmony_ci	NOCP_COUNTERS_0_VAL		= 0x140,
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci	NOCP_COUNTERS_1_SRC		= 0x14C,
298c2ecf20Sopenharmony_ci	NOCP_COUNTERS_1_ALARM_MODE	= 0x150,
308c2ecf20Sopenharmony_ci	NOCP_COUNTERS_1_VAL		= 0x154,
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci	NOCP_COUNTERS_2_SRC		= 0x160,
338c2ecf20Sopenharmony_ci	NOCP_COUNTERS_2_ALARM_MODE	= 0x164,
348c2ecf20Sopenharmony_ci	NOCP_COUNTERS_2_VAL		= 0x168,
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci	NOCP_COUNTERS_3_SRC		= 0x174,
378c2ecf20Sopenharmony_ci	NOCP_COUNTERS_3_ALARM_MODE	= 0x178,
388c2ecf20Sopenharmony_ci	NOCP_COUNTERS_3_VAL		= 0x17C,
398c2ecf20Sopenharmony_ci};
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci/* NOCP_MAIN_CTL register */
428c2ecf20Sopenharmony_ci#define NOCP_MAIN_CTL_ERREN_MASK		BIT(0)
438c2ecf20Sopenharmony_ci#define NOCP_MAIN_CTL_TRACEEN_MASK		BIT(1)
448c2ecf20Sopenharmony_ci#define NOCP_MAIN_CTL_PAYLOADEN_MASK		BIT(2)
458c2ecf20Sopenharmony_ci#define NOCP_MAIN_CTL_STATEN_MASK		BIT(3)
468c2ecf20Sopenharmony_ci#define NOCP_MAIN_CTL_ALARMEN_MASK		BIT(4)
478c2ecf20Sopenharmony_ci#define NOCP_MAIN_CTL_STATCONDDUMP_MASK	BIT(5)
488c2ecf20Sopenharmony_ci#define NOCP_MAIN_CTL_INTRUSIVEMODE_MASK	BIT(6)
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci/* NOCP_CFG_CTL register */
518c2ecf20Sopenharmony_ci#define NOCP_CFG_CTL_GLOBALEN_MASK		BIT(0)
528c2ecf20Sopenharmony_ci#define NOCP_CFG_CTL_ACTIVE_MASK		BIT(1)
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci/* NOCP_COUNTERS_x_SRC register */
558c2ecf20Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_SHIFT		0
568c2ecf20Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_MASK		(0x1F << NOCP_CNT_SRC_INTEVENT_SHIFT)
578c2ecf20Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_OFF_MASK		(0x0 << NOCP_CNT_SRC_INTEVENT_SHIFT)
588c2ecf20Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_CYCLE_MASK	(0x1 << NOCP_CNT_SRC_INTEVENT_SHIFT)
598c2ecf20Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_IDLE_MASK		(0x2 << NOCP_CNT_SRC_INTEVENT_SHIFT)
608c2ecf20Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_XFER_MASK		(0x3 << NOCP_CNT_SRC_INTEVENT_SHIFT)
618c2ecf20Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_BUSY_MASK		(0x4 << NOCP_CNT_SRC_INTEVENT_SHIFT)
628c2ecf20Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_WAIT_MASK		(0x5 << NOCP_CNT_SRC_INTEVENT_SHIFT)
638c2ecf20Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_PKT_MASK		(0x6 << NOCP_CNT_SRC_INTEVENT_SHIFT)
648c2ecf20Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_BYTE_MASK		(0x8 << NOCP_CNT_SRC_INTEVENT_SHIFT)
658c2ecf20Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_CHAIN_MASK	(0x10 << NOCP_CNT_SRC_INTEVENT_SHIFT)
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci/* NOCP_COUNTERS_x_ALARM_MODE register */
688c2ecf20Sopenharmony_ci#define NOCP_CNT_ALARM_MODE_SHIFT		0
698c2ecf20Sopenharmony_ci#define NOCP_CNT_ALARM_MODE_MASK		(0x3 << NOCP_CNT_ALARM_MODE_SHIFT)
708c2ecf20Sopenharmony_ci#define NOCP_CNT_ALARM_MODE_OFF_MASK		(0x0 << NOCP_CNT_ALARM_MODE_SHIFT)
718c2ecf20Sopenharmony_ci#define NOCP_CNT_ALARM_MODE_MIN_MASK		(0x1 << NOCP_CNT_ALARM_MODE_SHIFT)
728c2ecf20Sopenharmony_ci#define NOCP_CNT_ALARM_MODE_MAX_MASK		(0x2 << NOCP_CNT_ALARM_MODE_SHIFT)
738c2ecf20Sopenharmony_ci#define NOCP_CNT_ALARM_MODE_MIN_MAX_MASK	(0x3 << NOCP_CNT_ALARM_MODE_SHIFT)
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci#endif /* __EXYNOS_NOCP_H__ */
76