Change-Id: Id64eb98f5b1c24b51eb2fd5a083086fc3515813d
Signed-off-by: Oak Zeng <oz...@amd.com>
Suggested-by: Felix Kuehling <felix.kuehl...@amd.com>
Suggested-by: Alex Deucher <alexander.deuc...@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/Makefile                |  3 +-
 drivers/gpu/drm/amd/amdgpu/vi.h                    |  2 +-
 .../gpu/drm/amd/amdgpu/vi_doorbell_index_init.c    | 43 ++++++++++++++++++++++
 3 files changed, 46 insertions(+), 2 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/amdgpu/vi_doorbell_index_init.c

diff --git a/drivers/gpu/drm/amd/amdgpu/Makefile 
b/drivers/gpu/drm/amd/amdgpu/Makefile
index 96a4e1c..3ab8eba 100644
--- a/drivers/gpu/drm/amd/amdgpu/Makefile
+++ b/drivers/gpu/drm/amd/amdgpu/Makefile
@@ -63,7 +63,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 vega10_doorbell_index_init.o 
vega12_doorbell_index_init.o
+       vega20_reg_init.o nbio_v7_4.o vega10_doorbell_index_init.o 
vega12_doorbell_index_init.o \
+       vi_doorbell_index_init.o
 
 # add DF block
 amdgpu-y += \
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.h b/drivers/gpu/drm/amd/amdgpu/vi.h
index 0429fe3..abcb52e 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.h
+++ b/drivers/gpu/drm/amd/amdgpu/vi.h
@@ -29,5 +29,5 @@
 void vi_srbm_select(struct amdgpu_device *adev,
                    u32 me, u32 pipe, u32 queue, u32 vmid);
 int vi_set_ip_blocks(struct amdgpu_device *adev);
-
+void vi_doorbell_index_init(struct amdgpu_device *adev);
 #endif
diff --git a/drivers/gpu/drm/amd/amdgpu/vi_doorbell_index_init.c 
b/drivers/gpu/drm/amd/amdgpu/vi_doorbell_index_init.c
new file mode 100644
index 0000000..cae2ab6
--- /dev/null
+++ b/drivers/gpu/drm/amd/amdgpu/vi_doorbell_index_init.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2018 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.
+ *
+ */
+
+#include "amdgpu.h"
+
+void vi_doorbell_index_init(struct amdgpu_device *adev)
+{
+       adev->doorbell_index.kiq = 0x00;
+       adev->doorbell_index.mec_ring0 = 0x10;
+       adev->doorbell_index.mec_ring1 = 0x11;
+       adev->doorbell_index.mec_ring2 = 0x12;
+       adev->doorbell_index.mec_ring3 = 0x13;
+       adev->doorbell_index.mec_ring4 = 0x14;
+       adev->doorbell_index.mec_ring5 = 0x15;
+       adev->doorbell_index.mec_ring6 = 0x16;
+       adev->doorbell_index.mec_ring7 = 0x17;
+       adev->doorbell_index.gfx_ring0 = 0x20;
+       adev->doorbell_index.sdma_engine0 = 0x1e0;
+       adev->doorbell_index.sdma_engine1 = 0x1e1;
+       adev->doorbell_index.ih = 0x1e8;
+       adev->doorbell_index.max_assignment = 0x3ff;
+}
+
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to