Skip to contentSkip to conversation

Add NBIO 7.7 support

PATCH New Alex Deucher 1 participant 4 messages May 3, 2022

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

cover Add NBIO 7.7 support

This adds support for New Bus IO (NBIO) version 7.7. The NBIO IP handles the GPU's interface to the PCI bus. Patch 1 adds very large register headers so was not sent to the list.

Huang Rui (1):
drm/amdgpu: add nbio v7_7_0 ip headers

Xiaojian Du (3):
drm/amdgpu: add pcie port function helpers for SOC21 drm/amdgpu: add the files of NBIO v7.7 block drm/admgpu/discovery: add NBIO v7.7 into the IP discovery list

 drivers/gpu/drm/amd/amdgpu/Makefile           |      2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c |      5 +
 drivers/gpu/drm/amd/amdgpu/nbio_v7_7.c        |    241 +
 drivers/gpu/drm/amd/amdgpu/nbio_v7_7.h        |     33 +
 drivers/gpu/drm/amd/amdgpu/soc21.c            |      2 +
 .../include/asic_reg/nbio/nbio_7_7_0_offset.h |  29654 +++
 .../asic_reg/nbio/nbio_7_7_0_sh_mask.h        | 154403 +++++++++++++++
 7 files changed, 184339 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/amd/amdgpu/nbio_v7_7.c
 create mode 100644 drivers/gpu/drm/amd/amdgpu/nbio_v7_7.h
 create mode 100644 drivers/gpu/drm/amd/include/asic_reg/nbio/nbio_7_7_0_offset.h
 create mode 100644 drivers/gpu/drm/amd/include/asic_reg/nbio/nbio_7_7_0_sh_mask.h
Signature · 1 line
2.35.1
author maintainer
#1 lore raw

PATCH 2/4 drm/amdgpu: add pcie port function helpers for SOC21

From: Xiaojian Du <[email protected]>

These helpers will be used on NBIO v7.7.0.

---
 drivers/gpu/drm/amd/amdgpu/soc21.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/soc21.c +2 -0
index 29acc5573f56..9424020c0634 100644
@@ -511,6 +511,8 @@ static int soc21_common_early_init(void *handle)
 	adev->pcie_wreg = &soc21_pcie_wreg;
 	adev->pcie_rreg64 = &soc21_pcie_rreg64;
 	adev->pcie_wreg64 = &soc21_pcie_wreg64;
+	adev->pciep_rreg = amdgpu_device_pcie_port_rreg;
+	adev->pciep_wreg = amdgpu_device_pcie_port_wreg;
 
 	/* TODO: will add them during VCN v2 implementation */
 	adev->uvd_ctx_rreg = NULL;
Signature · 1 line
2.35.1
author maintainer
#2 lore raw

PATCH 3/4 drm/amdgpu: add the files of NBIO v7.7 block

In reply to Alex Deucher

From: Xiaojian Du <[email protected]>

This patch is to add the files of NBIO v7.7 block. NBIO (New Bus IO) is the block which handles the GPU interface to the PCIe bus.

v2: squash in register name fix (Xiaojian)

---
 drivers/gpu/drm/amd/amdgpu/Makefile    |   2 +-
 drivers/gpu/drm/amd/amdgpu/nbio_v7_7.c | 241 +++++++++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/nbio_v7_7.h |  33 ++++
 3 files changed, 275 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/amd/amdgpu/nbio_v7_7.c
 create mode 100644 drivers/gpu/drm/amd/amdgpu/nbio_v7_7.h
drivers/gpu/drm/amd/amdgpu/Makefile +1 -1
index d4e7d297f883..f2d64b156ba4 100644
@@ -75,7 +75,7 @@ amdgpu-y += \
 	vi.o mxgpu_vi.o nbio_v6_1.o soc15.o emu_soc.o mxgpu_ai.o nbio_v7_0.o vega10_reg_init.o \
 	vega20_reg_init.o nbio_v7_4.o nbio_v2_3.o nv.o arct_reg_init.o mxgpu_nv.o \
 	nbio_v7_2.o hdp_v4_0.o hdp_v5_0.o aldebaran_reg_init.o aldebaran.o soc21.o \
-	nbio_v4_3.o hdp_v6_0.o
+	nbio_v4_3.o hdp_v6_0.o nbio_v7_7.o
 
 # add DF block
 amdgpu-y += \
drivers/gpu/drm/amd/amdgpu/nbio_v7_7.c new file +241 -0

241 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/nbio_v7_7.h new file +33 -0
new file mode 100644
index 000000000000..2a33b256ba81
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2021 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef __NBIO_V7_7_H__
+#define __NBIO_V7_7_H__
+
+#include "soc15_common.h"
+
+extern const struct nbio_hdp_flush_reg nbio_v7_7_hdp_flush_reg;
+extern const struct amdgpu_nbio_funcs nbio_v7_7_funcs;
+extern const struct amdgpu_nbio_ras_funcs nbio_v7_7_ras_funcs;
+
+#endif
Signature · 1 line
2.35.1
author maintainer
#3 lore raw

PATCH 4/4 drm/admgpu/discovery: add NBIO v7.7 into the IP discovery list

In reply to Alex Deucher

From: Xiaojian Du <[email protected]>

This patch is to add NBIO v7.7 into the IP discovery list.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +5 -0
index 7ffbe38450cc..2188b9277a6d 100644
@@ -53,6 +53,7 @@
 #include "nbio_v2_3.h"
 #include "nbio_v4_3.h"
 #include "nbio_v7_2.h"
+#include "nbio_v7_7.h"
 #include "hdp_v5_0.h"
 #include "hdp_v6_0.h"
 #include "nv.h"
@@ -2200,6 +2201,10 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
 		adev->nbio.funcs = &nbio_v4_3_funcs;
 		adev->nbio.hdp_flush_reg = &nbio_v4_3_hdp_flush_reg;
 		break;
+	case IP_VERSION(7, 7, 0):
+		adev->nbio.funcs = &nbio_v7_7_funcs;
+		adev->nbio.hdp_flush_reg = &nbio_v7_7_hdp_flush_reg;
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.35.1