All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH umr] Add ability to write registers by address
@ 2017-03-15 13:09 Tom St Denis
  0 siblings, 0 replies; only message in thread
From: Tom St Denis @ 2017-03-15 13:09 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Tom St Denis

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
---
 src/app/main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/app/main.c b/src/app/main.c
index 88b4feaf0058..72c29d6a26d4 100644
--- a/src/app/main.c
+++ b/src/app/main.c
@@ -216,9 +216,14 @@ int main(int argc, char **argv)
 			}
 		} else if (!strcmp(argv[i], "--write") || !strcmp(argv[i], "-w")) {
 			if (i + 2 < argc) {
+				uint32_t reg, val;
+
 				if (!asic)
 					asic = get_asic();
-				umr_set_register(asic, argv[i+1], argv[i+2]);
+				if (sscanf(argv[i+1], "%"SCNx32, &reg) == 1 && sscanf(argv[i+2], "%"SCNx32, &val) == 1)
+					umr_write_reg(asic, reg * 4, val);
+				else
+					umr_set_register(asic, argv[i+1], argv[i+2]);
 				i += 2;
 				options.need_scan = 0;
 			} else {
-- 
2.12.0

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-15 13:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-15 13:09 [PATCH umr] Add ability to write registers by address Tom St Denis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.