xref: /openbmc/linux/drivers/gpu/drm/amd/amdgpu/mmhub_v9_4.c (revision c900529f3d9161bfde5cca0754f83b4d3c3e0220)
12cb2ea1eSLe Ma /*
22cb2ea1eSLe Ma  * Copyright 2018 Advanced Micro Devices, Inc.
32cb2ea1eSLe Ma  *
42cb2ea1eSLe Ma  * Permission is hereby granted, free of charge, to any person obtaining a
52cb2ea1eSLe Ma  * copy of this software and associated documentation files (the "Software"),
62cb2ea1eSLe Ma  * to deal in the Software without restriction, including without limitation
72cb2ea1eSLe Ma  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
82cb2ea1eSLe Ma  * and/or sell copies of the Software, and to permit persons to whom the
92cb2ea1eSLe Ma  * Software is furnished to do so, subject to the following conditions:
102cb2ea1eSLe Ma  *
112cb2ea1eSLe Ma  * The above copyright notice and this permission notice shall be included in
122cb2ea1eSLe Ma  * all copies or substantial portions of the Software.
132cb2ea1eSLe Ma  *
142cb2ea1eSLe Ma  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
152cb2ea1eSLe Ma  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
162cb2ea1eSLe Ma  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
172cb2ea1eSLe Ma  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
182cb2ea1eSLe Ma  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
192cb2ea1eSLe Ma  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
202cb2ea1eSLe Ma  * OTHER DEALINGS IN THE SOFTWARE.
212cb2ea1eSLe Ma  *
222cb2ea1eSLe Ma  */
232cb2ea1eSLe Ma #include "amdgpu.h"
24f6c3623bSDennis Li #include "amdgpu_ras.h"
252cb2ea1eSLe Ma #include "mmhub_v9_4.h"
262cb2ea1eSLe Ma 
272cb2ea1eSLe Ma #include "mmhub/mmhub_9_4_1_offset.h"
282cb2ea1eSLe Ma #include "mmhub/mmhub_9_4_1_sh_mask.h"
292cb2ea1eSLe Ma #include "mmhub/mmhub_9_4_1_default.h"
302cb2ea1eSLe Ma #include "athub/athub_1_0_offset.h"
312cb2ea1eSLe Ma #include "athub/athub_1_0_sh_mask.h"
322cb2ea1eSLe Ma #include "vega10_enum.h"
33f6c3623bSDennis Li #include "soc15.h"
342cb2ea1eSLe Ma #include "soc15_common.h"
352cb2ea1eSLe Ma 
362cb2ea1eSLe Ma #define MMHUB_NUM_INSTANCES			2
372cb2ea1eSLe Ma #define MMHUB_INSTANCE_REGISTER_OFFSET		0x3000
382cb2ea1eSLe Ma 
mmhub_v9_4_get_fb_location(struct amdgpu_device * adev)399fb1506eSOak Zeng static u64 mmhub_v9_4_get_fb_location(struct amdgpu_device *adev)
402cb2ea1eSLe Ma {
412cb2ea1eSLe Ma 	/* The base should be same b/t 2 mmhubs on Acrturus. Read one here. */
422cb2ea1eSLe Ma 	u64 base = RREG32_SOC15(MMHUB, 0, mmVMSHAREDVC0_MC_VM_FB_LOCATION_BASE);
436c54afc7SLe Ma 	u64 top = RREG32_SOC15(MMHUB, 0, mmVMSHAREDVC0_MC_VM_FB_LOCATION_TOP);
442cb2ea1eSLe Ma 
452cb2ea1eSLe Ma 	base &= VMSHAREDVC0_MC_VM_FB_LOCATION_BASE__FB_BASE_MASK;
462cb2ea1eSLe Ma 	base <<= 24;
472cb2ea1eSLe Ma 
486c54afc7SLe Ma 	top &= VMSHAREDVC0_MC_VM_FB_LOCATION_TOP__FB_TOP_MASK;
496c54afc7SLe Ma 	top <<= 24;
506c54afc7SLe Ma 
516c54afc7SLe Ma 	adev->gmc.fb_start = base;
526c54afc7SLe Ma 	adev->gmc.fb_end = top;
536c54afc7SLe Ma 
542cb2ea1eSLe Ma 	return base;
552cb2ea1eSLe Ma }
562cb2ea1eSLe Ma 
mmhub_v9_4_setup_hubid_vm_pt_regs(struct amdgpu_device * adev,int hubid,uint32_t vmid,uint64_t value)576dcab16bSYong Zhao static void mmhub_v9_4_setup_hubid_vm_pt_regs(struct amdgpu_device *adev, int hubid,
586d5311abSYong Zhao 				uint32_t vmid, uint64_t value)
592cb2ea1eSLe Ma {
60*f4caf584SHawking Zhang 	struct amdgpu_vmhub *hub = &adev->vmhub[AMDGPU_MMHUB0(0)];
612cb2ea1eSLe Ma 
622cb2ea1eSLe Ma 	WREG32_SOC15_OFFSET(MMHUB, 0,
632cb2ea1eSLe Ma 			    mmVML2VC0_VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_LO32,
64714ec7a2SHuang Rui 			    hub->ctx_addr_distance * vmid + hubid * MMHUB_INSTANCE_REGISTER_OFFSET,
652cb2ea1eSLe Ma 			    lower_32_bits(value));
662cb2ea1eSLe Ma 
672cb2ea1eSLe Ma 	WREG32_SOC15_OFFSET(MMHUB, 0,
682cb2ea1eSLe Ma 			    mmVML2VC0_VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32,
69714ec7a2SHuang Rui 			    hub->ctx_addr_distance * vmid + hubid * MMHUB_INSTANCE_REGISTER_OFFSET,
702cb2ea1eSLe Ma 			    upper_32_bits(value));
712cb2ea1eSLe Ma 
722cb2ea1eSLe Ma }
732cb2ea1eSLe Ma 
mmhub_v9_4_init_gart_aperture_regs(struct amdgpu_device * adev,int hubid)742cb2ea1eSLe Ma static void mmhub_v9_4_init_gart_aperture_regs(struct amdgpu_device *adev,
752cb2ea1eSLe Ma 					       int hubid)
762cb2ea1eSLe Ma {
776d5311abSYong Zhao 	uint64_t pt_base = amdgpu_gmc_pd_addr(adev->gart.bo);
786d5311abSYong Zhao 
796dcab16bSYong Zhao 	mmhub_v9_4_setup_hubid_vm_pt_regs(adev, hubid, 0, pt_base);
802cb2ea1eSLe Ma 
812cb2ea1eSLe Ma 	WREG32_SOC15_OFFSET(MMHUB, 0,
822cb2ea1eSLe Ma 			    mmVML2VC0_VM_CONTEXT0_PAGE_TABLE_START_ADDR_LO32,
832cb2ea1eSLe Ma 			    hubid * MMHUB_INSTANCE_REGISTER_OFFSET,
842cb2ea1eSLe Ma 			    (u32)(adev->gmc.gart_start >> 12));
852cb2ea1eSLe Ma 	WREG32_SOC15_OFFSET(MMHUB, 0,
862cb2ea1eSLe Ma 			    mmVML2VC0_VM_CONTEXT0_PAGE_TABLE_START_ADDR_HI32,
872cb2ea1eSLe Ma 			    hubid * MMHUB_INSTANCE_REGISTER_OFFSET,
882cb2ea1eSLe Ma 			    (u32)(adev->gmc.gart_start >> 44));
892cb2ea1eSLe Ma 
902cb2ea1eSLe Ma 	WREG32_SOC15_OFFSET(MMHUB, 0,
912cb2ea1eSLe Ma 			    mmVML2VC0_VM_CONTEXT0_PAGE_TABLE_END_ADDR_LO32,
922cb2ea1eSLe Ma 			    hubid * MMHUB_INSTANCE_REGISTER_OFFSET,
932cb2ea1eSLe Ma 			    (u32)(adev->gmc.gart_end >> 12));
942cb2ea1eSLe Ma 	WREG32_SOC15_OFFSET(MMHUB, 0,
952cb2ea1eSLe Ma 			    mmVML2VC0_VM_CONTEXT0_PAGE_TABLE_END_ADDR_HI32,
962cb2ea1eSLe Ma 			    hubid * MMHUB_INSTANCE_REGISTER_OFFSET,
972cb2ea1eSLe Ma 			    (u32)(adev->gmc.gart_end >> 44));
982cb2ea1eSLe Ma }
992cb2ea1eSLe Ma 
mmhub_v9_4_setup_vm_pt_regs(struct amdgpu_device * adev,uint32_t vmid,uint64_t page_table_base)1009fb1506eSOak Zeng static void mmhub_v9_4_setup_vm_pt_regs(struct amdgpu_device *adev, uint32_t vmid,
1016dcab16bSYong Zhao 				uint64_t page_table_base)
1026dcab16bSYong Zhao {
1036dcab16bSYong Zhao 	int i;
1046dcab16bSYong Zhao 
1056dcab16bSYong Zhao 	for (i = 0; i < MMHUB_NUM_INSTANCES; i++)
1066dcab16bSYong Zhao 		mmhub_v9_4_setup_hubid_vm_pt_regs(adev, i, vmid,
1076dcab16bSYong Zhao 				page_table_base);
1086dcab16bSYong Zhao }
1096dcab16bSYong Zhao 
mmhub_v9_4_init_system_aperture_regs(struct amdgpu_device * adev,int hubid)1102cb2ea1eSLe Ma static void mmhub_v9_4_init_system_aperture_regs(struct amdgpu_device *adev,
1112cb2ea1eSLe Ma 						int hubid)
1122cb2ea1eSLe Ma {
1132cb2ea1eSLe Ma 	uint64_t value;
1142cb2ea1eSLe Ma 	uint32_t tmp;
1152cb2ea1eSLe Ma 
1162cb2ea1eSLe Ma 	/* Program the AGP BAR */
1172cb2ea1eSLe Ma 	WREG32_SOC15_OFFSET(MMHUB, 0, mmVMSHAREDVC0_MC_VM_AGP_BASE,
1182cb2ea1eSLe Ma 			    hubid * MMHUB_INSTANCE_REGISTER_OFFSET,
1192cb2ea1eSLe Ma 			    0);
1202cb2ea1eSLe Ma 	WREG32_SOC15_OFFSET(MMHUB, 0, mmVMSHAREDVC0_MC_VM_AGP_TOP,
1212cb2ea1eSLe Ma 			    hubid * MMHUB_INSTANCE_REGISTER_OFFSET,
1222cb2ea1eSLe Ma 			    adev->gmc.agp_end >> 24);
1232cb2ea1eSLe Ma 	WREG32_SOC15_OFFSET(MMHUB, 0, mmVMSHAREDVC0_MC_VM_AGP_BOT,
1242cb2ea1eSLe Ma 			    hubid * MMHUB_INSTANCE_REGISTER_OFFSET,
1252cb2ea1eSLe Ma 			    adev->gmc.agp_start >> 24);
1262cb2ea1eSLe Ma 
12720bf2f6fSZhigang Luo 	if (!amdgpu_sriov_vf(adev)) {
1282cb2ea1eSLe Ma 		/* Program the system aperture low logical page number. */
12920bf2f6fSZhigang Luo 		WREG32_SOC15_OFFSET(
13020bf2f6fSZhigang Luo 			MMHUB, 0, mmVMSHAREDVC0_MC_VM_SYSTEM_APERTURE_LOW_ADDR,
1312cb2ea1eSLe Ma 			hubid * MMHUB_INSTANCE_REGISTER_OFFSET,
1327d0670f4SLe Ma 			min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18);
13320bf2f6fSZhigang Luo 		WREG32_SOC15_OFFSET(
13420bf2f6fSZhigang Luo 			MMHUB, 0, mmVMSHAREDVC0_MC_VM_SYSTEM_APERTURE_HIGH_ADDR,
1352cb2ea1eSLe Ma 			hubid * MMHUB_INSTANCE_REGISTER_OFFSET,
1367d0670f4SLe Ma 			max(adev->gmc.fb_end, adev->gmc.agp_end) >> 18);
1372cb2ea1eSLe Ma 
1382cb2ea1eSLe Ma 		/* Set default page address. */
1397ccfd79fSChristian König 		value = amdgpu_gmc_vram_mc2pa(adev, adev->mem_scratch.gpu_addr);
14020bf2f6fSZhigang Luo 		WREG32_SOC15_OFFSET(
14120bf2f6fSZhigang Luo 			MMHUB, 0,
1422cb2ea1eSLe Ma 			mmVMSHAREDPF0_MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB,
1432cb2ea1eSLe Ma 			hubid * MMHUB_INSTANCE_REGISTER_OFFSET,
1442cb2ea1eSLe Ma 			(u32)(value >> 12));
14520bf2f6fSZhigang Luo 		WREG32_SOC15_OFFSET(
14620bf2f6fSZhigang Luo 			MMHUB, 0,
1472cb2ea1eSLe Ma 			mmVMSHAREDPF0_MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB,
1482cb2ea1eSLe Ma 			hubid * MMHUB_INSTANCE_REGISTER_OFFSET,
1492cb2ea1eSLe Ma 			(u32)(value >> 44));
1502cb2ea1eSLe Ma 
1512cb2ea1eSLe Ma 		/* Program "protection fault". */
15220bf2f6fSZhigang Luo 		WREG32_SOC15_OFFSET(
15320bf2f6fSZhigang Luo 			MMHUB, 0,
1542cb2ea1eSLe Ma 			mmVML2PF0_VM_L2_PROTECTION_FAULT_DEFAULT_ADDR_LO32,
1552cb2ea1eSLe Ma 			hubid * MMHUB_INSTANCE_REGISTER_OFFSET,
1562cb2ea1eSLe Ma 			(u32)(adev->dummy_page_addr >> 12));
15720bf2f6fSZhigang Luo 		WREG32_SOC15_OFFSET(
15820bf2f6fSZhigang Luo 			MMHUB, 0,
1592cb2ea1eSLe Ma 			mmVML2PF0_VM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32,
1602cb2ea1eSLe Ma 			hubid * MMHUB_INSTANCE_REGISTER_OFFSET,
1612cb2ea1eSLe Ma 			(u32)((u64)adev->dummy_page_addr >> 44));
1622cb2ea1eSLe Ma 
16320bf2f6fSZhigang Luo 		tmp = RREG32_SOC15_OFFSET(
16420bf2f6fSZhigang Luo 			MMHUB, 0, mmVML2PF0_VM_L2_PROTECTION_FAULT_CNTL2,
1652cb2ea1eSLe Ma 			hubid * MMHUB_INSTANCE_REGISTER_OFFSET);
1662cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_PROTECTION_FAULT_CNTL2,
1672cb2ea1eSLe Ma 				    ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY, 1);
16820bf2f6fSZhigang Luo 		WREG32_SOC15_OFFSET(MMHUB, 0,
16920bf2f6fSZhigang Luo 				    mmVML2PF0_VM_L2_PROTECTION_FAULT_CNTL2,
17020bf2f6fSZhigang Luo 				    hubid * MMHUB_INSTANCE_REGISTER_OFFSET,
17120bf2f6fSZhigang Luo 				    tmp);
17220bf2f6fSZhigang Luo 	}
1732cb2ea1eSLe Ma }
1742cb2ea1eSLe Ma 
mmhub_v9_4_init_tlb_regs(struct amdgpu_device * adev,int hubid)1752cb2ea1eSLe Ma static void mmhub_v9_4_init_tlb_regs(struct amdgpu_device *adev, int hubid)
1762cb2ea1eSLe Ma {
1772cb2ea1eSLe Ma 	uint32_t tmp;
1782cb2ea1eSLe Ma 
1792cb2ea1eSLe Ma 	/* Setup TLB control */
1802cb2ea1eSLe Ma 	tmp = RREG32_SOC15_OFFSET(MMHUB, 0,
1812cb2ea1eSLe Ma 			   mmVMSHAREDVC0_MC_VM_MX_L1_TLB_CNTL,
1822cb2ea1eSLe Ma 			   hubid * MMHUB_INSTANCE_REGISTER_OFFSET);
1832cb2ea1eSLe Ma 
1842cb2ea1eSLe Ma 	tmp = REG_SET_FIELD(tmp, VMSHAREDVC0_MC_VM_MX_L1_TLB_CNTL,
1852cb2ea1eSLe Ma 			    ENABLE_L1_TLB, 1);
1862cb2ea1eSLe Ma 	tmp = REG_SET_FIELD(tmp, VMSHAREDVC0_MC_VM_MX_L1_TLB_CNTL,
1872cb2ea1eSLe Ma 			    SYSTEM_ACCESS_MODE, 3);
1882cb2ea1eSLe Ma 	tmp = REG_SET_FIELD(tmp, VMSHAREDVC0_MC_VM_MX_L1_TLB_CNTL,
1892cb2ea1eSLe Ma 			    ENABLE_ADVANCED_DRIVER_MODEL, 1);
1902cb2ea1eSLe Ma 	tmp = REG_SET_FIELD(tmp, VMSHAREDVC0_MC_VM_MX_L1_TLB_CNTL,
1912cb2ea1eSLe Ma 			    SYSTEM_APERTURE_UNMAPPED_ACCESS, 0);
1922cb2ea1eSLe Ma 	tmp = REG_SET_FIELD(tmp, VMSHAREDVC0_MC_VM_MX_L1_TLB_CNTL,
1932cb2ea1eSLe Ma 			    MTYPE, MTYPE_UC);/* XXX for emulation. */
1942cb2ea1eSLe Ma 	tmp = REG_SET_FIELD(tmp, VMSHAREDVC0_MC_VM_MX_L1_TLB_CNTL,
1952cb2ea1eSLe Ma 			    ATC_EN, 1);
1962cb2ea1eSLe Ma 
1972cb2ea1eSLe Ma 	WREG32_SOC15_OFFSET(MMHUB, 0, mmVMSHAREDVC0_MC_VM_MX_L1_TLB_CNTL,
1982cb2ea1eSLe Ma 			    hubid * MMHUB_INSTANCE_REGISTER_OFFSET, tmp);
1992cb2ea1eSLe Ma }
2002cb2ea1eSLe Ma 
mmhub_v9_4_init_cache_regs(struct amdgpu_device * adev,int hubid)2012cb2ea1eSLe Ma static void mmhub_v9_4_init_cache_regs(struct amdgpu_device *adev, int hubid)
2022cb2ea1eSLe Ma {
2032cb2ea1eSLe Ma 	uint32_t tmp;
2042cb2ea1eSLe Ma 
2052cb2ea1eSLe Ma 	/* Setup L2 cache */
2062cb2ea1eSLe Ma 	tmp = RREG32_SOC15_OFFSET(MMHUB, 0, mmVML2PF0_VM_L2_CNTL,
2072cb2ea1eSLe Ma 				  hubid * MMHUB_INSTANCE_REGISTER_OFFSET);
2082cb2ea1eSLe Ma 	tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_CNTL,
2092cb2ea1eSLe Ma 			    ENABLE_L2_CACHE, 1);
2102cb2ea1eSLe Ma 	tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_CNTL,
2112cb2ea1eSLe Ma 			    ENABLE_L2_FRAGMENT_PROCESSING, 1);
2122cb2ea1eSLe Ma 	/* XXX for emulation, Refer to closed source code.*/
2132cb2ea1eSLe Ma 	tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_CNTL,
2142cb2ea1eSLe Ma 			    L2_PDE0_CACHE_TAG_GENERATION_MODE, 0);
2152cb2ea1eSLe Ma 	tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_CNTL,
216c9ffdf5aSYong Zhao 			    PDE_FAULT_CLASSIFICATION, 0);
2172cb2ea1eSLe Ma 	tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_CNTL,
2182cb2ea1eSLe Ma 			    CONTEXT1_IDENTITY_ACCESS_MODE, 1);
2192cb2ea1eSLe Ma 	tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_CNTL,
2202cb2ea1eSLe Ma 			    IDENTITY_MODE_FRAGMENT_SIZE, 0);
2212cb2ea1eSLe Ma 	WREG32_SOC15_OFFSET(MMHUB, 0, mmVML2PF0_VM_L2_CNTL,
2222cb2ea1eSLe Ma 		     hubid * MMHUB_INSTANCE_REGISTER_OFFSET, tmp);
2232cb2ea1eSLe Ma 
2242cb2ea1eSLe Ma 	tmp = RREG32_SOC15_OFFSET(MMHUB, 0, mmVML2PF0_VM_L2_CNTL2,
2252cb2ea1eSLe Ma 				  hubid * MMHUB_INSTANCE_REGISTER_OFFSET);
2262cb2ea1eSLe Ma 	tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_CNTL2,
2272cb2ea1eSLe Ma 			    INVALIDATE_ALL_L1_TLBS, 1);
2282cb2ea1eSLe Ma 	tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_CNTL2,
2292cb2ea1eSLe Ma 			    INVALIDATE_L2_CACHE, 1);
2302cb2ea1eSLe Ma 	WREG32_SOC15_OFFSET(MMHUB, 0, mmVML2PF0_VM_L2_CNTL2,
2312cb2ea1eSLe Ma 			    hubid * MMHUB_INSTANCE_REGISTER_OFFSET, tmp);
2322cb2ea1eSLe Ma 
2332cb2ea1eSLe Ma 	tmp = mmVML2PF0_VM_L2_CNTL3_DEFAULT;
234e2f619aaSAlex Deucher 	if (adev->gmc.translate_further) {
235e2f619aaSAlex Deucher 		tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_CNTL3, BANK_SELECT, 12);
236e2f619aaSAlex Deucher 		tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_CNTL3,
237e2f619aaSAlex Deucher 				    L2_CACHE_BIGK_FRAGMENT_SIZE, 9);
238e2f619aaSAlex Deucher 	} else {
239e2f619aaSAlex Deucher 		tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_CNTL3, BANK_SELECT, 9);
240e2f619aaSAlex Deucher 		tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_CNTL3,
241e2f619aaSAlex Deucher 				    L2_CACHE_BIGK_FRAGMENT_SIZE, 6);
242e2f619aaSAlex Deucher 	}
2432cb2ea1eSLe Ma 	WREG32_SOC15_OFFSET(MMHUB, 0, mmVML2PF0_VM_L2_CNTL3,
2442cb2ea1eSLe Ma 			    hubid * MMHUB_INSTANCE_REGISTER_OFFSET, tmp);
2452cb2ea1eSLe Ma 
2462cb2ea1eSLe Ma 	tmp = mmVML2PF0_VM_L2_CNTL4_DEFAULT;
2472cb2ea1eSLe Ma 	tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_CNTL4,
2482cb2ea1eSLe Ma 			    VMC_TAP_PDE_REQUEST_PHYSICAL, 0);
2492cb2ea1eSLe Ma 	tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_CNTL4,
2502cb2ea1eSLe Ma 			    VMC_TAP_PTE_REQUEST_PHYSICAL, 0);
2512cb2ea1eSLe Ma 	WREG32_SOC15_OFFSET(MMHUB, 0, mmVML2PF0_VM_L2_CNTL4,
2522cb2ea1eSLe Ma 			    hubid * MMHUB_INSTANCE_REGISTER_OFFSET, tmp);
2532cb2ea1eSLe Ma }
2542cb2ea1eSLe Ma 
mmhub_v9_4_enable_system_domain(struct amdgpu_device * adev,int hubid)2552cb2ea1eSLe Ma static void mmhub_v9_4_enable_system_domain(struct amdgpu_device *adev,
2562cb2ea1eSLe Ma 					    int hubid)
2572cb2ea1eSLe Ma {
2582cb2ea1eSLe Ma 	uint32_t tmp;
2592cb2ea1eSLe Ma 
2602cb2ea1eSLe Ma 	tmp = RREG32_SOC15_OFFSET(MMHUB, 0, mmVML2VC0_VM_CONTEXT0_CNTL,
2612cb2ea1eSLe Ma 				  hubid * MMHUB_INSTANCE_REGISTER_OFFSET);
2622cb2ea1eSLe Ma 	tmp = REG_SET_FIELD(tmp, VML2VC0_VM_CONTEXT0_CNTL, ENABLE_CONTEXT, 1);
2632cb2ea1eSLe Ma 	tmp = REG_SET_FIELD(tmp, VML2VC0_VM_CONTEXT0_CNTL, PAGE_TABLE_DEPTH, 0);
2647cae7061SFelix Kuehling 	tmp = REG_SET_FIELD(tmp, VML2VC0_VM_CONTEXT0_CNTL,
2657cae7061SFelix Kuehling 			    RETRY_PERMISSION_OR_INVALID_PAGE_FAULT, 0);
2662cb2ea1eSLe Ma 	WREG32_SOC15_OFFSET(MMHUB, 0, mmVML2VC0_VM_CONTEXT0_CNTL,
2672cb2ea1eSLe Ma 			    hubid * MMHUB_INSTANCE_REGISTER_OFFSET, tmp);
2682cb2ea1eSLe Ma }
2692cb2ea1eSLe Ma 
mmhub_v9_4_disable_identity_aperture(struct amdgpu_device * adev,int hubid)2702cb2ea1eSLe Ma static void mmhub_v9_4_disable_identity_aperture(struct amdgpu_device *adev,
2712cb2ea1eSLe Ma 						 int hubid)
2722cb2ea1eSLe Ma {
2732cb2ea1eSLe Ma 	WREG32_SOC15_OFFSET(MMHUB, 0,
2742cb2ea1eSLe Ma 		    mmVML2PF0_VM_L2_CONTEXT1_IDENTITY_APERTURE_LOW_ADDR_LO32,
2752cb2ea1eSLe Ma 		    hubid * MMHUB_INSTANCE_REGISTER_OFFSET, 0XFFFFFFFF);
2762cb2ea1eSLe Ma 	WREG32_SOC15_OFFSET(MMHUB, 0,
2772cb2ea1eSLe Ma 		    mmVML2PF0_VM_L2_CONTEXT1_IDENTITY_APERTURE_LOW_ADDR_HI32,
2782cb2ea1eSLe Ma 		    hubid * MMHUB_INSTANCE_REGISTER_OFFSET, 0x0000000F);
2792cb2ea1eSLe Ma 
2802cb2ea1eSLe Ma 	WREG32_SOC15_OFFSET(MMHUB, 0,
2812cb2ea1eSLe Ma 		    mmVML2PF0_VM_L2_CONTEXT1_IDENTITY_APERTURE_HIGH_ADDR_LO32,
2822cb2ea1eSLe Ma 		    hubid * MMHUB_INSTANCE_REGISTER_OFFSET, 0);
2832cb2ea1eSLe Ma 	WREG32_SOC15_OFFSET(MMHUB, 0,
2842cb2ea1eSLe Ma 		    mmVML2PF0_VM_L2_CONTEXT1_IDENTITY_APERTURE_HIGH_ADDR_HI32,
2852cb2ea1eSLe Ma 		    hubid * MMHUB_INSTANCE_REGISTER_OFFSET, 0);
2862cb2ea1eSLe Ma 
2872cb2ea1eSLe Ma 	WREG32_SOC15_OFFSET(MMHUB, 0,
2882cb2ea1eSLe Ma 		    mmVML2PF0_VM_L2_CONTEXT_IDENTITY_PHYSICAL_OFFSET_LO32,
2892cb2ea1eSLe Ma 		    hubid * MMHUB_INSTANCE_REGISTER_OFFSET, 0);
2902cb2ea1eSLe Ma 	WREG32_SOC15_OFFSET(MMHUB, 0,
2912cb2ea1eSLe Ma 		    mmVML2PF0_VM_L2_CONTEXT_IDENTITY_PHYSICAL_OFFSET_HI32,
2922cb2ea1eSLe Ma 		    hubid * MMHUB_INSTANCE_REGISTER_OFFSET, 0);
2932cb2ea1eSLe Ma }
2942cb2ea1eSLe Ma 
mmhub_v9_4_setup_vmid_config(struct amdgpu_device * adev,int hubid)2952cb2ea1eSLe Ma static void mmhub_v9_4_setup_vmid_config(struct amdgpu_device *adev, int hubid)
2962cb2ea1eSLe Ma {
297*f4caf584SHawking Zhang 	struct amdgpu_vmhub *hub = &adev->vmhub[AMDGPU_MMHUB0(0)];
298894c9c54SMukul Joshi 	unsigned int num_level, block_size;
2992cb2ea1eSLe Ma 	uint32_t tmp;
3002cb2ea1eSLe Ma 	int i;
3012cb2ea1eSLe Ma 
302894c9c54SMukul Joshi 	num_level = adev->vm_manager.num_level;
303894c9c54SMukul Joshi 	block_size = adev->vm_manager.block_size;
304894c9c54SMukul Joshi 	if (adev->gmc.translate_further)
305894c9c54SMukul Joshi 		num_level -= 1;
306894c9c54SMukul Joshi 	else
307894c9c54SMukul Joshi 		block_size -= 9;
308894c9c54SMukul Joshi 
3092cb2ea1eSLe Ma 	for (i = 0; i <= 14; i++) {
3102cb2ea1eSLe Ma 		tmp = RREG32_SOC15_OFFSET(MMHUB, 0, mmVML2VC0_VM_CONTEXT1_CNTL,
3112cb2ea1eSLe Ma 				hubid * MMHUB_INSTANCE_REGISTER_OFFSET + i);
3122cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2VC0_VM_CONTEXT1_CNTL,
3132cb2ea1eSLe Ma 				    ENABLE_CONTEXT, 1);
3142cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2VC0_VM_CONTEXT1_CNTL,
3152cb2ea1eSLe Ma 				    PAGE_TABLE_DEPTH,
316894c9c54SMukul Joshi 				    num_level);
3172cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2VC0_VM_CONTEXT1_CNTL,
3182cb2ea1eSLe Ma 				    RANGE_PROTECTION_FAULT_ENABLE_DEFAULT, 1);
3192cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2VC0_VM_CONTEXT1_CNTL,
3202cb2ea1eSLe Ma 				    DUMMY_PAGE_PROTECTION_FAULT_ENABLE_DEFAULT,
3212cb2ea1eSLe Ma 				    1);
3222cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2VC0_VM_CONTEXT1_CNTL,
3232cb2ea1eSLe Ma 				    PDE0_PROTECTION_FAULT_ENABLE_DEFAULT, 1);
3242cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2VC0_VM_CONTEXT1_CNTL,
3252cb2ea1eSLe Ma 				    VALID_PROTECTION_FAULT_ENABLE_DEFAULT, 1);
3262cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2VC0_VM_CONTEXT1_CNTL,
3272cb2ea1eSLe Ma 				    READ_PROTECTION_FAULT_ENABLE_DEFAULT, 1);
3282cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2VC0_VM_CONTEXT1_CNTL,
3292cb2ea1eSLe Ma 				    WRITE_PROTECTION_FAULT_ENABLE_DEFAULT, 1);
3302cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2VC0_VM_CONTEXT1_CNTL,
3312cb2ea1eSLe Ma 				    EXECUTE_PROTECTION_FAULT_ENABLE_DEFAULT, 1);
3322cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2VC0_VM_CONTEXT1_CNTL,
3332cb2ea1eSLe Ma 				    PAGE_TABLE_BLOCK_SIZE,
334894c9c54SMukul Joshi 				    block_size);
3352cb2ea1eSLe Ma 		/* Send no-retry XNACK on fault to suppress VM fault storm. */
3362cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2VC0_VM_CONTEXT1_CNTL,
3373d3f9ba8SOak Zeng 				    RETRY_PERMISSION_OR_INVALID_PAGE_FAULT,
3389b498efaSAlex Deucher 				    !adev->gmc.noretry);
3392cb2ea1eSLe Ma 		WREG32_SOC15_OFFSET(MMHUB, 0, mmVML2VC0_VM_CONTEXT1_CNTL,
340714ec7a2SHuang Rui 				    hubid * MMHUB_INSTANCE_REGISTER_OFFSET +
341714ec7a2SHuang Rui 				    i * hub->ctx_distance, tmp);
3422cb2ea1eSLe Ma 		WREG32_SOC15_OFFSET(MMHUB, 0,
3432cb2ea1eSLe Ma 			    mmVML2VC0_VM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32,
344714ec7a2SHuang Rui 			    hubid * MMHUB_INSTANCE_REGISTER_OFFSET +
345714ec7a2SHuang Rui 			    i * hub->ctx_addr_distance, 0);
3462cb2ea1eSLe Ma 		WREG32_SOC15_OFFSET(MMHUB, 0,
3472cb2ea1eSLe Ma 			    mmVML2VC0_VM_CONTEXT1_PAGE_TABLE_START_ADDR_HI32,
348714ec7a2SHuang Rui 			    hubid * MMHUB_INSTANCE_REGISTER_OFFSET +
349714ec7a2SHuang Rui 			    i * hub->ctx_addr_distance, 0);
3502cb2ea1eSLe Ma 		WREG32_SOC15_OFFSET(MMHUB, 0,
3512cb2ea1eSLe Ma 				mmVML2VC0_VM_CONTEXT1_PAGE_TABLE_END_ADDR_LO32,
352714ec7a2SHuang Rui 				hubid * MMHUB_INSTANCE_REGISTER_OFFSET +
353714ec7a2SHuang Rui 				i * hub->ctx_addr_distance,
3542cb2ea1eSLe Ma 				lower_32_bits(adev->vm_manager.max_pfn - 1));
3552cb2ea1eSLe Ma 		WREG32_SOC15_OFFSET(MMHUB, 0,
3562cb2ea1eSLe Ma 				mmVML2VC0_VM_CONTEXT1_PAGE_TABLE_END_ADDR_HI32,
357714ec7a2SHuang Rui 				hubid * MMHUB_INSTANCE_REGISTER_OFFSET +
358714ec7a2SHuang Rui 				i * hub->ctx_addr_distance,
3592cb2ea1eSLe Ma 				upper_32_bits(adev->vm_manager.max_pfn - 1));
3602cb2ea1eSLe Ma 	}
3612cb2ea1eSLe Ma }
3622cb2ea1eSLe Ma 
mmhub_v9_4_program_invalidation(struct amdgpu_device * adev,int hubid)3632cb2ea1eSLe Ma static void mmhub_v9_4_program_invalidation(struct amdgpu_device *adev,
3642cb2ea1eSLe Ma 					    int hubid)
3652cb2ea1eSLe Ma {
366*f4caf584SHawking Zhang 	struct amdgpu_vmhub *hub = &adev->vmhub[AMDGPU_MMHUB0(0)];
3672cb2ea1eSLe Ma 	unsigned i;
3682cb2ea1eSLe Ma 
3692cb2ea1eSLe Ma 	for (i = 0; i < 18; ++i) {
3702cb2ea1eSLe Ma 		WREG32_SOC15_OFFSET(MMHUB, 0,
3712cb2ea1eSLe Ma 				mmVML2VC0_VM_INVALIDATE_ENG0_ADDR_RANGE_LO32,
372714ec7a2SHuang Rui 				hubid * MMHUB_INSTANCE_REGISTER_OFFSET +
373714ec7a2SHuang Rui 				i * hub->eng_addr_distance,
3742cb2ea1eSLe Ma 				0xffffffff);
3752cb2ea1eSLe Ma 		WREG32_SOC15_OFFSET(MMHUB, 0,
3762cb2ea1eSLe Ma 				mmVML2VC0_VM_INVALIDATE_ENG0_ADDR_RANGE_HI32,
377714ec7a2SHuang Rui 				hubid * MMHUB_INSTANCE_REGISTER_OFFSET +
378714ec7a2SHuang Rui 				i * hub->eng_addr_distance,
3792cb2ea1eSLe Ma 				0x1f);
3802cb2ea1eSLe Ma 	}
3812cb2ea1eSLe Ma }
3822cb2ea1eSLe Ma 
mmhub_v9_4_gart_enable(struct amdgpu_device * adev)3839fb1506eSOak Zeng static int mmhub_v9_4_gart_enable(struct amdgpu_device *adev)
3842cb2ea1eSLe Ma {
3852cb2ea1eSLe Ma 	int i;
3862cb2ea1eSLe Ma 
3872cb2ea1eSLe Ma 	for (i = 0; i < MMHUB_NUM_INSTANCES; i++) {
3882cb2ea1eSLe Ma 		/* GART Enable. */
3892cb2ea1eSLe Ma 		mmhub_v9_4_init_gart_aperture_regs(adev, i);
3902cb2ea1eSLe Ma 		mmhub_v9_4_init_system_aperture_regs(adev, i);
3912cb2ea1eSLe Ma 		mmhub_v9_4_init_tlb_regs(adev, i);
39220bf2f6fSZhigang Luo 		if (!amdgpu_sriov_vf(adev))
3932cb2ea1eSLe Ma 			mmhub_v9_4_init_cache_regs(adev, i);
3942cb2ea1eSLe Ma 
3952cb2ea1eSLe Ma 		mmhub_v9_4_enable_system_domain(adev, i);
39620bf2f6fSZhigang Luo 		if (!amdgpu_sriov_vf(adev))
3972cb2ea1eSLe Ma 			mmhub_v9_4_disable_identity_aperture(adev, i);
3982cb2ea1eSLe Ma 		mmhub_v9_4_setup_vmid_config(adev, i);
3992cb2ea1eSLe Ma 		mmhub_v9_4_program_invalidation(adev, i);
4002cb2ea1eSLe Ma 	}
4012cb2ea1eSLe Ma 
4022cb2ea1eSLe Ma 	return 0;
4032cb2ea1eSLe Ma }
4042cb2ea1eSLe Ma 
mmhub_v9_4_gart_disable(struct amdgpu_device * adev)4059fb1506eSOak Zeng static void mmhub_v9_4_gart_disable(struct amdgpu_device *adev)
4062cb2ea1eSLe Ma {
407*f4caf584SHawking Zhang 	struct amdgpu_vmhub *hub = &adev->vmhub[AMDGPU_MMHUB0(0)];
4082cb2ea1eSLe Ma 	u32 tmp;
4092cb2ea1eSLe Ma 	u32 i, j;
4102cb2ea1eSLe Ma 
4112cb2ea1eSLe Ma 	for (j = 0; j < MMHUB_NUM_INSTANCES; j++) {
4122cb2ea1eSLe Ma 		/* Disable all tables */
41368fce5f0SNirmoy Das 		for (i = 0; i < AMDGPU_NUM_VMID; i++)
4142cb2ea1eSLe Ma 			WREG32_SOC15_OFFSET(MMHUB, 0,
4152cb2ea1eSLe Ma 					    mmVML2VC0_VM_CONTEXT0_CNTL,
4162cb2ea1eSLe Ma 					    j * MMHUB_INSTANCE_REGISTER_OFFSET +
417714ec7a2SHuang Rui 					    i * hub->ctx_distance, 0);
4182cb2ea1eSLe Ma 
4192cb2ea1eSLe Ma 		/* Setup TLB control */
4202cb2ea1eSLe Ma 		tmp = RREG32_SOC15_OFFSET(MMHUB, 0,
4212cb2ea1eSLe Ma 				   mmVMSHAREDVC0_MC_VM_MX_L1_TLB_CNTL,
4222cb2ea1eSLe Ma 				   j * MMHUB_INSTANCE_REGISTER_OFFSET);
4232cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VMSHAREDVC0_MC_VM_MX_L1_TLB_CNTL,
4242cb2ea1eSLe Ma 				    ENABLE_L1_TLB, 0);
4252cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp,
4262cb2ea1eSLe Ma 				    VMSHAREDVC0_MC_VM_MX_L1_TLB_CNTL,
4272cb2ea1eSLe Ma 				    ENABLE_ADVANCED_DRIVER_MODEL, 0);
4282cb2ea1eSLe Ma 		WREG32_SOC15_OFFSET(MMHUB, 0,
4292cb2ea1eSLe Ma 				    mmVMSHAREDVC0_MC_VM_MX_L1_TLB_CNTL,
4302cb2ea1eSLe Ma 				    j * MMHUB_INSTANCE_REGISTER_OFFSET, tmp);
4312cb2ea1eSLe Ma 
4322cb2ea1eSLe Ma 		/* Setup L2 cache */
4332cb2ea1eSLe Ma 		tmp = RREG32_SOC15_OFFSET(MMHUB, 0, mmVML2PF0_VM_L2_CNTL,
4342cb2ea1eSLe Ma 					  j * MMHUB_INSTANCE_REGISTER_OFFSET);
4352cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_CNTL,
4362cb2ea1eSLe Ma 				    ENABLE_L2_CACHE, 0);
4372cb2ea1eSLe Ma 		WREG32_SOC15_OFFSET(MMHUB, 0, mmVML2PF0_VM_L2_CNTL,
4382cb2ea1eSLe Ma 				    j * MMHUB_INSTANCE_REGISTER_OFFSET, tmp);
4392cb2ea1eSLe Ma 		WREG32_SOC15_OFFSET(MMHUB, 0, mmVML2PF0_VM_L2_CNTL3,
4402cb2ea1eSLe Ma 				    j * MMHUB_INSTANCE_REGISTER_OFFSET, 0);
4412cb2ea1eSLe Ma 	}
4422cb2ea1eSLe Ma }
4432cb2ea1eSLe Ma 
4442cb2ea1eSLe Ma /**
4455f7d8ee7SLee Jones  * mmhub_v9_4_set_fault_enable_default - update GART/VM fault handling
4462cb2ea1eSLe Ma  *
4472cb2ea1eSLe Ma  * @adev: amdgpu_device pointer
4482cb2ea1eSLe Ma  * @value: true redirects VM faults to the default page
4492cb2ea1eSLe Ma  */
mmhub_v9_4_set_fault_enable_default(struct amdgpu_device * adev,bool value)4509fb1506eSOak Zeng static void mmhub_v9_4_set_fault_enable_default(struct amdgpu_device *adev, bool value)
4512cb2ea1eSLe Ma {
4522cb2ea1eSLe Ma 	u32 tmp;
4532cb2ea1eSLe Ma 	int i;
4542cb2ea1eSLe Ma 
4552cb2ea1eSLe Ma 	for (i = 0; i < MMHUB_NUM_INSTANCES; i++) {
4562cb2ea1eSLe Ma 		tmp = RREG32_SOC15_OFFSET(MMHUB, 0,
4572cb2ea1eSLe Ma 					  mmVML2PF0_VM_L2_PROTECTION_FAULT_CNTL,
4582cb2ea1eSLe Ma 					  i * MMHUB_INSTANCE_REGISTER_OFFSET);
4592cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_PROTECTION_FAULT_CNTL,
4602cb2ea1eSLe Ma 				    RANGE_PROTECTION_FAULT_ENABLE_DEFAULT,
4612cb2ea1eSLe Ma 				    value);
4622cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_PROTECTION_FAULT_CNTL,
4632cb2ea1eSLe Ma 				    PDE0_PROTECTION_FAULT_ENABLE_DEFAULT,
4642cb2ea1eSLe Ma 				    value);
4652cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_PROTECTION_FAULT_CNTL,
4662cb2ea1eSLe Ma 				    PDE1_PROTECTION_FAULT_ENABLE_DEFAULT,
4672cb2ea1eSLe Ma 				    value);
4682cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_PROTECTION_FAULT_CNTL,
4692cb2ea1eSLe Ma 				    PDE2_PROTECTION_FAULT_ENABLE_DEFAULT,
4702cb2ea1eSLe Ma 				    value);
4712cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp,
4722cb2ea1eSLe Ma 			    VML2PF0_VM_L2_PROTECTION_FAULT_CNTL,
4732cb2ea1eSLe Ma 			    TRANSLATE_FURTHER_PROTECTION_FAULT_ENABLE_DEFAULT,
4742cb2ea1eSLe Ma 			    value);
4752cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_PROTECTION_FAULT_CNTL,
4762cb2ea1eSLe Ma 				    NACK_PROTECTION_FAULT_ENABLE_DEFAULT,
4772cb2ea1eSLe Ma 				    value);
4782cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_PROTECTION_FAULT_CNTL,
4792cb2ea1eSLe Ma 				    DUMMY_PAGE_PROTECTION_FAULT_ENABLE_DEFAULT,
4802cb2ea1eSLe Ma 				    value);
4812cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_PROTECTION_FAULT_CNTL,
4822cb2ea1eSLe Ma 				    VALID_PROTECTION_FAULT_ENABLE_DEFAULT,
4832cb2ea1eSLe Ma 				    value);
4842cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_PROTECTION_FAULT_CNTL,
4852cb2ea1eSLe Ma 				    READ_PROTECTION_FAULT_ENABLE_DEFAULT,
4862cb2ea1eSLe Ma 				    value);
4872cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_PROTECTION_FAULT_CNTL,
4882cb2ea1eSLe Ma 				    WRITE_PROTECTION_FAULT_ENABLE_DEFAULT,
4892cb2ea1eSLe Ma 				    value);
4902cb2ea1eSLe Ma 		tmp = REG_SET_FIELD(tmp, VML2PF0_VM_L2_PROTECTION_FAULT_CNTL,
4912cb2ea1eSLe Ma 				    EXECUTE_PROTECTION_FAULT_ENABLE_DEFAULT,
4922cb2ea1eSLe Ma 				    value);
4932cb2ea1eSLe Ma 		if (!value) {
4942cb2ea1eSLe Ma 			tmp = REG_SET_FIELD(tmp,
4952cb2ea1eSLe Ma 					    VML2PF0_VM_L2_PROTECTION_FAULT_CNTL,
4962cb2ea1eSLe Ma 					    CRASH_ON_NO_RETRY_FAULT, 1);
4972cb2ea1eSLe Ma 			tmp = REG_SET_FIELD(tmp,
4982cb2ea1eSLe Ma 					    VML2PF0_VM_L2_PROTECTION_FAULT_CNTL,
4992cb2ea1eSLe Ma 					    CRASH_ON_RETRY_FAULT, 1);
5002cb2ea1eSLe Ma 		}
5012cb2ea1eSLe Ma 
5022cb2ea1eSLe Ma 		WREG32_SOC15_OFFSET(MMHUB, 0,
5032cb2ea1eSLe Ma 				    mmVML2PF0_VM_L2_PROTECTION_FAULT_CNTL,
5042cb2ea1eSLe Ma 				    i * MMHUB_INSTANCE_REGISTER_OFFSET, tmp);
5052cb2ea1eSLe Ma 	}
5062cb2ea1eSLe Ma }
5072cb2ea1eSLe Ma 
mmhub_v9_4_init(struct amdgpu_device * adev)5089fb1506eSOak Zeng static void mmhub_v9_4_init(struct amdgpu_device *adev)
5092cb2ea1eSLe Ma {
510*f4caf584SHawking Zhang 	struct amdgpu_vmhub *hub[MMHUB_NUM_INSTANCES] = {
511*f4caf584SHawking Zhang 		&adev->vmhub[AMDGPU_MMHUB0(0)], &adev->vmhub[AMDGPU_MMHUB1(0)]};
5122cb2ea1eSLe Ma 	int i;
5132cb2ea1eSLe Ma 
5142cb2ea1eSLe Ma 	for (i = 0; i < MMHUB_NUM_INSTANCES; i++) {
5152cb2ea1eSLe Ma 		hub[i]->ctx0_ptb_addr_lo32 =
5162cb2ea1eSLe Ma 			SOC15_REG_OFFSET(MMHUB, 0,
5172cb2ea1eSLe Ma 			    mmVML2VC0_VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_LO32) +
5182cb2ea1eSLe Ma 			    i * MMHUB_INSTANCE_REGISTER_OFFSET;
5192cb2ea1eSLe Ma 		hub[i]->ctx0_ptb_addr_hi32 =
5202cb2ea1eSLe Ma 			SOC15_REG_OFFSET(MMHUB, 0,
5212cb2ea1eSLe Ma 			    mmVML2VC0_VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32) +
5222cb2ea1eSLe Ma 			    i * MMHUB_INSTANCE_REGISTER_OFFSET;
523dab5ef27Schangzhu 		hub[i]->vm_inv_eng0_sem =
524dab5ef27Schangzhu 			SOC15_REG_OFFSET(MMHUB, 0,
525dab5ef27Schangzhu 					 mmVML2VC0_VM_INVALIDATE_ENG0_SEM) +
526dab5ef27Schangzhu 					 i * MMHUB_INSTANCE_REGISTER_OFFSET;
5272cb2ea1eSLe Ma 		hub[i]->vm_inv_eng0_req =
5282cb2ea1eSLe Ma 			SOC15_REG_OFFSET(MMHUB, 0,
5292cb2ea1eSLe Ma 					 mmVML2VC0_VM_INVALIDATE_ENG0_REQ) +
5302cb2ea1eSLe Ma 					 i * MMHUB_INSTANCE_REGISTER_OFFSET;
5312cb2ea1eSLe Ma 		hub[i]->vm_inv_eng0_ack =
5322cb2ea1eSLe Ma 			SOC15_REG_OFFSET(MMHUB, 0,
5332cb2ea1eSLe Ma 					 mmVML2VC0_VM_INVALIDATE_ENG0_ACK) +
5342cb2ea1eSLe Ma 					 i * MMHUB_INSTANCE_REGISTER_OFFSET;
5352cb2ea1eSLe Ma 		hub[i]->vm_context0_cntl =
5362cb2ea1eSLe Ma 			SOC15_REG_OFFSET(MMHUB, 0,
5372cb2ea1eSLe Ma 					 mmVML2VC0_VM_CONTEXT0_CNTL) +
5382cb2ea1eSLe Ma 					 i * MMHUB_INSTANCE_REGISTER_OFFSET;
5392cb2ea1eSLe Ma 		hub[i]->vm_l2_pro_fault_status =
5402cb2ea1eSLe Ma 			SOC15_REG_OFFSET(MMHUB, 0,
5412cb2ea1eSLe Ma 				    mmVML2PF0_VM_L2_PROTECTION_FAULT_STATUS) +
5422cb2ea1eSLe Ma 				    i * MMHUB_INSTANCE_REGISTER_OFFSET;
5432cb2ea1eSLe Ma 		hub[i]->vm_l2_pro_fault_cntl =
5442cb2ea1eSLe Ma 			SOC15_REG_OFFSET(MMHUB, 0,
5452cb2ea1eSLe Ma 				    mmVML2PF0_VM_L2_PROTECTION_FAULT_CNTL) +
5462cb2ea1eSLe Ma 				    i * MMHUB_INSTANCE_REGISTER_OFFSET;
5471f9d56c3SHuang Rui 
5481f9d56c3SHuang Rui 		hub[i]->ctx_distance = mmVML2VC0_VM_CONTEXT1_CNTL -
5491f9d56c3SHuang Rui 			mmVML2VC0_VM_CONTEXT0_CNTL;
5501f9d56c3SHuang Rui 		hub[i]->ctx_addr_distance = mmVML2VC0_VM_CONTEXT1_PAGE_TABLE_BASE_ADDR_LO32 -
5511f9d56c3SHuang Rui 			mmVML2VC0_VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_LO32;
5521f9d56c3SHuang Rui 		hub[i]->eng_distance = mmVML2VC0_VM_INVALIDATE_ENG1_REQ -
5531f9d56c3SHuang Rui 			mmVML2VC0_VM_INVALIDATE_ENG0_REQ;
5541f9d56c3SHuang Rui 		hub[i]->eng_addr_distance = mmVML2VC0_VM_INVALIDATE_ENG1_ADDR_RANGE_LO32 -
5551f9d56c3SHuang Rui 			mmVML2VC0_VM_INVALIDATE_ENG0_ADDR_RANGE_LO32;
5562cb2ea1eSLe Ma 	}
5572cb2ea1eSLe Ma }
558cb15e804SLe Ma 
mmhub_v9_4_update_medium_grain_clock_gating(struct amdgpu_device * adev,bool enable)559cb15e804SLe Ma static void mmhub_v9_4_update_medium_grain_clock_gating(struct amdgpu_device *adev,
560cb15e804SLe Ma 							bool enable)
561cb15e804SLe Ma {
562cb15e804SLe Ma 	uint32_t def, data, def1, data1;
563cb15e804SLe Ma 	int i, j;
564cb15e804SLe Ma 	int dist = mmDAGB1_CNTL_MISC2 - mmDAGB0_CNTL_MISC2;
565cb15e804SLe Ma 
566cb15e804SLe Ma 	for (i = 0; i < MMHUB_NUM_INSTANCES; i++) {
567cb15e804SLe Ma 		def = data = RREG32_SOC15_OFFSET(MMHUB, 0,
568cb15e804SLe Ma 					mmATCL2_0_ATC_L2_MISC_CG,
569cb15e804SLe Ma 					i * MMHUB_INSTANCE_REGISTER_OFFSET);
570cb15e804SLe Ma 
571cb15e804SLe Ma 		if (enable && (adev->cg_flags & AMD_CG_SUPPORT_MC_MGCG))
572cb15e804SLe Ma 			data |= ATCL2_0_ATC_L2_MISC_CG__ENABLE_MASK;
573cb15e804SLe Ma 		else
574cb15e804SLe Ma 			data &= ~ATCL2_0_ATC_L2_MISC_CG__ENABLE_MASK;
575cb15e804SLe Ma 
576cb15e804SLe Ma 		if (def != data)
577cb15e804SLe Ma 			WREG32_SOC15_OFFSET(MMHUB, 0, mmATCL2_0_ATC_L2_MISC_CG,
578cb15e804SLe Ma 				i * MMHUB_INSTANCE_REGISTER_OFFSET, data);
579cb15e804SLe Ma 
580cb15e804SLe Ma 		for (j = 0; j < 5; j++) {
581cb15e804SLe Ma 			def1 = data1 = RREG32_SOC15_OFFSET(MMHUB, 0,
582cb15e804SLe Ma 					mmDAGB0_CNTL_MISC2,
583cb15e804SLe Ma 					i * MMHUB_INSTANCE_REGISTER_OFFSET +
584cb15e804SLe Ma 					j * dist);
585cb15e804SLe Ma 			if (enable &&
586cb15e804SLe Ma 			    (adev->cg_flags & AMD_CG_SUPPORT_MC_MGCG)) {
587cb15e804SLe Ma 				data1 &=
588cb15e804SLe Ma 				    ~(DAGB0_CNTL_MISC2__DISABLE_WRREQ_CG_MASK |
589cb15e804SLe Ma 				    DAGB0_CNTL_MISC2__DISABLE_WRRET_CG_MASK |
590cb15e804SLe Ma 				    DAGB0_CNTL_MISC2__DISABLE_RDREQ_CG_MASK |
591cb15e804SLe Ma 				    DAGB0_CNTL_MISC2__DISABLE_RDRET_CG_MASK |
592cb15e804SLe Ma 				    DAGB0_CNTL_MISC2__DISABLE_TLBWR_CG_MASK |
593cb15e804SLe Ma 				    DAGB0_CNTL_MISC2__DISABLE_TLBRD_CG_MASK);
594cb15e804SLe Ma 			} else {
595cb15e804SLe Ma 				data1 |=
596cb15e804SLe Ma 				    (DAGB0_CNTL_MISC2__DISABLE_WRREQ_CG_MASK |
597cb15e804SLe Ma 				    DAGB0_CNTL_MISC2__DISABLE_WRRET_CG_MASK |
598cb15e804SLe Ma 				    DAGB0_CNTL_MISC2__DISABLE_RDREQ_CG_MASK |
599cb15e804SLe Ma 				    DAGB0_CNTL_MISC2__DISABLE_RDRET_CG_MASK |
600cb15e804SLe Ma 				    DAGB0_CNTL_MISC2__DISABLE_TLBWR_CG_MASK |
601cb15e804SLe Ma 				    DAGB0_CNTL_MISC2__DISABLE_TLBRD_CG_MASK);
602cb15e804SLe Ma 			}
603cb15e804SLe Ma 
604cb15e804SLe Ma 			if (def1 != data1)
605cb15e804SLe Ma 				WREG32_SOC15_OFFSET(MMHUB, 0,
606cb15e804SLe Ma 					mmDAGB0_CNTL_MISC2,
607cb15e804SLe Ma 					i * MMHUB_INSTANCE_REGISTER_OFFSET +
608cb15e804SLe Ma 					j * dist, data1);
609cb15e804SLe Ma 
610cb15e804SLe Ma 			if (i == 1 && j == 3)
611cb15e804SLe Ma 				break;
612cb15e804SLe Ma 		}
613cb15e804SLe Ma 	}
614cb15e804SLe Ma }
615cb15e804SLe Ma 
mmhub_v9_4_update_medium_grain_light_sleep(struct amdgpu_device * adev,bool enable)616cb15e804SLe Ma static void mmhub_v9_4_update_medium_grain_light_sleep(struct amdgpu_device *adev,
617cb15e804SLe Ma 						       bool enable)
618cb15e804SLe Ma {
619cb15e804SLe Ma 	uint32_t def, data;
620cb15e804SLe Ma 	int i;
621cb15e804SLe Ma 
622cb15e804SLe Ma 	for (i = 0; i < MMHUB_NUM_INSTANCES; i++) {
623cb15e804SLe Ma 		def = data = RREG32_SOC15_OFFSET(MMHUB, 0,
624cb15e804SLe Ma 					mmATCL2_0_ATC_L2_MISC_CG,
625cb15e804SLe Ma 					i * MMHUB_INSTANCE_REGISTER_OFFSET);
626cb15e804SLe Ma 
627cb15e804SLe Ma 		if (enable && (adev->cg_flags & AMD_CG_SUPPORT_MC_LS))
628cb15e804SLe Ma 			data |= ATCL2_0_ATC_L2_MISC_CG__MEM_LS_ENABLE_MASK;
629cb15e804SLe Ma 		else
630cb15e804SLe Ma 			data &= ~ATCL2_0_ATC_L2_MISC_CG__MEM_LS_ENABLE_MASK;
631cb15e804SLe Ma 
632cb15e804SLe Ma 		if (def != data)
633cb15e804SLe Ma 			WREG32_SOC15_OFFSET(MMHUB, 0, mmATCL2_0_ATC_L2_MISC_CG,
634cb15e804SLe Ma 				i * MMHUB_INSTANCE_REGISTER_OFFSET, data);
635cb15e804SLe Ma 	}
636cb15e804SLe Ma }
637cb15e804SLe Ma 
mmhub_v9_4_set_clockgating(struct amdgpu_device * adev,enum amd_clockgating_state state)6389fb1506eSOak Zeng static int mmhub_v9_4_set_clockgating(struct amdgpu_device *adev,
639cb15e804SLe Ma 			       enum amd_clockgating_state state)
640cb15e804SLe Ma {
641cb15e804SLe Ma 	if (amdgpu_sriov_vf(adev))
642cb15e804SLe Ma 		return 0;
643cb15e804SLe Ma 
644cb15e804SLe Ma 	switch (adev->asic_type) {
645cb15e804SLe Ma 	case CHIP_ARCTURUS:
646cb15e804SLe Ma 		mmhub_v9_4_update_medium_grain_clock_gating(adev,
647a9d4fe2fSNirmoy Das 				state == AMD_CG_STATE_GATE);
648cb15e804SLe Ma 		mmhub_v9_4_update_medium_grain_light_sleep(adev,
649a9d4fe2fSNirmoy Das 				state == AMD_CG_STATE_GATE);
650cb15e804SLe Ma 		break;
651cb15e804SLe Ma 	default:
652cb15e804SLe Ma 		break;
653cb15e804SLe Ma 	}
654cb15e804SLe Ma 
655cb15e804SLe Ma 	return 0;
656cb15e804SLe Ma }
657cb15e804SLe Ma 
mmhub_v9_4_get_clockgating(struct amdgpu_device * adev,u64 * flags)65825faeddcSEvan Quan static void mmhub_v9_4_get_clockgating(struct amdgpu_device *adev, u64 *flags)
659cb15e804SLe Ma {
660cb15e804SLe Ma 	int data, data1;
661cb15e804SLe Ma 
662cb15e804SLe Ma 	if (amdgpu_sriov_vf(adev))
663cb15e804SLe Ma 		*flags = 0;
664cb15e804SLe Ma 
665cb15e804SLe Ma 	/* AMD_CG_SUPPORT_MC_MGCG */
666cb15e804SLe Ma 	data = RREG32_SOC15(MMHUB, 0, mmATCL2_0_ATC_L2_MISC_CG);
667cb15e804SLe Ma 
668cb15e804SLe Ma 	data1 = RREG32_SOC15(MMHUB, 0, mmATCL2_0_ATC_L2_MISC_CG);
669cb15e804SLe Ma 
670cb15e804SLe Ma 	if ((data & ATCL2_0_ATC_L2_MISC_CG__ENABLE_MASK) &&
671cb15e804SLe Ma 	    !(data1 & (DAGB0_CNTL_MISC2__DISABLE_WRREQ_CG_MASK |
672cb15e804SLe Ma 		       DAGB0_CNTL_MISC2__DISABLE_WRRET_CG_MASK |
673cb15e804SLe Ma 		       DAGB0_CNTL_MISC2__DISABLE_RDREQ_CG_MASK |
674cb15e804SLe Ma 		       DAGB0_CNTL_MISC2__DISABLE_RDRET_CG_MASK |
675cb15e804SLe Ma 		       DAGB0_CNTL_MISC2__DISABLE_TLBWR_CG_MASK |
676cb15e804SLe Ma 		       DAGB0_CNTL_MISC2__DISABLE_TLBRD_CG_MASK)))
677cb15e804SLe Ma 		*flags |= AMD_CG_SUPPORT_MC_MGCG;
678cb15e804SLe Ma 
679cb15e804SLe Ma 	/* AMD_CG_SUPPORT_MC_LS */
680cb15e804SLe Ma 	if (data & ATCL2_0_ATC_L2_MISC_CG__MEM_LS_ENABLE_MASK)
681cb15e804SLe Ma 		*flags |= AMD_CG_SUPPORT_MC_LS;
682cb15e804SLe Ma }
683f6c3623bSDennis Li 
684f6c3623bSDennis Li static const struct soc15_ras_field_entry mmhub_v9_4_ras_fields[] = {
68539aa0ef1SDennis Li 	/* MMHUB Range 0 */
686f6c3623bSDennis Li 	{ "MMEA0_DRAMRD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT),
687f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT, DRAMRD_CMDMEM_SEC_COUNT),
688f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT, DRAMRD_CMDMEM_DED_COUNT),
689f6c3623bSDennis Li 	},
690f6c3623bSDennis Li 	{ "MMEA0_DRAMWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT),
691f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT, DRAMWR_CMDMEM_SEC_COUNT),
692f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT, DRAMWR_CMDMEM_DED_COUNT),
693f6c3623bSDennis Li 	},
694f6c3623bSDennis Li 	{ "MMEA0_DRAMWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT),
695f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT, DRAMWR_DATAMEM_SEC_COUNT),
696f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT, DRAMWR_DATAMEM_DED_COUNT),
697f6c3623bSDennis Li 	},
698f6c3623bSDennis Li 	{ "MMEA0_RRET_TAGMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT),
699f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT, RRET_TAGMEM_SEC_COUNT),
700f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT, RRET_TAGMEM_DED_COUNT),
701f6c3623bSDennis Li 	},
702f6c3623bSDennis Li 	{ "MMEA0_WRET_TAGMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT),
703f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT, WRET_TAGMEM_SEC_COUNT),
704f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT, WRET_TAGMEM_DED_COUNT),
705f6c3623bSDennis Li 	},
706f6c3623bSDennis Li 	{ "MMEA0_DRAMRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT),
707f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT, DRAMRD_PAGEMEM_SED_COUNT),
708f6c3623bSDennis Li 	0, 0,
709f6c3623bSDennis Li 	},
710f6c3623bSDennis Li 	{ "MMEA0_DRAMWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT),
711f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT, DRAMWR_PAGEMEM_SED_COUNT),
712f6c3623bSDennis Li 	0, 0,
713f6c3623bSDennis Li 	},
714f6c3623bSDennis Li 	{ "MMEA0_IORD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT),
715f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT, IORD_CMDMEM_SED_COUNT),
716f6c3623bSDennis Li 	0, 0,
717f6c3623bSDennis Li 	},
718f6c3623bSDennis Li 	{ "MMEA0_IOWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT),
719f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT, IOWR_CMDMEM_SED_COUNT),
720f6c3623bSDennis Li 	0, 0,
721f6c3623bSDennis Li 	},
722f6c3623bSDennis Li 	{ "MMEA0_IOWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT),
723f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT, IOWR_DATAMEM_SED_COUNT),
724f6c3623bSDennis Li 	0, 0,
725f6c3623bSDennis Li 	},
726f6c3623bSDennis Li 	{ "MMEA0_GMIRD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT2),
727f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT2, GMIRD_CMDMEM_SEC_COUNT),
728f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT2, GMIRD_CMDMEM_DED_COUNT),
729f6c3623bSDennis Li 	},
730f6c3623bSDennis Li 	{ "MMEA0_GMIWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT2),
731f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT2, GMIWR_CMDMEM_SEC_COUNT),
732f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT2, GMIWR_CMDMEM_DED_COUNT),
733f6c3623bSDennis Li 	},
734f6c3623bSDennis Li 	{ "MMEA0_GMIWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT2),
735f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT2, GMIWR_DATAMEM_SEC_COUNT),
736f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT2, GMIWR_DATAMEM_DED_COUNT),
737f6c3623bSDennis Li 	},
738f6c3623bSDennis Li 	{ "MMEA0_GMIRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT2),
739f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT2, GMIRD_PAGEMEM_SED_COUNT),
740f6c3623bSDennis Li 	0, 0,
741f6c3623bSDennis Li 	},
742f6c3623bSDennis Li 	{ "MMEA0_GMIWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT2),
743f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT2, GMIWR_PAGEMEM_SED_COUNT),
744f6c3623bSDennis Li 	0, 0,
745f6c3623bSDennis Li 	},
746f6c3623bSDennis Li 	{ "MMEA0_DRAMRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT3),
747f6c3623bSDennis Li 	0, 0,
748f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT3, DRAMRD_PAGEMEM_DED_COUNT),
749f6c3623bSDennis Li 	},
750f6c3623bSDennis Li 	{ "MMEA0_DRAMWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT3),
751f6c3623bSDennis Li 	0, 0,
752f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT3, DRAMWR_PAGEMEM_DED_COUNT),
753f6c3623bSDennis Li 	},
754f6c3623bSDennis Li 	{ "MMEA0_IORD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT3),
755f6c3623bSDennis Li 	0, 0,
756f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT3, IORD_CMDMEM_DED_COUNT),
757f6c3623bSDennis Li 	},
758f6c3623bSDennis Li 	{ "MMEA0_IOWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT3),
759f6c3623bSDennis Li 	0, 0,
760f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT3, IOWR_CMDMEM_DED_COUNT),
761f6c3623bSDennis Li 	},
762f6c3623bSDennis Li 	{ "MMEA0_IOWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT3),
763f6c3623bSDennis Li 	0, 0,
764f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT3, IOWR_DATAMEM_DED_COUNT),
765f6c3623bSDennis Li 	},
766f6c3623bSDennis Li 	{ "MMEA0_GMIRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT3),
767f6c3623bSDennis Li 	0, 0,
768f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT3, GMIRD_PAGEMEM_DED_COUNT),
769f6c3623bSDennis Li 	},
770f6c3623bSDennis Li 	{ "MMEA0_GMIWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT3),
771f6c3623bSDennis Li 	0, 0,
772f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT3, GMIWR_PAGEMEM_DED_COUNT),
773f6c3623bSDennis Li 	},
77439aa0ef1SDennis Li 	{ "MMEA0_MAM_D0MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT2),
77539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT2, MAM_D0MEM_SED_COUNT),
77639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT2, MAM_D0MEM_DED_COUNT),
77739aa0ef1SDennis Li 	},
77839aa0ef1SDennis Li 	{ "MMEA0_MAM_D1MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT2),
77939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT2, MAM_D1MEM_SED_COUNT),
78039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT2, MAM_D1MEM_DED_COUNT),
78139aa0ef1SDennis Li 	},
78239aa0ef1SDennis Li 	{ "MMEA0_MAM_D2MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT2),
78339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT2, MAM_D2MEM_SED_COUNT),
78439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT2, MAM_D2MEM_DED_COUNT),
78539aa0ef1SDennis Li 	},
78639aa0ef1SDennis Li 	{ "MMEA0_MAM_D3MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT2),
78739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT2, MAM_D3MEM_SED_COUNT),
78839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA0_EDC_CNT2, MAM_D3MEM_DED_COUNT),
78939aa0ef1SDennis Li 	},
79039aa0ef1SDennis Li 
79139aa0ef1SDennis Li 	/* MMHUB Range 1 */
792f6c3623bSDennis Li 	{ "MMEA1_DRAMRD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT),
793f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT, DRAMRD_CMDMEM_SEC_COUNT),
794f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT, DRAMRD_CMDMEM_DED_COUNT),
795f6c3623bSDennis Li 	},
796f6c3623bSDennis Li 	{ "MMEA1_DRAMWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT),
797f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT, DRAMWR_CMDMEM_SEC_COUNT),
798f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT, DRAMWR_CMDMEM_DED_COUNT),
799f6c3623bSDennis Li 	},
800f6c3623bSDennis Li 	{ "MMEA1_DRAMWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT),
801f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT, DRAMWR_DATAMEM_SEC_COUNT),
802f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT, DRAMWR_DATAMEM_DED_COUNT),
803f6c3623bSDennis Li 	},
804f6c3623bSDennis Li 	{ "MMEA1_RRET_TAGMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT),
805f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT, RRET_TAGMEM_SEC_COUNT),
806f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT, RRET_TAGMEM_DED_COUNT),
807f6c3623bSDennis Li 	},
808f6c3623bSDennis Li 	{ "MMEA1_WRET_TAGMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT),
809f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT, WRET_TAGMEM_SEC_COUNT),
810f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT, WRET_TAGMEM_DED_COUNT),
811f6c3623bSDennis Li 	},
812f6c3623bSDennis Li 	{ "MMEA1_DRAMRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT),
813f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT, DRAMRD_PAGEMEM_SED_COUNT),
814f6c3623bSDennis Li 	0, 0,
815f6c3623bSDennis Li 	},
816f6c3623bSDennis Li 	{ "MMEA1_DRAMWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT),
817f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT, DRAMWR_PAGEMEM_SED_COUNT),
818f6c3623bSDennis Li 	0, 0,
819f6c3623bSDennis Li 	},
820f6c3623bSDennis Li 	{ "MMEA1_IORD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT),
821f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT, IORD_CMDMEM_SED_COUNT),
822f6c3623bSDennis Li 	0, 0,
823f6c3623bSDennis Li 	},
824f6c3623bSDennis Li 	{ "MMEA1_IOWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT),
825f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT, IOWR_CMDMEM_SED_COUNT),
826f6c3623bSDennis Li 	0, 0,
827f6c3623bSDennis Li 	},
828f6c3623bSDennis Li 	{ "MMEA1_IOWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT),
829f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT, IOWR_DATAMEM_SED_COUNT),
830f6c3623bSDennis Li 	0, 0,
831f6c3623bSDennis Li 	},
832f6c3623bSDennis Li 	{ "MMEA1_GMIRD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT2),
833f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT2, GMIRD_CMDMEM_SEC_COUNT),
834f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT2, GMIRD_CMDMEM_DED_COUNT),
835f6c3623bSDennis Li 	},
836f6c3623bSDennis Li 	{ "MMEA1_GMIWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT2),
837f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT2, GMIWR_CMDMEM_SEC_COUNT),
838f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT2, GMIWR_CMDMEM_DED_COUNT),
839f6c3623bSDennis Li 	},
840f6c3623bSDennis Li 	{ "MMEA1_GMIWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT2),
841f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT2, GMIWR_DATAMEM_SEC_COUNT),
842f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT2, GMIWR_DATAMEM_DED_COUNT),
843f6c3623bSDennis Li 	},
844f6c3623bSDennis Li 	{ "MMEA1_GMIRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT2),
845f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT2, GMIRD_PAGEMEM_SED_COUNT),
846f6c3623bSDennis Li 	0, 0,
847f6c3623bSDennis Li 	},
848f6c3623bSDennis Li 	{ "MMEA1_GMIWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT2),
849f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT2, GMIWR_PAGEMEM_SED_COUNT),
850f6c3623bSDennis Li 	0, 0,
851f6c3623bSDennis Li 	},
852f6c3623bSDennis Li 	{ "MMEA1_DRAMRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT3),
853f6c3623bSDennis Li 	0, 0,
854f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT3, DRAMRD_PAGEMEM_DED_COUNT),
855f6c3623bSDennis Li 	},
856f6c3623bSDennis Li 	{ "MMEA1_DRAMWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT3),
857f6c3623bSDennis Li 	0, 0,
858f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT3, DRAMWR_PAGEMEM_DED_COUNT),
859f6c3623bSDennis Li 	},
860f6c3623bSDennis Li 	{ "MMEA1_IORD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT3),
861f6c3623bSDennis Li 	0, 0,
862f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT3, IORD_CMDMEM_DED_COUNT),
863f6c3623bSDennis Li 	},
864f6c3623bSDennis Li 	{ "MMEA1_IOWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT3),
865f6c3623bSDennis Li 	0, 0,
866f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT3, IOWR_CMDMEM_DED_COUNT),
867f6c3623bSDennis Li 	},
868f6c3623bSDennis Li 	{ "MMEA1_IOWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT3),
869f6c3623bSDennis Li 	0, 0,
870f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT3, IOWR_DATAMEM_DED_COUNT),
871f6c3623bSDennis Li 	},
872f6c3623bSDennis Li 	{ "MMEA1_GMIRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT3),
873f6c3623bSDennis Li 	0, 0,
874f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT3, GMIRD_PAGEMEM_DED_COUNT),
875f6c3623bSDennis Li 	},
876f6c3623bSDennis Li 	{ "MMEA1_GMIWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT3),
877f6c3623bSDennis Li 	0, 0,
878f6c3623bSDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT3, GMIWR_PAGEMEM_DED_COUNT),
87939aa0ef1SDennis Li 	},
88039aa0ef1SDennis Li 	{ "MMEA1_MAM_D0MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT2),
88139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT2, MAM_D0MEM_SED_COUNT),
88239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT2, MAM_D0MEM_DED_COUNT),
88339aa0ef1SDennis Li 	},
88439aa0ef1SDennis Li 	{ "MMEA1_MAM_D1MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT2),
88539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT2, MAM_D1MEM_SED_COUNT),
88639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT2, MAM_D1MEM_DED_COUNT),
88739aa0ef1SDennis Li 	},
88839aa0ef1SDennis Li 	{ "MMEA1_MAM_D2MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT2),
88939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT2, MAM_D2MEM_SED_COUNT),
89039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT2, MAM_D2MEM_DED_COUNT),
89139aa0ef1SDennis Li 	},
89239aa0ef1SDennis Li 	{ "MMEA1_MAM_D3MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT2),
89339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT2, MAM_D3MEM_SED_COUNT),
89439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA1_EDC_CNT2, MAM_D3MEM_DED_COUNT),
89539aa0ef1SDennis Li 	},
89639aa0ef1SDennis Li 
89739aa0ef1SDennis Li 	/* MMHAB Range 2*/
89839aa0ef1SDennis Li 	{ "MMEA2_DRAMRD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT),
89939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT, DRAMRD_CMDMEM_SEC_COUNT),
90039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT, DRAMRD_CMDMEM_DED_COUNT),
90139aa0ef1SDennis Li 	},
90239aa0ef1SDennis Li 	{ "MMEA2_DRAMWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT),
90339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT, DRAMWR_CMDMEM_SEC_COUNT),
90439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT, DRAMWR_CMDMEM_DED_COUNT),
90539aa0ef1SDennis Li 	},
90639aa0ef1SDennis Li 	{ "MMEA2_DRAMWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT),
90739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT, DRAMWR_DATAMEM_SEC_COUNT),
90839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT, DRAMWR_DATAMEM_DED_COUNT),
90939aa0ef1SDennis Li 	},
91039aa0ef1SDennis Li 	{ "MMEA2_RRET_TAGMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT),
91139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT, RRET_TAGMEM_SEC_COUNT),
91239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT, RRET_TAGMEM_DED_COUNT),
91339aa0ef1SDennis Li 	},
91439aa0ef1SDennis Li 	{ "MMEA2_WRET_TAGMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT),
91539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT, WRET_TAGMEM_SEC_COUNT),
91639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT, WRET_TAGMEM_DED_COUNT),
91739aa0ef1SDennis Li 	},
91839aa0ef1SDennis Li 	{ "MMEA2_DRAMRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT),
91939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT, DRAMRD_PAGEMEM_SED_COUNT),
92039aa0ef1SDennis Li 	0, 0,
92139aa0ef1SDennis Li 	},
92239aa0ef1SDennis Li 	{ "MMEA2_DRAMWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT),
92339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT, DRAMWR_PAGEMEM_SED_COUNT),
92439aa0ef1SDennis Li 	0, 0,
92539aa0ef1SDennis Li 	},
92639aa0ef1SDennis Li 	{ "MMEA2_IORD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT),
92739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT, IORD_CMDMEM_SED_COUNT),
92839aa0ef1SDennis Li 	0, 0,
92939aa0ef1SDennis Li 	},
93039aa0ef1SDennis Li 	{ "MMEA2_IOWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT),
93139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT, IOWR_CMDMEM_SED_COUNT),
93239aa0ef1SDennis Li 	0, 0,
93339aa0ef1SDennis Li 	},
93439aa0ef1SDennis Li 	{ "MMEA2_IOWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT),
93539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT, IOWR_DATAMEM_SED_COUNT),
93639aa0ef1SDennis Li 	0, 0,
93739aa0ef1SDennis Li 	},
93839aa0ef1SDennis Li 	{ "MMEA2_GMIRD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT2),
93939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT2, GMIRD_CMDMEM_SEC_COUNT),
94039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT2, GMIRD_CMDMEM_DED_COUNT),
94139aa0ef1SDennis Li 	},
94239aa0ef1SDennis Li 	{ "MMEA2_GMIWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT2),
94339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT2, GMIWR_CMDMEM_SEC_COUNT),
94439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT2, GMIWR_CMDMEM_DED_COUNT),
94539aa0ef1SDennis Li 	},
94639aa0ef1SDennis Li 	{ "MMEA2_GMIWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT2),
94739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT2, GMIWR_DATAMEM_SEC_COUNT),
94839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT2, GMIWR_DATAMEM_DED_COUNT),
94939aa0ef1SDennis Li 	},
95039aa0ef1SDennis Li 	{ "MMEA2_GMIRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT2),
95139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT2, GMIRD_PAGEMEM_SED_COUNT),
95239aa0ef1SDennis Li 	0, 0,
95339aa0ef1SDennis Li 	},
95439aa0ef1SDennis Li 	{ "MMEA2_GMIWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT2),
95539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT2, GMIWR_PAGEMEM_SED_COUNT),
95639aa0ef1SDennis Li 	0, 0,
95739aa0ef1SDennis Li 	},
95839aa0ef1SDennis Li 	{ "MMEA2_DRAMRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT3),
95939aa0ef1SDennis Li 	0, 0,
96039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT3, DRAMRD_PAGEMEM_DED_COUNT),
96139aa0ef1SDennis Li 	},
96239aa0ef1SDennis Li 	{ "MMEA2_DRAMWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT3),
96339aa0ef1SDennis Li 	0, 0,
96439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT3, DRAMWR_PAGEMEM_DED_COUNT),
96539aa0ef1SDennis Li 	},
96639aa0ef1SDennis Li 	{ "MMEA2_IORD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT3),
96739aa0ef1SDennis Li 	0, 0,
96839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT3, IORD_CMDMEM_DED_COUNT),
96939aa0ef1SDennis Li 	},
97039aa0ef1SDennis Li 	{ "MMEA2_IOWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT3),
97139aa0ef1SDennis Li 	0, 0,
97239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT3, IOWR_CMDMEM_DED_COUNT),
97339aa0ef1SDennis Li 	},
97439aa0ef1SDennis Li 	{ "MMEA2_IOWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT3),
97539aa0ef1SDennis Li 	0, 0,
97639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT3, IOWR_DATAMEM_DED_COUNT),
97739aa0ef1SDennis Li 	},
97839aa0ef1SDennis Li 	{ "MMEA2_GMIRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT3),
97939aa0ef1SDennis Li 	0, 0,
98039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT3, GMIRD_PAGEMEM_DED_COUNT),
98139aa0ef1SDennis Li 	},
98239aa0ef1SDennis Li 	{ "MMEA2_GMIWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT3),
98339aa0ef1SDennis Li 	0, 0,
98439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT3, GMIWR_PAGEMEM_DED_COUNT),
98539aa0ef1SDennis Li 	},
98639aa0ef1SDennis Li 	{ "MMEA2_MAM_D0MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT2),
98739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT2, MAM_D0MEM_SED_COUNT),
98839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT2, MAM_D0MEM_DED_COUNT),
98939aa0ef1SDennis Li 	},
99039aa0ef1SDennis Li 	{ "MMEA2_MAM_D1MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT2),
99139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT2, MAM_D1MEM_SED_COUNT),
99239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT2, MAM_D1MEM_DED_COUNT),
99339aa0ef1SDennis Li 	},
99439aa0ef1SDennis Li 	{ "MMEA2_MAM_D2MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT2),
99539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT2, MAM_D2MEM_SED_COUNT),
99639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT2, MAM_D2MEM_DED_COUNT),
99739aa0ef1SDennis Li 	},
99839aa0ef1SDennis Li 	{ "MMEA2_MAM_D3MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT2),
99939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT2, MAM_D3MEM_SED_COUNT),
100039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA2_EDC_CNT2, MAM_D3MEM_DED_COUNT),
100139aa0ef1SDennis Li 	},
100239aa0ef1SDennis Li 
100339aa0ef1SDennis Li 	/* MMHUB Rang 3 */
100439aa0ef1SDennis Li 	{ "MMEA3_DRAMRD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT),
100539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT, DRAMRD_CMDMEM_SEC_COUNT),
100639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT, DRAMRD_CMDMEM_DED_COUNT),
100739aa0ef1SDennis Li 	},
100839aa0ef1SDennis Li 	{ "MMEA3_DRAMWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT),
100939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT, DRAMWR_CMDMEM_SEC_COUNT),
101039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT, DRAMWR_CMDMEM_DED_COUNT),
101139aa0ef1SDennis Li 	},
101239aa0ef1SDennis Li 	{ "MMEA3_DRAMWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT),
101339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT, DRAMWR_DATAMEM_SEC_COUNT),
101439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT, DRAMWR_DATAMEM_DED_COUNT),
101539aa0ef1SDennis Li 	},
101639aa0ef1SDennis Li 	{ "MMEA3_RRET_TAGMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT),
101739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT, RRET_TAGMEM_SEC_COUNT),
101839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT, RRET_TAGMEM_DED_COUNT),
101939aa0ef1SDennis Li 	},
102039aa0ef1SDennis Li 	{ "MMEA3_WRET_TAGMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT),
102139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT, WRET_TAGMEM_SEC_COUNT),
102239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT, WRET_TAGMEM_DED_COUNT),
102339aa0ef1SDennis Li 	},
102439aa0ef1SDennis Li 	{ "MMEA3_DRAMRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT),
102539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT, DRAMRD_PAGEMEM_SED_COUNT),
102639aa0ef1SDennis Li 	0, 0,
102739aa0ef1SDennis Li 	},
102839aa0ef1SDennis Li 	{ "MMEA3_DRAMWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT),
102939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT, DRAMWR_PAGEMEM_SED_COUNT),
103039aa0ef1SDennis Li 	0, 0,
103139aa0ef1SDennis Li 	},
103239aa0ef1SDennis Li 	{ "MMEA3_IORD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT),
103339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT, IORD_CMDMEM_SED_COUNT),
103439aa0ef1SDennis Li 	0, 0,
103539aa0ef1SDennis Li 	},
103639aa0ef1SDennis Li 	{ "MMEA3_IOWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT),
103739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT, IOWR_CMDMEM_SED_COUNT),
103839aa0ef1SDennis Li 	0, 0,
103939aa0ef1SDennis Li 	},
104039aa0ef1SDennis Li 	{ "MMEA3_IOWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT),
104139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT, IOWR_DATAMEM_SED_COUNT),
104239aa0ef1SDennis Li 	0, 0,
104339aa0ef1SDennis Li 	},
104439aa0ef1SDennis Li 	{ "MMEA3_GMIRD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT2),
104539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT2, GMIRD_CMDMEM_SEC_COUNT),
104639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT2, GMIRD_CMDMEM_DED_COUNT),
104739aa0ef1SDennis Li 	},
104839aa0ef1SDennis Li 	{ "MMEA3_GMIWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT2),
104939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT2, GMIWR_CMDMEM_SEC_COUNT),
105039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT2, GMIWR_CMDMEM_DED_COUNT),
105139aa0ef1SDennis Li 	},
105239aa0ef1SDennis Li 	{ "MMEA3_GMIWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT2),
105339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT2, GMIWR_DATAMEM_SEC_COUNT),
105439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT2, GMIWR_DATAMEM_DED_COUNT),
105539aa0ef1SDennis Li 	},
105639aa0ef1SDennis Li 	{ "MMEA3_GMIRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT2),
105739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT2, GMIRD_PAGEMEM_SED_COUNT),
105839aa0ef1SDennis Li 	0, 0,
105939aa0ef1SDennis Li 	},
106039aa0ef1SDennis Li 	{ "MMEA3_GMIWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT2),
106139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT2, GMIWR_PAGEMEM_SED_COUNT),
106239aa0ef1SDennis Li 	0, 0,
106339aa0ef1SDennis Li 	},
106439aa0ef1SDennis Li 	{ "MMEA3_DRAMRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT3),
106539aa0ef1SDennis Li 	0, 0,
106639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT3, DRAMRD_PAGEMEM_DED_COUNT),
106739aa0ef1SDennis Li 	},
106839aa0ef1SDennis Li 	{ "MMEA3_DRAMWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT3),
106939aa0ef1SDennis Li 	0, 0,
107039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT3, DRAMWR_PAGEMEM_DED_COUNT),
107139aa0ef1SDennis Li 	},
107239aa0ef1SDennis Li 	{ "MMEA3_IORD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT3),
107339aa0ef1SDennis Li 	0, 0,
107439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT3, IORD_CMDMEM_DED_COUNT),
107539aa0ef1SDennis Li 	},
107639aa0ef1SDennis Li 	{ "MMEA3_IOWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT3),
107739aa0ef1SDennis Li 	0, 0,
107839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT3, IOWR_CMDMEM_DED_COUNT),
107939aa0ef1SDennis Li 	},
108039aa0ef1SDennis Li 	{ "MMEA3_IOWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT3),
108139aa0ef1SDennis Li 	0, 0,
108239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT3, IOWR_DATAMEM_DED_COUNT),
108339aa0ef1SDennis Li 	},
108439aa0ef1SDennis Li 	{ "MMEA3_GMIRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT3),
108539aa0ef1SDennis Li 	0, 0,
108639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT3, GMIRD_PAGEMEM_DED_COUNT),
108739aa0ef1SDennis Li 	},
108839aa0ef1SDennis Li 	{ "MMEA3_GMIWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT3),
108939aa0ef1SDennis Li 	0, 0,
109039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT3, GMIWR_PAGEMEM_DED_COUNT),
109139aa0ef1SDennis Li 	},
109239aa0ef1SDennis Li 	{ "MMEA3_MAM_D0MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT2),
109339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT2, MAM_D0MEM_SED_COUNT),
109439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT2, MAM_D0MEM_DED_COUNT),
109539aa0ef1SDennis Li 	},
109639aa0ef1SDennis Li 	{ "MMEA3_MAM_D1MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT2),
109739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT2, MAM_D1MEM_SED_COUNT),
109839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT2, MAM_D1MEM_DED_COUNT),
109939aa0ef1SDennis Li 	},
110039aa0ef1SDennis Li 	{ "MMEA3_MAM_D2MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT2),
110139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT2, MAM_D2MEM_SED_COUNT),
110239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT2, MAM_D2MEM_DED_COUNT),
110339aa0ef1SDennis Li 	},
110439aa0ef1SDennis Li 	{ "MMEA3_MAM_D3MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT2),
110539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT2, MAM_D3MEM_SED_COUNT),
110639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA3_EDC_CNT2, MAM_D3MEM_DED_COUNT),
110739aa0ef1SDennis Li 	},
110839aa0ef1SDennis Li 
110939aa0ef1SDennis Li 	/* MMHUB Range 4 */
111039aa0ef1SDennis Li 	{ "MMEA4_DRAMRD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT),
111139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT, DRAMRD_CMDMEM_SEC_COUNT),
111239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT, DRAMRD_CMDMEM_DED_COUNT),
111339aa0ef1SDennis Li 	},
111439aa0ef1SDennis Li 	{ "MMEA4_DRAMWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT),
111539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT, DRAMWR_CMDMEM_SEC_COUNT),
111639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT, DRAMWR_CMDMEM_DED_COUNT),
111739aa0ef1SDennis Li 	},
111839aa0ef1SDennis Li 	{ "MMEA4_DRAMWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT),
111939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT, DRAMWR_DATAMEM_SEC_COUNT),
112039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT, DRAMWR_DATAMEM_DED_COUNT),
112139aa0ef1SDennis Li 	},
112239aa0ef1SDennis Li 	{ "MMEA4_RRET_TAGMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT),
112339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT, RRET_TAGMEM_SEC_COUNT),
112439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT, RRET_TAGMEM_DED_COUNT),
112539aa0ef1SDennis Li 	},
112639aa0ef1SDennis Li 	{ "MMEA4_WRET_TAGMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT),
112739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT, WRET_TAGMEM_SEC_COUNT),
112839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT, WRET_TAGMEM_DED_COUNT),
112939aa0ef1SDennis Li 	},
113039aa0ef1SDennis Li 	{ "MMEA4_DRAMRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT),
113139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT, DRAMRD_PAGEMEM_SED_COUNT),
113239aa0ef1SDennis Li 	0, 0,
113339aa0ef1SDennis Li 	},
113439aa0ef1SDennis Li 	{ "MMEA4_DRAMWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT),
113539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT, DRAMWR_PAGEMEM_SED_COUNT),
113639aa0ef1SDennis Li 	0, 0,
113739aa0ef1SDennis Li 	},
113839aa0ef1SDennis Li 	{ "MMEA4_IORD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT),
113939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT, IORD_CMDMEM_SED_COUNT),
114039aa0ef1SDennis Li 	0, 0,
114139aa0ef1SDennis Li 	},
114239aa0ef1SDennis Li 	{ "MMEA4_IOWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT),
114339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT, IOWR_CMDMEM_SED_COUNT),
114439aa0ef1SDennis Li 	0, 0,
114539aa0ef1SDennis Li 	},
114639aa0ef1SDennis Li 	{ "MMEA4_IOWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT),
114739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT, IOWR_DATAMEM_SED_COUNT),
114839aa0ef1SDennis Li 	0, 0,
114939aa0ef1SDennis Li 	},
115039aa0ef1SDennis Li 	{ "MMEA4_GMIRD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT2),
115139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT2, GMIRD_CMDMEM_SEC_COUNT),
115239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT2, GMIRD_CMDMEM_DED_COUNT),
115339aa0ef1SDennis Li 	},
115439aa0ef1SDennis Li 	{ "MMEA4_GMIWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT2),
115539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT2, GMIWR_CMDMEM_SEC_COUNT),
115639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT2, GMIWR_CMDMEM_DED_COUNT),
115739aa0ef1SDennis Li 	},
115839aa0ef1SDennis Li 	{ "MMEA4_GMIWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT2),
115939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT2, GMIWR_DATAMEM_SEC_COUNT),
116039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT2, GMIWR_DATAMEM_DED_COUNT),
116139aa0ef1SDennis Li 	},
116239aa0ef1SDennis Li 	{ "MMEA4_GMIRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT2),
116339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT2, GMIRD_PAGEMEM_SED_COUNT),
116439aa0ef1SDennis Li 	0, 0,
116539aa0ef1SDennis Li 	},
116639aa0ef1SDennis Li 	{ "MMEA4_GMIWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT2),
116739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT2, GMIWR_PAGEMEM_SED_COUNT),
116839aa0ef1SDennis Li 	0, 0,
116939aa0ef1SDennis Li 	},
117039aa0ef1SDennis Li 	{ "MMEA4_DRAMRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT3),
117139aa0ef1SDennis Li 	0, 0,
117239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT3, DRAMRD_PAGEMEM_DED_COUNT),
117339aa0ef1SDennis Li 	},
117439aa0ef1SDennis Li 	{ "MMEA4_DRAMWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT3),
117539aa0ef1SDennis Li 	0, 0,
117639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT3, DRAMWR_PAGEMEM_DED_COUNT),
117739aa0ef1SDennis Li 	},
117839aa0ef1SDennis Li 	{ "MMEA4_IORD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT3),
117939aa0ef1SDennis Li 	0, 0,
118039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT3, IORD_CMDMEM_DED_COUNT),
118139aa0ef1SDennis Li 	},
118239aa0ef1SDennis Li 	{ "MMEA4_IOWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT3),
118339aa0ef1SDennis Li 	0, 0,
118439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT3, IOWR_CMDMEM_DED_COUNT),
118539aa0ef1SDennis Li 	},
118639aa0ef1SDennis Li 	{ "MMEA4_IOWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT3),
118739aa0ef1SDennis Li 	0, 0,
118839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT3, IOWR_DATAMEM_DED_COUNT),
118939aa0ef1SDennis Li 	},
119039aa0ef1SDennis Li 	{ "MMEA4_GMIRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT3),
119139aa0ef1SDennis Li 	0, 0,
119239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT3, GMIRD_PAGEMEM_DED_COUNT),
119339aa0ef1SDennis Li 	},
119439aa0ef1SDennis Li 	{ "MMEA4_GMIWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT3),
119539aa0ef1SDennis Li 	0, 0,
119639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT3, GMIWR_PAGEMEM_DED_COUNT),
119739aa0ef1SDennis Li 	},
119839aa0ef1SDennis Li 	{ "MMEA4_MAM_D0MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT2),
119939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT2, MAM_D0MEM_SED_COUNT),
120039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT2, MAM_D0MEM_DED_COUNT),
120139aa0ef1SDennis Li 	},
120239aa0ef1SDennis Li 	{ "MMEA4_MAM_D1MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT2),
120339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT2, MAM_D1MEM_SED_COUNT),
120439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT2, MAM_D1MEM_DED_COUNT),
120539aa0ef1SDennis Li 	},
120639aa0ef1SDennis Li 	{ "MMEA4_MAM_D2MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT2),
120739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT2, MAM_D2MEM_SED_COUNT),
120839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT2, MAM_D2MEM_DED_COUNT),
120939aa0ef1SDennis Li 	},
121039aa0ef1SDennis Li 	{ "MMEA4_MAM_D3MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT2),
121139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT2, MAM_D3MEM_SED_COUNT),
121239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA4_EDC_CNT2, MAM_D3MEM_DED_COUNT),
121339aa0ef1SDennis Li 	},
121439aa0ef1SDennis Li 
121539aa0ef1SDennis Li 	/* MMHUAB Range 5 */
121639aa0ef1SDennis Li 	{ "MMEA5_DRAMRD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT),
121739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT, DRAMRD_CMDMEM_SEC_COUNT),
121839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT, DRAMRD_CMDMEM_DED_COUNT),
121939aa0ef1SDennis Li 	},
122039aa0ef1SDennis Li 	{ "MMEA5_DRAMWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT),
122139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT, DRAMWR_CMDMEM_SEC_COUNT),
122239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT, DRAMWR_CMDMEM_DED_COUNT),
122339aa0ef1SDennis Li 	},
122439aa0ef1SDennis Li 	{ "MMEA5_DRAMWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT),
122539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT, DRAMWR_DATAMEM_SEC_COUNT),
122639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT, DRAMWR_DATAMEM_DED_COUNT),
122739aa0ef1SDennis Li 	},
122839aa0ef1SDennis Li 	{ "MMEA5_RRET_TAGMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT),
122939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT, RRET_TAGMEM_SEC_COUNT),
123039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT, RRET_TAGMEM_DED_COUNT),
123139aa0ef1SDennis Li 	},
123239aa0ef1SDennis Li 	{ "MMEA5_WRET_TAGMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT),
123339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT, WRET_TAGMEM_SEC_COUNT),
123439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT, WRET_TAGMEM_DED_COUNT),
123539aa0ef1SDennis Li 	},
123639aa0ef1SDennis Li 	{ "MMEA5_DRAMRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT),
123739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT, DRAMRD_PAGEMEM_SED_COUNT),
123839aa0ef1SDennis Li 	0, 0,
123939aa0ef1SDennis Li 	},
124039aa0ef1SDennis Li 	{ "MMEA5_DRAMWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT),
124139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT, DRAMWR_PAGEMEM_SED_COUNT),
124239aa0ef1SDennis Li 	0, 0,
124339aa0ef1SDennis Li 	},
124439aa0ef1SDennis Li 	{ "MMEA5_IORD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT),
124539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT, IORD_CMDMEM_SED_COUNT),
124639aa0ef1SDennis Li 	0, 0,
124739aa0ef1SDennis Li 	},
124839aa0ef1SDennis Li 	{ "MMEA5_IOWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT),
124939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT, IOWR_CMDMEM_SED_COUNT),
125039aa0ef1SDennis Li 	0, 0,
125139aa0ef1SDennis Li 	},
125239aa0ef1SDennis Li 	{ "MMEA5_IOWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT),
125339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT, IOWR_DATAMEM_SED_COUNT),
125439aa0ef1SDennis Li 	0, 0,
125539aa0ef1SDennis Li 	},
125639aa0ef1SDennis Li 	{ "MMEA5_GMIRD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT2),
125739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT2, GMIRD_CMDMEM_SEC_COUNT),
125839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT2, GMIRD_CMDMEM_DED_COUNT),
125939aa0ef1SDennis Li 	},
126039aa0ef1SDennis Li 	{ "MMEA5_GMIWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT2),
126139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT2, GMIWR_CMDMEM_SEC_COUNT),
126239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT2, GMIWR_CMDMEM_DED_COUNT),
126339aa0ef1SDennis Li 	},
126439aa0ef1SDennis Li 	{ "MMEA5_GMIWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT2),
126539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT2, GMIWR_DATAMEM_SEC_COUNT),
126639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT2, GMIWR_DATAMEM_DED_COUNT),
126739aa0ef1SDennis Li 	},
126839aa0ef1SDennis Li 	{ "MMEA5_GMIRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT2),
126939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT2, GMIRD_PAGEMEM_SED_COUNT),
127039aa0ef1SDennis Li 	0, 0,
127139aa0ef1SDennis Li 	},
127239aa0ef1SDennis Li 	{ "MMEA5_GMIWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT2),
127339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT2, GMIWR_PAGEMEM_SED_COUNT),
127439aa0ef1SDennis Li 	0, 0,
127539aa0ef1SDennis Li 	},
127639aa0ef1SDennis Li 	{ "MMEA5_DRAMRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT3),
127739aa0ef1SDennis Li 	0, 0,
127839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT3, DRAMRD_PAGEMEM_DED_COUNT),
127939aa0ef1SDennis Li 	},
128039aa0ef1SDennis Li 	{ "MMEA5_DRAMWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT3),
128139aa0ef1SDennis Li 	0, 0,
128239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT3, DRAMWR_PAGEMEM_DED_COUNT),
128339aa0ef1SDennis Li 	},
128439aa0ef1SDennis Li 	{ "MMEA5_IORD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT3),
128539aa0ef1SDennis Li 	0, 0,
128639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT3, IORD_CMDMEM_DED_COUNT),
128739aa0ef1SDennis Li 	},
128839aa0ef1SDennis Li 	{ "MMEA5_IOWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT3),
128939aa0ef1SDennis Li 	0, 0,
129039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT3, IOWR_CMDMEM_DED_COUNT),
129139aa0ef1SDennis Li 	},
129239aa0ef1SDennis Li 	{ "MMEA5_IOWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT3),
129339aa0ef1SDennis Li 	0, 0,
129439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT3, IOWR_DATAMEM_DED_COUNT),
129539aa0ef1SDennis Li 	},
129639aa0ef1SDennis Li 	{ "MMEA5_GMIRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT3),
129739aa0ef1SDennis Li 	0, 0,
129839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT3, GMIRD_PAGEMEM_DED_COUNT),
129939aa0ef1SDennis Li 	},
130039aa0ef1SDennis Li 	{ "MMEA5_GMIWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT3),
130139aa0ef1SDennis Li 	0, 0,
130239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT3, GMIWR_PAGEMEM_DED_COUNT),
130339aa0ef1SDennis Li 	},
130439aa0ef1SDennis Li 	{ "MMEA5_MAM_D0MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT2),
130539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT2, MAM_D0MEM_SED_COUNT),
130639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT2, MAM_D0MEM_DED_COUNT),
130739aa0ef1SDennis Li 	},
130839aa0ef1SDennis Li 	{ "MMEA5_MAM_D1MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT2),
130939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT2, MAM_D1MEM_SED_COUNT),
131039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT2, MAM_D1MEM_DED_COUNT),
131139aa0ef1SDennis Li 	},
131239aa0ef1SDennis Li 	{ "MMEA5_MAM_D2MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT2),
131339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT2, MAM_D2MEM_SED_COUNT),
131439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT2, MAM_D2MEM_DED_COUNT),
131539aa0ef1SDennis Li 	},
131639aa0ef1SDennis Li 	{ "MMEA5_MAM_D3MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT2),
131739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT2, MAM_D3MEM_SED_COUNT),
131839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA5_EDC_CNT2, MAM_D3MEM_DED_COUNT),
131939aa0ef1SDennis Li 	},
132039aa0ef1SDennis Li 
132139aa0ef1SDennis Li 	/* MMHUB Range 6 */
132239aa0ef1SDennis Li 	{ "MMEA6_DRAMRD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT),
132339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT, DRAMRD_CMDMEM_SEC_COUNT),
132439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT, DRAMRD_CMDMEM_DED_COUNT),
132539aa0ef1SDennis Li 	},
132639aa0ef1SDennis Li 	{ "MMEA6_DRAMWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT),
132739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT, DRAMWR_CMDMEM_SEC_COUNT),
132839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT, DRAMWR_CMDMEM_DED_COUNT),
132939aa0ef1SDennis Li 	},
133039aa0ef1SDennis Li 	{ "MMEA6_DRAMWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT),
133139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT, DRAMWR_DATAMEM_SEC_COUNT),
133239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT, DRAMWR_DATAMEM_DED_COUNT),
133339aa0ef1SDennis Li 	},
133439aa0ef1SDennis Li 	{ "MMEA6_RRET_TAGMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT),
133539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT, RRET_TAGMEM_SEC_COUNT),
133639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT, RRET_TAGMEM_DED_COUNT),
133739aa0ef1SDennis Li 	},
133839aa0ef1SDennis Li 	{ "MMEA6_WRET_TAGMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT),
133939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT, WRET_TAGMEM_SEC_COUNT),
134039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT, WRET_TAGMEM_DED_COUNT),
134139aa0ef1SDennis Li 	},
134239aa0ef1SDennis Li 	{ "MMEA6_DRAMRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT),
134339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT, DRAMRD_PAGEMEM_SED_COUNT),
134439aa0ef1SDennis Li 	0, 0,
134539aa0ef1SDennis Li 	},
134639aa0ef1SDennis Li 	{ "MMEA6_DRAMWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT),
134739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT, DRAMWR_PAGEMEM_SED_COUNT),
134839aa0ef1SDennis Li 	0, 0,
134939aa0ef1SDennis Li 	},
135039aa0ef1SDennis Li 	{ "MMEA6_IORD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT),
135139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT, IORD_CMDMEM_SED_COUNT),
135239aa0ef1SDennis Li 	0, 0,
135339aa0ef1SDennis Li 	},
135439aa0ef1SDennis Li 	{ "MMEA6_IOWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT),
135539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT, IOWR_CMDMEM_SED_COUNT),
135639aa0ef1SDennis Li 	0, 0,
135739aa0ef1SDennis Li 	},
135839aa0ef1SDennis Li 	{ "MMEA6_IOWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT),
135939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT, IOWR_DATAMEM_SED_COUNT),
136039aa0ef1SDennis Li 	0, 0,
136139aa0ef1SDennis Li 	},
136239aa0ef1SDennis Li 	{ "MMEA6_GMIRD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT2),
136339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT2, GMIRD_CMDMEM_SEC_COUNT),
136439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT2, GMIRD_CMDMEM_DED_COUNT),
136539aa0ef1SDennis Li 	},
136639aa0ef1SDennis Li 	{ "MMEA6_GMIWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT2),
136739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT2, GMIWR_CMDMEM_SEC_COUNT),
136839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT2, GMIWR_CMDMEM_DED_COUNT),
136939aa0ef1SDennis Li 	},
137039aa0ef1SDennis Li 	{ "MMEA6_GMIWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT2),
137139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT2, GMIWR_DATAMEM_SEC_COUNT),
137239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT2, GMIWR_DATAMEM_DED_COUNT),
137339aa0ef1SDennis Li 	},
137439aa0ef1SDennis Li 	{ "MMEA6_GMIRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT2),
137539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT2, GMIRD_PAGEMEM_SED_COUNT),
137639aa0ef1SDennis Li 	0, 0,
137739aa0ef1SDennis Li 	},
137839aa0ef1SDennis Li 	{ "MMEA6_GMIWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT2),
137939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT2, GMIWR_PAGEMEM_SED_COUNT),
138039aa0ef1SDennis Li 	0, 0,
138139aa0ef1SDennis Li 	},
138239aa0ef1SDennis Li 	{ "MMEA6_DRAMRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT3),
138339aa0ef1SDennis Li 	0, 0,
138439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT3, DRAMRD_PAGEMEM_DED_COUNT),
138539aa0ef1SDennis Li 	},
138639aa0ef1SDennis Li 	{ "MMEA6_DRAMWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT3),
138739aa0ef1SDennis Li 	0, 0,
138839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT3, DRAMWR_PAGEMEM_DED_COUNT),
138939aa0ef1SDennis Li 	},
139039aa0ef1SDennis Li 	{ "MMEA6_IORD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT3),
139139aa0ef1SDennis Li 	0, 0,
139239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT3, IORD_CMDMEM_DED_COUNT),
139339aa0ef1SDennis Li 	},
139439aa0ef1SDennis Li 	{ "MMEA6_IOWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT3),
139539aa0ef1SDennis Li 	0, 0,
139639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT3, IOWR_CMDMEM_DED_COUNT),
139739aa0ef1SDennis Li 	},
139839aa0ef1SDennis Li 	{ "MMEA6_IOWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT3),
139939aa0ef1SDennis Li 	0, 0,
140039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT3, IOWR_DATAMEM_DED_COUNT),
140139aa0ef1SDennis Li 	},
140239aa0ef1SDennis Li 	{ "MMEA6_GMIRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT3),
140339aa0ef1SDennis Li 	0, 0,
140439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT3, GMIRD_PAGEMEM_DED_COUNT),
140539aa0ef1SDennis Li 	},
140639aa0ef1SDennis Li 	{ "MMEA6_GMIWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT3),
140739aa0ef1SDennis Li 	0, 0,
140839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT3, GMIWR_PAGEMEM_DED_COUNT),
140939aa0ef1SDennis Li 	},
141039aa0ef1SDennis Li 	{ "MMEA6_MAM_D0MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT2),
141139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT2, MAM_D0MEM_SED_COUNT),
141239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT2, MAM_D0MEM_DED_COUNT),
141339aa0ef1SDennis Li 	},
141439aa0ef1SDennis Li 	{ "MMEA6_MAM_D1MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT2),
141539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT2, MAM_D1MEM_SED_COUNT),
141639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT2, MAM_D1MEM_DED_COUNT),
141739aa0ef1SDennis Li 	},
141839aa0ef1SDennis Li 	{ "MMEA6_MAM_D2MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT2),
141939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT2, MAM_D2MEM_SED_COUNT),
142039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT2, MAM_D2MEM_DED_COUNT),
142139aa0ef1SDennis Li 	},
142239aa0ef1SDennis Li 	{ "MMEA6_MAM_D3MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT2),
142339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT2, MAM_D3MEM_SED_COUNT),
142439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA6_EDC_CNT2, MAM_D3MEM_DED_COUNT),
142539aa0ef1SDennis Li 	},
142639aa0ef1SDennis Li 
142739aa0ef1SDennis Li 	/* MMHUB Range 7*/
142839aa0ef1SDennis Li 	{ "MMEA7_DRAMRD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT),
142939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT, DRAMRD_CMDMEM_SEC_COUNT),
143039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT, DRAMRD_CMDMEM_DED_COUNT),
143139aa0ef1SDennis Li 	},
143239aa0ef1SDennis Li 	{ "MMEA7_DRAMWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT),
143339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT, DRAMWR_CMDMEM_SEC_COUNT),
143439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT, DRAMWR_CMDMEM_DED_COUNT),
143539aa0ef1SDennis Li 	},
143639aa0ef1SDennis Li 	{ "MMEA7_DRAMWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT),
143739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT, DRAMWR_DATAMEM_SEC_COUNT),
143839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT, DRAMWR_DATAMEM_DED_COUNT),
143939aa0ef1SDennis Li 	},
144039aa0ef1SDennis Li 	{ "MMEA7_RRET_TAGMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT),
144139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT, RRET_TAGMEM_SEC_COUNT),
144239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT, RRET_TAGMEM_DED_COUNT),
144339aa0ef1SDennis Li 	},
144439aa0ef1SDennis Li 	{ "MMEA7_WRET_TAGMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT),
144539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT, WRET_TAGMEM_SEC_COUNT),
144639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT, WRET_TAGMEM_DED_COUNT),
144739aa0ef1SDennis Li 	},
144839aa0ef1SDennis Li 	{ "MMEA7_DRAMRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT),
144939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT, DRAMRD_PAGEMEM_SED_COUNT),
145039aa0ef1SDennis Li 	0, 0,
145139aa0ef1SDennis Li 	},
145239aa0ef1SDennis Li 	{ "MMEA7_DRAMWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT),
145339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT, DRAMWR_PAGEMEM_SED_COUNT),
145439aa0ef1SDennis Li 	0, 0,
145539aa0ef1SDennis Li 	},
145639aa0ef1SDennis Li 	{ "MMEA7_IORD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT),
145739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT, IORD_CMDMEM_SED_COUNT),
145839aa0ef1SDennis Li 	0, 0,
145939aa0ef1SDennis Li 	},
146039aa0ef1SDennis Li 	{ "MMEA7_IOWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT),
146139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT, IOWR_CMDMEM_SED_COUNT),
146239aa0ef1SDennis Li 	0, 0,
146339aa0ef1SDennis Li 	},
146439aa0ef1SDennis Li 	{ "MMEA7_IOWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT),
146539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT, IOWR_DATAMEM_SED_COUNT),
146639aa0ef1SDennis Li 	0, 0,
146739aa0ef1SDennis Li 	},
146839aa0ef1SDennis Li 	{ "MMEA7_GMIRD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT2),
146939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT2, GMIRD_CMDMEM_SEC_COUNT),
147039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT2, GMIRD_CMDMEM_DED_COUNT),
147139aa0ef1SDennis Li 	},
147239aa0ef1SDennis Li 	{ "MMEA7_GMIWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT2),
147339aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT2, GMIWR_CMDMEM_SEC_COUNT),
147439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT2, GMIWR_CMDMEM_DED_COUNT),
147539aa0ef1SDennis Li 	},
147639aa0ef1SDennis Li 	{ "MMEA7_GMIWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT2),
147739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT2, GMIWR_DATAMEM_SEC_COUNT),
147839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT2, GMIWR_DATAMEM_DED_COUNT),
147939aa0ef1SDennis Li 	},
148039aa0ef1SDennis Li 	{ "MMEA7_GMIRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT2),
148139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT2, GMIRD_PAGEMEM_SED_COUNT),
148239aa0ef1SDennis Li 	0, 0,
148339aa0ef1SDennis Li 	},
148439aa0ef1SDennis Li 	{ "MMEA7_GMIWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT2),
148539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT2, GMIWR_PAGEMEM_SED_COUNT),
148639aa0ef1SDennis Li 	0, 0,
148739aa0ef1SDennis Li 	},
148839aa0ef1SDennis Li 	{ "MMEA7_DRAMRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT3),
148939aa0ef1SDennis Li 	0, 0,
149039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT3, DRAMRD_PAGEMEM_DED_COUNT),
149139aa0ef1SDennis Li 	},
149239aa0ef1SDennis Li 	{ "MMEA7_DRAMWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT3),
149339aa0ef1SDennis Li 	0, 0,
149439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT3, DRAMWR_PAGEMEM_DED_COUNT),
149539aa0ef1SDennis Li 	},
149639aa0ef1SDennis Li 	{ "MMEA7_IORD_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT3),
149739aa0ef1SDennis Li 	0, 0,
149839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT3, IORD_CMDMEM_DED_COUNT),
149939aa0ef1SDennis Li 	},
150039aa0ef1SDennis Li 	{ "MMEA7_IOWR_CMDMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT3),
150139aa0ef1SDennis Li 	0, 0,
150239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT3, IOWR_CMDMEM_DED_COUNT),
150339aa0ef1SDennis Li 	},
150439aa0ef1SDennis Li 	{ "MMEA7_IOWR_DATAMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT3),
150539aa0ef1SDennis Li 	0, 0,
150639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT3, IOWR_DATAMEM_DED_COUNT),
150739aa0ef1SDennis Li 	},
150839aa0ef1SDennis Li 	{ "MMEA7_GMIRD_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT3),
150939aa0ef1SDennis Li 	0, 0,
151039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT3, GMIRD_PAGEMEM_DED_COUNT),
151139aa0ef1SDennis Li 	},
151239aa0ef1SDennis Li 	{ "MMEA7_GMIWR_PAGEMEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT3),
151339aa0ef1SDennis Li 	0, 0,
151439aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT3, GMIWR_PAGEMEM_DED_COUNT),
151539aa0ef1SDennis Li 	},
151639aa0ef1SDennis Li 	{ "MMEA7_MAM_D0MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT2),
151739aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT2, MAM_D0MEM_SED_COUNT),
151839aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT2, MAM_D0MEM_DED_COUNT),
151939aa0ef1SDennis Li 	},
152039aa0ef1SDennis Li 	{ "MMEA7_MAM_D1MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT2),
152139aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT2, MAM_D1MEM_SED_COUNT),
152239aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT2, MAM_D1MEM_DED_COUNT),
152339aa0ef1SDennis Li 	},
152439aa0ef1SDennis Li 	{ "MMEA7_MAM_D2MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT2),
152539aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT2, MAM_D2MEM_SED_COUNT),
152639aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT2, MAM_D2MEM_DED_COUNT),
152739aa0ef1SDennis Li 	},
152839aa0ef1SDennis Li 	{ "MMEA7_MAM_D3MEM", SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT2),
152939aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT2, MAM_D3MEM_SED_COUNT),
153039aa0ef1SDennis Li 	SOC15_REG_FIELD(MMEA7_EDC_CNT2, MAM_D3MEM_DED_COUNT),
1531f6c3623bSDennis Li 	}
1532f6c3623bSDennis Li };
1533f6c3623bSDennis Li 
1534f6c3623bSDennis Li static const struct soc15_reg_entry mmhub_v9_4_edc_cnt_regs[] = {
1535f6c3623bSDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT), 0, 0, 0 },
1536f6c3623bSDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT2), 0, 0, 0 },
1537f6c3623bSDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_EDC_CNT3), 0, 0, 0 },
1538f6c3623bSDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT), 0, 0, 0 },
1539f6c3623bSDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT2), 0, 0, 0 },
1540f6c3623bSDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_EDC_CNT3), 0, 0, 0 },
154139aa0ef1SDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT), 0, 0, 0 },
154239aa0ef1SDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT2), 0, 0, 0 },
154339aa0ef1SDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_EDC_CNT3), 0, 0, 0 },
154439aa0ef1SDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT), 0, 0, 0 },
154539aa0ef1SDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT2), 0, 0, 0 },
154639aa0ef1SDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_EDC_CNT3), 0, 0, 0 },
154739aa0ef1SDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT), 0, 0, 0 },
154839aa0ef1SDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT2), 0, 0, 0 },
154939aa0ef1SDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_EDC_CNT3), 0, 0, 0 },
155039aa0ef1SDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT), 0, 0, 0 },
155139aa0ef1SDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT2), 0, 0, 0 },
155239aa0ef1SDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_EDC_CNT3), 0, 0, 0 },
155339aa0ef1SDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT), 0, 0, 0 },
155439aa0ef1SDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT2), 0, 0, 0 },
155539aa0ef1SDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_EDC_CNT3), 0, 0, 0 },
155639aa0ef1SDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT), 0, 0, 0 },
155739aa0ef1SDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT2), 0, 0, 0 },
155839aa0ef1SDennis Li 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_EDC_CNT3), 0, 0, 0 },
1559f6c3623bSDennis Li };
1560f6c3623bSDennis Li 
mmhub_v9_4_get_ras_error_count(struct amdgpu_device * adev,const struct soc15_reg_entry * reg,uint32_t value,uint32_t * sec_count,uint32_t * ded_count)15612b961e6aSJohn Clements static int mmhub_v9_4_get_ras_error_count(struct amdgpu_device *adev,
15622b961e6aSJohn Clements 					  const struct soc15_reg_entry *reg,
15632b961e6aSJohn Clements 					  uint32_t value,
15642b961e6aSJohn Clements 					  uint32_t *sec_count,
15652b961e6aSJohn Clements 					  uint32_t *ded_count)
1566f6c3623bSDennis Li {
1567f6c3623bSDennis Li 	uint32_t i;
1568f6c3623bSDennis Li 	uint32_t sec_cnt, ded_cnt;
1569f6c3623bSDennis Li 
1570f6c3623bSDennis Li 	for (i = 0; i < ARRAY_SIZE(mmhub_v9_4_ras_fields); i++) {
1571f6c3623bSDennis Li 		if (mmhub_v9_4_ras_fields[i].reg_offset != reg->reg_offset)
1572f6c3623bSDennis Li 			continue;
1573f6c3623bSDennis Li 
1574f6c3623bSDennis Li 		sec_cnt = (value &
1575f6c3623bSDennis Li 				mmhub_v9_4_ras_fields[i].sec_count_mask) >>
1576f6c3623bSDennis Li 				mmhub_v9_4_ras_fields[i].sec_count_shift;
1577f6c3623bSDennis Li 		if (sec_cnt) {
15782b961e6aSJohn Clements 			dev_info(adev->dev, "MMHUB SubBlock %s, SEC %d\n",
1579f6c3623bSDennis Li 				mmhub_v9_4_ras_fields[i].name,
1580f6c3623bSDennis Li 				sec_cnt);
1581f6c3623bSDennis Li 			*sec_count += sec_cnt;
1582f6c3623bSDennis Li 		}
1583f6c3623bSDennis Li 
1584f6c3623bSDennis Li 		ded_cnt = (value &
1585f6c3623bSDennis Li 				mmhub_v9_4_ras_fields[i].ded_count_mask) >>
1586f6c3623bSDennis Li 				mmhub_v9_4_ras_fields[i].ded_count_shift;
1587f6c3623bSDennis Li 		if (ded_cnt) {
15882b961e6aSJohn Clements 			dev_info(adev->dev, "MMHUB SubBlock %s, DED %d\n",
1589f6c3623bSDennis Li 				mmhub_v9_4_ras_fields[i].name,
1590f6c3623bSDennis Li 				ded_cnt);
1591f6c3623bSDennis Li 			*ded_count += ded_cnt;
1592f6c3623bSDennis Li 		}
1593f6c3623bSDennis Li 	}
1594f6c3623bSDennis Li 
1595f6c3623bSDennis Li 	return 0;
1596f6c3623bSDennis Li }
1597f6c3623bSDennis Li 
mmhub_v9_4_query_ras_error_count(struct amdgpu_device * adev,void * ras_error_status)1598f6c3623bSDennis Li static void mmhub_v9_4_query_ras_error_count(struct amdgpu_device *adev,
1599f6c3623bSDennis Li 					   void *ras_error_status)
1600f6c3623bSDennis Li {
1601f6c3623bSDennis Li 	struct ras_err_data *err_data = (struct ras_err_data *)ras_error_status;
1602f6c3623bSDennis Li 	uint32_t sec_count = 0, ded_count = 0;
1603f6c3623bSDennis Li 	uint32_t i;
1604f6c3623bSDennis Li 	uint32_t reg_value;
1605f6c3623bSDennis Li 
1606f6c3623bSDennis Li 	err_data->ue_count = 0;
1607f6c3623bSDennis Li 	err_data->ce_count = 0;
1608f6c3623bSDennis Li 
1609f6c3623bSDennis Li 	for (i = 0; i < ARRAY_SIZE(mmhub_v9_4_edc_cnt_regs); i++) {
1610f6c3623bSDennis Li 		reg_value =
1611f6c3623bSDennis Li 			RREG32(SOC15_REG_ENTRY_OFFSET(mmhub_v9_4_edc_cnt_regs[i]));
1612f6c3623bSDennis Li 		if (reg_value)
16132b961e6aSJohn Clements 			mmhub_v9_4_get_ras_error_count(adev, &mmhub_v9_4_edc_cnt_regs[i],
1614f6c3623bSDennis Li 				reg_value, &sec_count, &ded_count);
1615f6c3623bSDennis Li 	}
1616f6c3623bSDennis Li 
1617f6c3623bSDennis Li 	err_data->ce_count += sec_count;
1618f6c3623bSDennis Li 	err_data->ue_count += ded_count;
1619f6c3623bSDennis Li }
1620f6c3623bSDennis Li 
mmhub_v9_4_reset_ras_error_count(struct amdgpu_device * adev)1621fe5211f1SHawking Zhang static void mmhub_v9_4_reset_ras_error_count(struct amdgpu_device *adev)
1622fe5211f1SHawking Zhang {
1623fe5211f1SHawking Zhang 	uint32_t i;
1624fe5211f1SHawking Zhang 
1625fe5211f1SHawking Zhang 	/* read back edc counter registers to reset the counters to 0 */
1626fe5211f1SHawking Zhang 	if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__MMHUB)) {
1627fe5211f1SHawking Zhang 		for (i = 0; i < ARRAY_SIZE(mmhub_v9_4_edc_cnt_regs); i++)
1628fe5211f1SHawking Zhang 			RREG32(SOC15_REG_ENTRY_OFFSET(mmhub_v9_4_edc_cnt_regs[i]));
1629fe5211f1SHawking Zhang 	}
1630fe5211f1SHawking Zhang }
1631fe5211f1SHawking Zhang 
16323f975d0fSStanley.Yang static const struct soc15_reg_entry mmhub_v9_4_err_status_regs[] = {
16333f975d0fSStanley.Yang 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA0_ERR_STATUS), 0, 0, 0 },
16343f975d0fSStanley.Yang 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA1_ERR_STATUS), 0, 0, 0 },
16353f975d0fSStanley.Yang 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA2_ERR_STATUS), 0, 0, 0 },
16363f975d0fSStanley.Yang 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA3_ERR_STATUS), 0, 0, 0 },
16373f975d0fSStanley.Yang 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA4_ERR_STATUS), 0, 0, 0 },
16383f975d0fSStanley.Yang 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA5_ERR_STATUS), 0, 0, 0 },
16393f975d0fSStanley.Yang 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA6_ERR_STATUS), 0, 0, 0 },
16403f975d0fSStanley.Yang 	{ SOC15_REG_ENTRY(MMHUB, 0, mmMMEA7_ERR_STATUS), 0, 0, 0 },
16413f975d0fSStanley.Yang };
16423f975d0fSStanley.Yang 
mmhub_v9_4_query_ras_error_status(struct amdgpu_device * adev)16433f975d0fSStanley.Yang static void mmhub_v9_4_query_ras_error_status(struct amdgpu_device *adev)
16443f975d0fSStanley.Yang {
16453f975d0fSStanley.Yang 	int i;
16463f975d0fSStanley.Yang 	uint32_t reg_value;
16473f975d0fSStanley.Yang 
16483f975d0fSStanley.Yang 	if (!amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__MMHUB))
16493f975d0fSStanley.Yang 		return;
16503f975d0fSStanley.Yang 
16513f975d0fSStanley.Yang 	for (i = 0; i < ARRAY_SIZE(mmhub_v9_4_err_status_regs); i++) {
16523f975d0fSStanley.Yang 		reg_value =
16533f975d0fSStanley.Yang 			RREG32(SOC15_REG_ENTRY_OFFSET(mmhub_v9_4_err_status_regs[i]));
165453ee6609SHawking Zhang 		if (REG_GET_FIELD(reg_value, MMEA0_ERR_STATUS, SDP_RDRSP_STATUS) ||
165553ee6609SHawking Zhang 		    REG_GET_FIELD(reg_value, MMEA0_ERR_STATUS, SDP_WRRSP_STATUS) ||
165653ee6609SHawking Zhang 		    REG_GET_FIELD(reg_value, MMEA0_ERR_STATUS, SDP_RDRSP_DATAPARITY_ERROR)) {
165753ee6609SHawking Zhang 			/* SDP read/write error/parity error in FUE_IS_FATAL mode
165853ee6609SHawking Zhang 			 * can cause system fatal error in arcturas. Harvest the error
165953ee6609SHawking Zhang 			 * status before GPU reset */
16603f975d0fSStanley.Yang 			dev_warn(adev->dev, "MMHUB EA err detected at instance: %d, status: 0x%x!\n",
16613f975d0fSStanley.Yang 					i, reg_value);
16623f975d0fSStanley.Yang 		}
16633f975d0fSStanley.Yang 	}
166453ee6609SHawking Zhang }
16653f975d0fSStanley.Yang 
16665e67bba3Syipechai const struct amdgpu_ras_block_hw_ops mmhub_v9_4_ras_hw_ops = {
1667f6c3623bSDennis Li 	.query_ras_error_count = mmhub_v9_4_query_ras_error_count,
1668fe5211f1SHawking Zhang 	.reset_ras_error_count = mmhub_v9_4_reset_ras_error_count,
16698bc7b360SHawking Zhang 	.query_ras_error_status = mmhub_v9_4_query_ras_error_status,
16708bc7b360SHawking Zhang };
16718bc7b360SHawking Zhang 
16725e67bba3Syipechai struct amdgpu_mmhub_ras mmhub_v9_4_ras = {
16735e67bba3Syipechai 	.ras_block = {
16745e67bba3Syipechai 		.hw_ops = &mmhub_v9_4_ras_hw_ops,
16755e67bba3Syipechai 	},
16765e67bba3Syipechai };
16775e67bba3Syipechai 
16788bc7b360SHawking Zhang const struct amdgpu_mmhub_funcs mmhub_v9_4_funcs = {
16799fb1506eSOak Zeng 	.get_fb_location = mmhub_v9_4_get_fb_location,
16809fb1506eSOak Zeng 	.init = mmhub_v9_4_init,
16819fb1506eSOak Zeng 	.gart_enable = mmhub_v9_4_gart_enable,
16829fb1506eSOak Zeng 	.set_fault_enable_default = mmhub_v9_4_set_fault_enable_default,
16839fb1506eSOak Zeng 	.gart_disable = mmhub_v9_4_gart_disable,
16849fb1506eSOak Zeng 	.set_clockgating = mmhub_v9_4_set_clockgating,
16859fb1506eSOak Zeng 	.get_clockgating = mmhub_v9_4_get_clockgating,
16869fb1506eSOak Zeng 	.setup_vm_pt_regs = mmhub_v9_4_setup_vm_pt_regs,
1687f6c3623bSDennis Li };
1688