Skip to contentSkip to conversation

Add NBIO 4.3 Support

PATCH New Alex Deucher 1 participant 3 messages Apr 27, 2022

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

cover Add NBIO 4.3 Support

This patch set add support for New Bus IO (NBIO) version 4.3. This block handles the device interactions with the PCIe bus on GPUs. The first patch is register headers so I did not send it out due to size.

Hawking Zhang (1):
drm/amdgpu: add nbio v4_3_0 ip headers v6

Likun Gao (1):
drm/amdgpu/discovery: add NBIO 4.3 Support

Stanley.Yang (1):
drm/amdgpu: add nbio v4_3_0 ip block v2

 drivers/gpu/drm/amd/amdgpu/Makefile           |     3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c |     5 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.h      |     1 +
 drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c        |   368 +
 drivers/gpu/drm/amd/amdgpu/nbio_v4_3.h        |    32 +
 .../include/asic_reg/nbio/nbio_4_3_0_offset.h | 17379 ++++
 .../asic_reg/nbio/nbio_4_3_0_sh_mask.h        | 82049 ++++++++++++++++
 7 files changed, 99836 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c
 create mode 100644 drivers/gpu/drm/amd/amdgpu/nbio_v4_3.h
 create mode 100644 drivers/gpu/drm/amd/include/asic_reg/nbio/nbio_4_3_0_offset.h
 create mode 100644 drivers/gpu/drm/amd/include/asic_reg/nbio/nbio_4_3_0_sh_mask.h
Signature · 1 line
2.35.1
author maintainer
#1 lore raw

PATCH 2/3 drm/amdgpu: add nbio v4_3_0 ip block v2

From: "Stanley.Yang" <[email protected]>

This adds nbio v4_3_0 ip block support

Changed from v1:
use WREG32_SOC15/RREG32_SOC15 instead of
WREG32_PCIE/RREG32_PCIE
remove the programming of PCIE_CONFIG_CNTL

---
 drivers/gpu/drm/amd/amdgpu/Makefile      |   3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.h |   1 +
 drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c   | 368 +++++++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/nbio_v4_3.h   |  32 ++
 4 files changed, 403 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c
 create mode 100644 drivers/gpu/drm/amd/amdgpu/nbio_v4_3.h
drivers/gpu/drm/amd/amdgpu/Makefile +2 -1
index 2b454e7d7a76..313af306687b 100644
@@ -74,7 +74,8 @@ amdgpu-$(CONFIG_DRM_AMDGPU_SI)+= si.o gmc_v6_0.o gfx_v6_0.o si_ih.o si_dma.o dce
 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_v7_2.o hdp_v4_0.o hdp_v5_0.o aldebaran_reg_init.o aldebaran.o soc21.o \
+	nbio_v4_3.o
 
 # add DF block
 amdgpu-y += \
drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.h +1 -0
index ccd9fe96fab7..a240336bbc6b 100644
@@ -70,6 +70,7 @@ struct amdgpu_nbio_funcs {
 			bool use_doorbell, int doorbell_index, int doorbell_size);
 	void (*vcn_doorbell_range)(struct amdgpu_device *adev, bool use_doorbell,
 				   int doorbell_index, int instance);
+	void (*gc_doorbell_init)(struct amdgpu_device *adev);
 	void (*enable_doorbell_aperture)(struct amdgpu_device *adev,
 					 bool enable);
 	void (*enable_doorbell_selfring_aperture)(struct amdgpu_device *adev,
drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c new file +368 -0

368 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/nbio_v4_3.h new file +32 -0
new file mode 100644
index 000000000000..ade43661d7a9
@@ -0,0 +1,32 @@
+/*
+ * 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_V4_3_H__
+#define __NBIO_V4_3_H__
+
+#include "soc15_common.h"
+
+extern const struct nbio_hdp_flush_reg nbio_v4_3_hdp_flush_reg;
+extern const struct amdgpu_nbio_funcs nbio_v4_3_funcs;
+
+#endif
Signature · 1 line
2.35.1
author maintainer
#2 lore raw

PATCH 3/3 drm/amdgpu/discovery: add NBIO 4.3 Support

In reply to Alex Deucher

From: Likun Gao <[email protected]>

Enable NBIO 4.3 on asics where it is present.

---
 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 8a2cc1c36f0d..f11c01982cd4 100644
@@ -50,6 +50,7 @@
 #include "gfxhub_v2_0.h"
 #include "mmhub_v2_0.h"
 #include "nbio_v2_3.h"
+#include "nbio_v4_3.h"
 #include "nbio_v7_2.h"
 #include "hdp_v5_0.h"
 #include "nv.h"
@@ -2144,6 +2145,10 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
 		adev->nbio.funcs = &nbio_v2_3_funcs;
 		adev->nbio.hdp_flush_reg = &nbio_v2_3_hdp_flush_reg_sc;
 		break;
+	case IP_VERSION(4, 3, 0):
+		adev->nbio.funcs = &nbio_v4_3_funcs;
+		adev->nbio.hdp_flush_reg = &nbio_v4_3_hdp_flush_reg;
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.35.1