18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright 2014 Advanced Micro Devices, Inc.
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
58c2ecf20Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
68c2ecf20Sopenharmony_ci * to deal in the Software without restriction, including without limitation
78c2ecf20Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
88c2ecf20Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
98c2ecf20Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
108c2ecf20Sopenharmony_ci *
118c2ecf20Sopenharmony_ci * The above copyright notice and this permission notice shall be included in
128c2ecf20Sopenharmony_ci * all copies or substantial portions of the Software.
138c2ecf20Sopenharmony_ci *
148c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
158c2ecf20Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
168c2ecf20Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
178c2ecf20Sopenharmony_ci * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
188c2ecf20Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
198c2ecf20Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
208c2ecf20Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE.
218c2ecf20Sopenharmony_ci */
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci#ifndef CIK_REGS_H
248c2ecf20Sopenharmony_ci#define CIK_REGS_H
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci/* if PTR32, these are the bases for scratch and lds */
278c2ecf20Sopenharmony_ci#define	PRIVATE_BASE(x)					((x) << 0) /* scratch */
288c2ecf20Sopenharmony_ci#define	SHARED_BASE(x)					((x) << 16) /* LDS */
298c2ecf20Sopenharmony_ci#define	PTR32						(1 << 0)
308c2ecf20Sopenharmony_ci#define	ALIGNMENT_MODE(x)				((x) << 2)
318c2ecf20Sopenharmony_ci#define	SH_MEM_ALIGNMENT_MODE_UNALIGNED			3
328c2ecf20Sopenharmony_ci#define	DEFAULT_MTYPE(x)				((x) << 4)
338c2ecf20Sopenharmony_ci#define	APE1_MTYPE(x)					((x) << 7)
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci/* valid for both DEFAULT_MTYPE and APE1_MTYPE */
368c2ecf20Sopenharmony_ci#define	MTYPE_CACHED_NV					0
378c2ecf20Sopenharmony_ci#define	MTYPE_CACHED					1
388c2ecf20Sopenharmony_ci#define	MTYPE_NONCACHED					3
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci#define	DEFAULT_CP_HQD_PERSISTENT_STATE			(0x33U << 8)
418c2ecf20Sopenharmony_ci#define	PRELOAD_REQ					(1 << 0)
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci#define	MQD_CONTROL_PRIV_STATE_EN			(1U << 8)
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci#define	DEFAULT_MIN_IB_AVAIL_SIZE			(3U << 20)
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci#define	IB_ATC_EN					(1U << 23)
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci#define	QUANTUM_EN					1U
508c2ecf20Sopenharmony_ci#define	QUANTUM_SCALE_1MS				(1U << 4)
518c2ecf20Sopenharmony_ci#define	QUANTUM_DURATION(x)				((x) << 8)
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci#define	RPTR_BLOCK_SIZE(x)				((x) << 8)
548c2ecf20Sopenharmony_ci#define	MIN_AVAIL_SIZE(x)				((x) << 20)
558c2ecf20Sopenharmony_ci#define	DEFAULT_RPTR_BLOCK_SIZE				RPTR_BLOCK_SIZE(5)
568c2ecf20Sopenharmony_ci#define	DEFAULT_MIN_AVAIL_SIZE				MIN_AVAIL_SIZE(3)
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci#define	PQ_ATC_EN					(1 << 23)
598c2ecf20Sopenharmony_ci#define	NO_UPDATE_RPTR					(1 << 27)
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci#define	DOORBELL_OFFSET(x)				((x) << 2)
628c2ecf20Sopenharmony_ci#define	DOORBELL_EN					(1 << 30)
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci#define	PRIV_STATE					(1 << 30)
658c2ecf20Sopenharmony_ci#define	KMD_QUEUE					(1 << 31)
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci#define	AQL_ENABLE					1
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci#define GRBM_GFX_INDEX					0x30800
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci#endif
72