162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * exynos-nocp.h - Exynos NoC (Network on Chip) Probe header file
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright (c) 2016 Samsung Electronics Co., Ltd.
662306a36Sopenharmony_ci * Author : Chanwoo Choi <cw00.choi@samsung.com>
762306a36Sopenharmony_ci */
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#ifndef __EXYNOS_NOCP_H__
1062306a36Sopenharmony_ci#define __EXYNOS_NOCP_H__
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_cienum nocp_reg {
1362306a36Sopenharmony_ci	NOCP_ID_REVISION_ID		= 0x04,
1462306a36Sopenharmony_ci	NOCP_MAIN_CTL			= 0x08,
1562306a36Sopenharmony_ci	NOCP_CFG_CTL			= 0x0C,
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci	NOCP_STAT_PERIOD		= 0x24,
1862306a36Sopenharmony_ci	NOCP_STAT_GO			= 0x28,
1962306a36Sopenharmony_ci	NOCP_STAT_ALARM_MIN		= 0x2C,
2062306a36Sopenharmony_ci	NOCP_STAT_ALARM_MAX		= 0x30,
2162306a36Sopenharmony_ci	NOCP_STAT_ALARM_STATUS		= 0x34,
2262306a36Sopenharmony_ci	NOCP_STAT_ALARM_CLR		= 0x38,
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci	NOCP_COUNTERS_0_SRC		= 0x138,
2562306a36Sopenharmony_ci	NOCP_COUNTERS_0_ALARM_MODE	= 0x13C,
2662306a36Sopenharmony_ci	NOCP_COUNTERS_0_VAL		= 0x140,
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci	NOCP_COUNTERS_1_SRC		= 0x14C,
2962306a36Sopenharmony_ci	NOCP_COUNTERS_1_ALARM_MODE	= 0x150,
3062306a36Sopenharmony_ci	NOCP_COUNTERS_1_VAL		= 0x154,
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci	NOCP_COUNTERS_2_SRC		= 0x160,
3362306a36Sopenharmony_ci	NOCP_COUNTERS_2_ALARM_MODE	= 0x164,
3462306a36Sopenharmony_ci	NOCP_COUNTERS_2_VAL		= 0x168,
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci	NOCP_COUNTERS_3_SRC		= 0x174,
3762306a36Sopenharmony_ci	NOCP_COUNTERS_3_ALARM_MODE	= 0x178,
3862306a36Sopenharmony_ci	NOCP_COUNTERS_3_VAL		= 0x17C,
3962306a36Sopenharmony_ci};
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci/* NOCP_MAIN_CTL register */
4262306a36Sopenharmony_ci#define NOCP_MAIN_CTL_ERREN_MASK		BIT(0)
4362306a36Sopenharmony_ci#define NOCP_MAIN_CTL_TRACEEN_MASK		BIT(1)
4462306a36Sopenharmony_ci#define NOCP_MAIN_CTL_PAYLOADEN_MASK		BIT(2)
4562306a36Sopenharmony_ci#define NOCP_MAIN_CTL_STATEN_MASK		BIT(3)
4662306a36Sopenharmony_ci#define NOCP_MAIN_CTL_ALARMEN_MASK		BIT(4)
4762306a36Sopenharmony_ci#define NOCP_MAIN_CTL_STATCONDDUMP_MASK	BIT(5)
4862306a36Sopenharmony_ci#define NOCP_MAIN_CTL_INTRUSIVEMODE_MASK	BIT(6)
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci/* NOCP_CFG_CTL register */
5162306a36Sopenharmony_ci#define NOCP_CFG_CTL_GLOBALEN_MASK		BIT(0)
5262306a36Sopenharmony_ci#define NOCP_CFG_CTL_ACTIVE_MASK		BIT(1)
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ci/* NOCP_COUNTERS_x_SRC register */
5562306a36Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_SHIFT		0
5662306a36Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_MASK		(0x1F << NOCP_CNT_SRC_INTEVENT_SHIFT)
5762306a36Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_OFF_MASK		(0x0 << NOCP_CNT_SRC_INTEVENT_SHIFT)
5862306a36Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_CYCLE_MASK	(0x1 << NOCP_CNT_SRC_INTEVENT_SHIFT)
5962306a36Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_IDLE_MASK		(0x2 << NOCP_CNT_SRC_INTEVENT_SHIFT)
6062306a36Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_XFER_MASK		(0x3 << NOCP_CNT_SRC_INTEVENT_SHIFT)
6162306a36Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_BUSY_MASK		(0x4 << NOCP_CNT_SRC_INTEVENT_SHIFT)
6262306a36Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_WAIT_MASK		(0x5 << NOCP_CNT_SRC_INTEVENT_SHIFT)
6362306a36Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_PKT_MASK		(0x6 << NOCP_CNT_SRC_INTEVENT_SHIFT)
6462306a36Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_BYTE_MASK		(0x8 << NOCP_CNT_SRC_INTEVENT_SHIFT)
6562306a36Sopenharmony_ci#define NOCP_CNT_SRC_INTEVENT_CHAIN_MASK	(0x10 << NOCP_CNT_SRC_INTEVENT_SHIFT)
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ci/* NOCP_COUNTERS_x_ALARM_MODE register */
6862306a36Sopenharmony_ci#define NOCP_CNT_ALARM_MODE_SHIFT		0
6962306a36Sopenharmony_ci#define NOCP_CNT_ALARM_MODE_MASK		(0x3 << NOCP_CNT_ALARM_MODE_SHIFT)
7062306a36Sopenharmony_ci#define NOCP_CNT_ALARM_MODE_OFF_MASK		(0x0 << NOCP_CNT_ALARM_MODE_SHIFT)
7162306a36Sopenharmony_ci#define NOCP_CNT_ALARM_MODE_MIN_MASK		(0x1 << NOCP_CNT_ALARM_MODE_SHIFT)
7262306a36Sopenharmony_ci#define NOCP_CNT_ALARM_MODE_MAX_MASK		(0x2 << NOCP_CNT_ALARM_MODE_SHIFT)
7362306a36Sopenharmony_ci#define NOCP_CNT_ALARM_MODE_MIN_MAX_MASK	(0x3 << NOCP_CNT_ALARM_MODE_SHIFT)
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ci#endif /* __EXYNOS_NOCP_H__ */
76