summaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/xarray.py
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2025-07-14 11:34:22 +0100
committerMark Brown <broonie@kernel.org>2025-07-14 11:34:22 +0100
commitb88b7e2096665dec5931c1d20b0b6269aa4bfaa4 (patch)
treec1eba5b590158d6d6d467a428952054b89e86e1d /scripts/gdb/linux/xarray.py
parentb30d390812c8559c5835f8ae5f490b38488fafc8 (diff)
parent3aa47d2ec83316c24e1ed15a492b331802dc6a69 (diff)
Add RPMh regulator support for PM7550 & PMR735B
Merge series from Luca Weiss <luca.weiss@fairphone.com>: Document and add support for the regulators on PM7550 and PMR735B, which can be paired with the Milos SoC.
Diffstat (limited to 'scripts/gdb/linux/xarray.py')
-rw-r--r--scripts/gdb/linux/xarray.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/gdb/linux/xarray.py b/scripts/gdb/linux/xarray.py
new file mode 100644
index 000000000000..f4477b5def75
--- /dev/null
+++ b/scripts/gdb/linux/xarray.py
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# Xarray helpers
+#
+# Copyright (c) 2025 Broadcom
+#
+# Authors:
+# Florian Fainelli <florian.fainelli@broadcom.com>
+
+import gdb
+
+from linux import utils
+from linux import constants
+
+def xa_is_internal(entry):
+ ulong_type = utils.get_ulong_type()
+ return ((entry.cast(ulong_type) & 3) == 2)
+
+def xa_mk_internal(v):
+ return ((v << 2) | 2)
+
+def xa_is_zero(entry):
+ ulong_type = utils.get_ulong_type()
+ return entry.cast(ulong_type) == xa_mk_internal(257)
+
+def xa_is_node(entry):
+ ulong_type = utils.get_ulong_type()
+ return xa_is_internal(entry) and (entry.cast(ulong_type) > 4096)