Improve --lookup command to allow register names.
PATCH 1/1 Improve --lookup command to allow register names.
This is handy if you are given a debug output with a register name and value you want to decode. For instance, a VM fault in the kernel log,
$ umr -i 1 -O bits --lookup mmVM_CONTEXT1_PROTECTION_FAULT_STATUS 0x0803D00C
gmc81.mmVM_CONTEXT1_PROTECTION_FAULT_STATUS => 0x0803d00c
.PROTECTIONS[0:7] == 12 (0x0000000c)
.MEMORY_CLIENT_ID[12:20] == 61 (0x0000003d)
.MEMORY_CLIENT_RW[24:24] == 0 (0x00000000)
.VMID[25:28] == 4 (0x00000004)
.ATOMIC[29:29] == 0 (0x00000000)Signed-off-by Tom St Denis <[email protected]>
--- doc/umr.1 | 5 +++-- src/app/main.c | 6 +++++- src/app/umr_lookup.c | 41 ++++++++++++++++++++++++++++------------- 3 files changed, 36 insertions(+), 16 deletions(-)
doc/umr.1 +3 -2
@@ -32,8 +32,9 @@ Enumerate all AMDGPU supported devices. List all blocks attached to the asic that has been detected. .IP "--list-regs, -lr <string>" List all registers in an IP block (can use '-O bits' to list bitfields) -.IP "--lookup, -lu <address> <number>" -Look up an MMIO register by address and bitfield decode the value specified. +.IP "--lookup, -lu <address_or_regname> <number>" +Look up an MMIO register by address and bitfield decode the value specified (with 0x prefix) or by +register name. .IP "--write -w <string> <number>" Write a value specified in hex to a register specified with a complete register path in the form <
src/app/main.c +5 -1
@@ -393,12 +393,16 @@ int main(int argc, char **argv)"\n\t--bank, -b <se_bank> <sh_bank> <instance>\n\t\tSelect a GFX INSTANCE/SH/SE bank in decimal. Can use 'x' to denote broadcast.\n" "\n\t--force, -f <number>\n\t\tForce a PCIE DID number in hex or asic name. Useful if amdgpu is" "\n\t\tnot loaded or a display is not attached.\n" +"\n\t--pci <device>" +"\n\t\tForce a specific PCI device using the domain:bus:slot.function format in hex." +"\n\t\tThis is useful when more than one GPU is available. If the amdgpu driver is" +"\n\t\tloaded the corresponding instance will be automatically detected.\n" "\n\t--print, -p\n\t\tEnable dumping of all device registers. (default: off)\n" "\n\t--config, -c\n\t\tPrint out configuation data read from kernel driver.\n" "\n\t--enumerate, -e\n\t\tEnumerate all AMDGPU devices detected.\n" "\n\t--list-blocks, -lb\n\t\tList IP blocks discovered for this device.\n" "\n\t--list-regs, -lr <string>\n\t\tList registers for a given IP block (can use '-O bits' to list bitfields).\n" -"\n\t--lookup, -lu <address> <value>\n\t\tLook up bit decoding of an MMIO register by address.\n" +"\n\t--lookup, -lu <address_or_regname> <value>\n\t\tLook up bit decoding of an MMIO register by address (with 0x prefix) or by register name.\n" "\n\t--write, -w <address> <number>\n\t\tWrite a value in hex to a register specified as a register path in the" "\n\t\tform <asicname.ipname.regname>. For instance \"tonga.uvd5.mmUVD_SOFT_RESET\"." "\n\t\tCan be used multiple times to set multiple registers. You can"
src/app/umr_lookup.c +28 -13
51 lines not on this page · raw message
Signature · 6 lines
2.12.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx