[PATCH umr] Add UMC60 block for vega10

Tom St Denis tom.stdenis at amd.com
Wed Nov 15 15:37:11 UTC 2017


Signed-off-by: Tom St Denis <tom.stdenis at amd.com>
---
 scripts/soc15_parse.sh    |  1 +
 src/lib/asic/vega10.c     |  1 +
 src/lib/ip/CMakeLists.txt |  1 +
 src/lib/ip/umc60.c        | 55 +++++++++++++++++++++++++++++++++++++++++++++++
 src/lib/ip/umc60_bits.i   | 10 +++++++++
 src/lib/ip/umc60_regs.i   | 12 +++++++++++
 src/umr.h                 |  1 +
 7 files changed, 81 insertions(+)
 create mode 100644 src/lib/ip/umc60.c
 create mode 100644 src/lib/ip/umc60_bits.i
 create mode 100644 src/lib/ip/umc60_regs.i

diff --git a/scripts/soc15_parse.sh b/scripts/soc15_parse.sh
index 92c616cab013..2241dc07c601 100644
--- a/scripts/soc15_parse.sh
+++ b/scripts/soc15_parse.sh
@@ -84,6 +84,7 @@ parse_bits ${pk}/vega10/NBIO/nbio_6_1 src/lib/ip/nbio61
 parse_bits ${pk}/vega10/HDP/hdp_4_0 src/lib/ip/hdp40
 parse_bits ${pk}/vega10/MMHUB/mmhub_1_0 src/lib/ip/mmhub10
 parse_bits ${pk}/vega10/MP/mp_9_0 src/lib/ip/mp90
+parse_bits ${pk}/vega10/UMC/umc_6_0 src/lib/ip/umc60
 
 parse_bits ${pk}/raven1/VCN/vcn_1_0 src/lib/ip/vcn10
 parse_bits ${pk}/raven1/DCN/dcn_1_0 src/lib/ip/dcn10
diff --git a/src/lib/asic/vega10.c b/src/lib/asic/vega10.c
index 933d37fcfd24..744de298e44c 100644
--- a/src/lib/asic/vega10.c
+++ b/src/lib/asic/vega10.c
@@ -45,6 +45,7 @@ struct umr_asic *umr_create_vega10(struct umr_options *options)
 			umr_create_thm90(vega10_offs, options),
 			umr_create_mmhub10(vega10_offs, options),
 			umr_create_mp90(vega10_offs, options),
+			umr_create_umc60(vega10_offs, options),
 			NULL);
 }
 
