Change in osmocom-bb[master]: osmocon: More decoding of tpu_debug (on compal/rffe_dualband)

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Oct 28 17:27:11 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/20886 )

Change subject: osmocon: More decoding of tpu_debug (on compal/rffe_dualband)
......................................................................

osmocon: More decoding of tpu_debug (on compal/rffe_dualband)

Let's give a more human-readable decode of the TPU instructions,
naming the TSPACT pin names as well as the device_id/strobe.

Change-Id: Iac1ac74ac3e41cff9d3d347a167b43af58cc6e59
---
M src/host/osmocon/tpu_debug.c
1 file changed, 61 insertions(+), 1 deletion(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/host/osmocon/tpu_debug.c b/src/host/osmocon/tpu_debug.c
index c9dac90..9160b01 100644
--- a/src/host/osmocon/tpu_debug.c
+++ b/src/host/osmocon/tpu_debug.c
@@ -57,6 +57,60 @@
 
 static uint8_t tpu_reg_cache[0x1f];
 static uint16_t tpu_qbit;
+static uint16_t tspact_cache;
+
+static const char *tspact_name(unsigned int n)
+{
+	static char buf[32];
+
+	/* FIXME: This is rffe_dualband.c specific */
+	switch (n) {
+	case 0:
+		return "RITA_RESET";
+	case 1:
+		return "PA_ENABLE";
+	case 6:
+		return "TRENA";
+	case 8:
+		return "GSM_TXEN";
+	default:
+		snprintf(buf, sizeof(buf), "TSPACT%u", n);
+		return buf;
+	}
+}
+
+static const char *tps_strobe_name(unsigned int n)
+{
+	static char buf[32];
+
+	switch (n) {
+	case 0:
+		return "TWL3025";
+	case 2:
+		return "TRF6151";
+	default:
+		snprintf(buf, sizeof(buf), "STROBE%u", n);
+		return buf;
+	}
+}
+
+static void handle_tspact(uint16_t mask, uint16_t bits)
+{
+	uint16_t newval = (tspact_cache & mask) | bits;
+	unsigned int i;
+
+	if (newval == tspact_cache)
+		return;
+
+	for (i = 0; i < 16; i++) {
+		uint16_t shifted = (1 << i);
+		if ((tspact_cache & shifted) != (newval & shifted)) {
+			printf("%s:%d->%d ", tspact_name(i),
+				tspact_cache & shifted ? 1 : 0, newval & shifted ? 1 : 0);
+		}
+	}
+	tspact_cache = newval;
+}
 
 static void tpu_show_instr(uint16_t tpu)
 {
@@ -93,7 +147,7 @@
 		switch (addr) {
 		case 0:
 			bitlen = (data & 0x1f) + 1;
-			printf("DEV_IDX=%u, BITLEN=%u ", data >> 5, bitlen);
+			printf("DEV_IDX=%s, BITLEN=%u ", tps_strobe_name(data >> 5), bitlen);
 			if (bitlen <= 8) {
 				tsp_data = tpu_reg_cache[4];
 				printf(" TSP_DATA=0x%02x ", tsp_data);
@@ -120,6 +174,12 @@
 			if (data & 0x02)
 				printf("WRITE ");
 			break;
+		case 6:
+			handle_tspact(0xff00, data);
+			break;
+		case 7:
+			handle_tspact(0x00ff, data << 8);
+			break;
 		}
 	}
 	printf("\n");

-- 
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/20886
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Iac1ac74ac3e41cff9d3d347a167b43af58cc6e59
Gerrit-Change-Number: 20886
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201028/fa4c84fa/attachment.htm>


More information about the gerrit-log mailing list