diff mbox series

[8/9] libsbefifo: Fix register access chip-ops

Message ID 20200622004501.12889-9-amitay@ozlabs.org
State New
Headers show
Series Make register access into thread procedures | expand

Checks

Context Check Description
snowpatch_ozlabs/build-multiarch success Test build-multiarch on branch master
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (b0a62fc11260400ad7518e36cbab9e56dd1bbf5b)

Commit Message

Amitay Isaacs June 22, 2020, 12:45 a.m. UTC
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
---
 libsbefifo/cmd_register.c | 12 ++++++------
 libsbefifo/libsbefifo.h   |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/libsbefifo/cmd_register.c b/libsbefifo/cmd_register.c
index 8737e7f..060d3dc 100644
--- a/libsbefifo/cmd_register.c
+++ b/libsbefifo/cmd_register.c
@@ -22,7 +22,7 @@ 
 #include "libsbefifo.h"
 #include "sbefifo_private.h"
 
-static int sbefifo_register_get_push(uint8_t core_id, uint8_t thread_id, uint8_t reg_type, uint8_t *reg_id, uint8_t reg_count, uint8_t **buf, uint32_t *buflen)
+static int sbefifo_register_get_push(uint8_t core_id, uint8_t thread_id, uint8_t reg_type, uint32_t *reg_id, uint8_t reg_count, uint8_t **buf, uint32_t *buflen)
 {
 	uint32_t *msg;
 	uint32_t nwords, cmd;
@@ -48,7 +48,7 @@  static int sbefifo_register_get_push(uint8_t core_id, uint8_t thread_id, uint8_t
 	msg[1] = htobe32(cmd);
 	msg[2] = htobe32(r);
 	for (i=0; i<reg_count; i++)
-		msg[3+i] = htobe32(reg_id[i] & 0xff);
+		msg[3+i] = htobe32(reg_id[i]);
 
 	*buf = (uint8_t *)msg;
 	return 0;
@@ -77,7 +77,7 @@  static int sbefifo_register_get_pull(uint8_t *buf, uint32_t buflen, uint8_t reg_
 	return 0;
 }
 
-int sbefifo_register_get(struct sbefifo_context *sctx, uint8_t core_id, uint8_t thread_id, uint8_t reg_type, uint8_t *reg_id, uint8_t reg_count, uint64_t **value)
+int sbefifo_register_get(struct sbefifo_context *sctx, uint8_t core_id, uint8_t thread_id, uint8_t reg_type, uint32_t *reg_id, uint8_t reg_count, uint64_t **value)
 {
 	uint8_t *msg, *out;
 	uint32_t msg_len, out_len;
@@ -100,7 +100,7 @@  int sbefifo_register_get(struct sbefifo_context *sctx, uint8_t core_id, uint8_t
 	return rc;
 }
 
-static int sbefifo_register_put_push(uint8_t core_id, uint8_t thread_id, uint8_t reg_type, uint8_t *reg_id, uint8_t reg_count, uint64_t *value, uint8_t **buf, uint32_t *buflen)
+static int sbefifo_register_put_push(uint8_t core_id, uint8_t thread_id, uint8_t reg_type, uint32_t *reg_id, uint8_t reg_count, uint64_t *value, uint8_t **buf, uint32_t *buflen)
 {
 	uint32_t *msg;
 	uint32_t nwords, cmd;
@@ -126,7 +126,7 @@  static int sbefifo_register_put_push(uint8_t core_id, uint8_t thread_id, uint8_t
 	msg[1] = htobe32(cmd);
 	msg[2] = htobe32(r);
 	for (i=0; i<reg_count; i++) {
-		msg[3+i*3] = htobe32(reg_id[i] & 0xff);
+		msg[3+i*3] = htobe32(reg_id[i]);
 		msg[3+i*3+1] = htobe32(value[i] >> 32);
 		msg[3+i*3+2] = htobe32(value[i] & 0xffffffff);
 	}
@@ -143,7 +143,7 @@  static int sbefifo_register_put_pull(uint8_t *buf, uint32_t buflen)
 	return 0;
 }
 
-int sbefifo_register_put(struct sbefifo_context *sctx, uint8_t core_id, uint8_t thread_id, uint8_t reg_type, uint8_t *reg_id, uint8_t reg_count, uint64_t *value)
+int sbefifo_register_put(struct sbefifo_context *sctx, uint8_t core_id, uint8_t thread_id, uint8_t reg_type, uint32_t *reg_id, uint8_t reg_count, uint64_t *value)
 {
 	uint8_t *msg, *out;
 	uint32_t msg_len, out_len;
diff --git a/libsbefifo/libsbefifo.h b/libsbefifo/libsbefifo.h
index 2efb25c..cbfb76d 100644
--- a/libsbefifo/libsbefifo.h
+++ b/libsbefifo/libsbefifo.h
@@ -104,8 +104,8 @@  int sbefifo_occsram_put(struct sbefifo_context *sctx, uint32_t addr, uint8_t *da
 #define SBEFIFO_REGISTER_TYPE_SPR	0x1
 #define SBEFIFO_REGISTER_TYPE_FPR	0x2
 
-int sbefifo_register_get(struct sbefifo_context *sctx, uint8_t core_id, uint8_t thread_id, uint8_t reg_type, uint8_t *reg_id, uint8_t reg_count, uint64_t **value);
-int sbefifo_register_put(struct sbefifo_context *sctx, uint8_t core_id, uint8_t thread_id, uint8_t reg_type, uint8_t *reg_id, uint8_t reg_count, uint64_t *value);
+int sbefifo_register_get(struct sbefifo_context *sctx, uint8_t core_id, uint8_t thread_id, uint8_t reg_type, uint32_t *reg_id, uint8_t reg_count, uint64_t **value);
+int sbefifo_register_put(struct sbefifo_context *sctx, uint8_t core_id, uint8_t thread_id, uint8_t reg_type, uint32_t *reg_id, uint8_t reg_count, uint64_t *value);
 
 int sbefifo_control_fast_array(struct sbefifo_context *sctx, uint16_t target_type, uint8_t chiplet_id, uint8_t mode, uint64_t clock_cycle);
 int sbefifo_control_trace_array(struct sbefifo_context *sctx, uint16_t target_type, uint8_t chiplet_id, uint16_t array_id, uint16_t operation, uint8_t **trace_data, uint32_t *trace_data_len);