summaryrefslogtreecommitdiffstats
path: root/tools/csr.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/csr.c')
-rw-r--r--tools/csr.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/csr.c b/tools/csr.c
index 4ab38232..936a20f9 100644
--- a/tools/csr.c
+++ b/tools/csr.c
@@ -720,3 +720,24 @@ int csr_write_pskey_uint16(int dd, uint16_t seqnum, uint16_t pskey, uint16_t sto
return csr_write_pskey_complex(dd, seqnum, pskey, store, array, 2);
}
+
+int csr_read_pskey_uint32(int dd, uint16_t seqnum, uint16_t pskey, uint16_t store, uint32_t *value)
+{
+ uint8_t array[4] = { 0x00, 0x00, 0x00, 0x00 };
+ int err;
+
+ err = csr_read_pskey_complex(dd, seqnum, pskey, store, array, 4);
+
+ *value = ((array[0] + (array[1] << 8)) << 16) +
+ (array[2] + (array[3] << 8));
+
+ return err;
+}
+
+int csr_write_pskey_uint32(int dd, uint16_t seqnum, uint16_t pskey, uint16_t store, uint32_t value)
+{
+ uint8_t array[4] = { (value & 0xff0000) >> 16, value >> 24,
+ value & 0xff, (value & 0xff00) >> 8 };
+
+ return csr_write_pskey_complex(dd, seqnum, pskey, store, array, 4);
+}