diff --git a/src/lib/ip/CMakeLists.txt b/src/lib/ip/CMakeLists.txt
index a311b141d58a..c9cc1172e715 100644
--- a/src/lib/ip/CMakeLists.txt
+++ b/src/lib/ip/CMakeLists.txt
@@ -47,6 +47,7 @@ add_library(ip OBJECT
   smu713.c
   smu80.c
   thm90.c
+  umc60.c
   uvd40.c
   uvd42.c
   uvd5.c
diff --git a/src/lib/ip/umc60.c b/src/lib/ip/umc60.c
new file mode 100644
index 000000000000..30b18a217e1b
--- /dev/null
+++ b/src/lib/ip/umc60.c
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2017 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.
+ *
+ * Authors: Tom St Denis <tom.stdenis at amd.com>
+ *
+ */
+#include "umr.h"
+
+#include "umc60_bits.i"
+
+static const struct umr_reg_soc15 umc60_registers[] = {
+#include "umc60_regs.i"
+};
+
+struct umr_ip_block *umr_create_umc60(struct umr_ip_offsets_soc15 *soc15_offsets, struct umr_options *options)
+{
+	struct umr_ip_block *ip;
+
+	ip = calloc(1, sizeof *ip);
+	if (!ip)
+		return NULL;
+
+	ip->ipname = "umc60";
+	ip->no_regs = sizeof(umc60_registers)/sizeof(umc60_registers[0]);
+	ip->regs = calloc(ip->no_regs, sizeof(ip->regs[0]));
+	if (!ip->regs) {
+		free(ip);
+		return NULL;
+	}
+
+	if (umr_transfer_soc15_to_reg(options, soc15_offsets, "UMC", umc60_registers, ip)) {
+		free(ip);
+		return NULL;
+	}
+
+	return ip;
+}
diff --git a/src/lib/ip/umc60_bits.i b/src/lib/ip/umc60_bits.i
new file mode 100644
index 000000000000..1a3896c90fae
--- /dev/null
+++ b/src/lib/ip/umc60_bits.i
@@ -0,0 +1,10 @@
+static struct umr_bitfield mmUMCCH0_0_EccCtrl[] = {
+	 { "RdEccEn", 10, 10, &umr_bitfield_default },
+	 { "WrEccEn", 0, 0, &umr_bitfield_default },
+};
+static struct umr_bitfield mmUMCCH0_0_UMC_CONFIG[] = {
+	 { "DramReady", 31, 31, &umr_bitfield_default },
+};
+static struct umr_bitfield mmUMCCH0_0_UmcLocalCap[] = {
+	 { "EccDis", 0, 0, &umr_bitfield_default },
+};
diff --git a/src/lib/ip/umc60_regs.i b/src/lib/ip/umc60_regs.i
new file mode 100644
index 000000000000..822f8f751fc3
--- /dev/null
+++ b/src/lib/ip/umc60_regs.i
@@ -0,0 +1,12 @@
+	{ "mmUMCCH0_0_EccCtrl", REG_MMIO, 0x0053, 0, &mmUMCCH0_0_EccCtrl[0], sizeof(mmUMCCH0_0_EccCtrl)/sizeof(mmUMCCH0_0_EccCtrl[0]), 0, 0 },
+	{ "mmUMCCH1_0_EccCtrl", REG_MMIO, 0x0853, 0, NULL, 0, 0, 0 },
+	{ "mmUMCCH2_0_EccCtrl", REG_MMIO, 0x1053, 0, NULL, 0, 0, 0 },
+	{ "mmUMCCH3_0_EccCtrl", REG_MMIO, 0x1853, 0, NULL, 0, 0, 0 },
+	{ "mmUMCCH0_0_UMC_CONFIG", REG_MMIO, 0x0040, 0, &mmUMCCH0_0_UMC_CONFIG[0], sizeof(mmUMCCH0_0_UMC_CONFIG)/sizeof(mmUMCCH0_0_UMC_CONFIG[0]), 0, 0 },
+	{ "mmUMCCH1_0_UMC_CONFIG", REG_MMIO, 0x0840, 0, NULL, 0, 0, 0 },
+	{ "mmUMCCH2_0_UMC_CONFIG", REG_MMIO, 0x1040, 0, NULL, 0, 0, 0 },
+	{ "mmUMCCH3_0_UMC_CONFIG", REG_MMIO, 0x1840, 0, NULL, 0, 0, 0 },
+	{ "mmUMCCH0_0_UmcLocalCap", REG_MMIO, 0x0306, 0, &mmUMCCH0_0_UmcLocalCap[0], sizeof(mmUMCCH0_0_UmcLocalCap)/sizeof(mmUMCCH0_0_UmcLocalCap[0]), 0, 0 },
+	{ "mmUMCCH1_0_UmcLocalCap", REG_MMIO, 0x0b06, 0, NULL, 0, 0, 0 },
+	{ "mmUMCCH2_0_UmcLocalCap", REG_MMIO, 0x1306, 0, NULL, 0, 0, 0 },
+	{ "mmUMCCH3_0_UmcLocalCap", REG_MMIO, 0x1b06, 0, NULL, 0, 0, 0 },
diff --git a/src/umr.h b/src/umr.h
index 757ac6369136..1742e7e1550b 100644
--- a/src/umr.h
+++ b/src/umr.h
@@ -407,6 +407,7 @@ struct umr_ip_block *umr_create_mp90(struct umr_ip_offsets_soc15 *soc15_offsets,
 struct umr_ip_block *umr_create_mp100(struct umr_ip_offsets_soc15 *soc15_offsets, struct umr_options *options);
 struct umr_ip_block *umr_create_thm90(struct umr_ip_offsets_soc15 *soc15_offsets, struct umr_options *options);
 struct umr_ip_block *umr_create_vcn10(struct umr_ip_offsets_soc15 *soc15_offsets, struct umr_options *options);
+struct umr_ip_block *umr_create_umc60(struct umr_ip_offsets_soc15 *soc15_offsets, struct umr_options *options);
 
 /* ip block constructors */
 struct umr_ip_block *umr_create_uvd40(struct umr_options *options);
-- 
2.12.0



More information about the amd-gfx mailing list