Christian Costa
2014-Aug-27 06:24 UTC
[Nouveau] [PATCH envytools] nva: Clean up nva tools doc
- Sort commands by name for easier update - Make more readable - Remove no more existing commands --- nva/README | 81 +++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 43 insertions(+), 38 deletions(-) diff --git a/nva/README b/nva/README index 625ea7c..cbe6ae3 100644 --- a/nva/README +++ b/nva/README @@ -13,43 +13,48 @@ by the nvalist program. The programs are: -nvalist: prints a list of cards - -nvapeek <address> [<byte count>]: reads 32-bit MMIO register at <address>. -If byte count is also given, reads all registers in range [address, address -+ byte count). - -nvapeek8 <address> [<byte count>]: like nvapeek, but does 8-bit MMIO accesses - -nvapoke <address> <value>: writes a 32-bit <value> to the MMIO register at -<address>. - -nvapoke8 <address> <value>: like nvapoke, but does 8-bit MMIO access - -nvawatch [-t] <address>: reads MMIO register at <address> in a loop, prints -the value every time it changes. If -t is specified, prints a timestamp -and diff from the previous timestamp before the value. Never quits, needs -to be manually aborted. - -nvahammer <address> <value>: like nvapoke, but repeats the write in -an infinite loop. Needs to be manually aborted. - -nvagetbios [-s <extraction method>]: extracts the card's VBIOS using the -method given as parameter and writes it to stdout. Method can be PROM or -PRAMIN. If method is not given, defaults to something sensible. - -nvafuzz <address> [<byte count>]: writes random values to a register or -a register range in an infinite loop. Needs to be manually aborted. - -nvascan [-as] <address> [<byte count>]: for each register in a range: -read it, write 0xffffffff, read it, write 0, read it, write back the -original value. Helpful to see the valid values for registers. If -s option -is passed, does a slow scan - waits and reads PMC.ID register between scans -to recover from errors caused by invalid register accesses. If -a option -is passed, does a cross-test on all registers in the range to detect aliased -addresses [not particularly reliable]. - -nvatiming: attempts to measure what frequency various units of the card are -running at by using misc tricks. +nvafuzz <address> [<byte count>] + Writes random values to a register or + a register range in an infinite loop. Needs to be manually aborted. + +nvagetbios [-s <extraction method>] + Extracts the card's VBIOS using the + method given as parameter and writes it to stdout. Method can be PROM or + PRAMIN. If method is not given, defaults to something sensible. + +nvahammer <address> <value> + Like nvapoke, but repeats the write in + an infinite loop. Needs to be manually aborted. + +nvalist + Prints a list of cards + +nvapeek <address> [<byte count>] + Reads 32-bit MMIO register at <address>. + If byte count is also given, reads all registers in range [address, address + + byte count). + +nvapoke <address> <value> + Writes a 32-bit <value> to the MMIO register at + <address>. + +nvascan [-as] <address> [<byte count>] + For each register in a range: + read it, write 0xffffffff, read it, write 0, read it, write back the + original value. Helpful to see the valid values for registers. If -s option + is passed, does a slow scan - waits and reads PMC.ID register between scans + to recover from errors caused by invalid register accesses. If -a option + is passed, does a cross-test on all registers in the range to detect aliased + addresses [not particularly reliable]. + +nvatiming + Attempts to measure what frequency various units of the card are + running at by using misc tricks. + +nvawatch [-t] <address> + Reads MMIO register at <address> in a loop, prints + the value every time it changes. If -t is specified, prints a timestamp + and diff from the previous timestamp before the value. Never quits, needs + to be manually aborted. [XXX: document the remaining tools] -- 1.9.1
Christian Costa
2014-Aug-27 06:24 UTC
[Nouveau] [PATCH envytools] Don't try to use bios->parts if NULL (parse_pcir function has probably failed).
--- nvbios/info.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nvbios/info.c b/nvbios/info.c index 87a33d8..acc40d8 100644 --- a/nvbios/info.c +++ b/nvbios/info.c @@ -119,6 +119,10 @@ int envy_bios_parse_bit_i (struct envy_bios *bios, struct envy_bios_bit_entry *b bios->chipset_name = "G72"; break; case 0x0573: + if (!bios->parts) { + ENVY_BIOS_ERR("Failed to detect board (bios->parts is NULL, parse_pcir function has probably failed)\n"); + break; + } /* yeah, ain't this one hilarious... */ if ((bios->parts[0].pcir_device & 0xfff0) == 0x7e0) { bios->chipset = 0x63; -- 1.9.1
Martin Peres
2014-Aug-27 22:48 UTC
[Nouveau] [PATCH envytools] nva: Clean up nva tools doc
Whole serie applied (all 7 patches). Thank you again :) Looking at the patches, it would seem like you were fixing potential bugs. Remember that envytools is meant for developers and we like stuff to break in catastrophic ways when the vbios (for instance) does not follow our expectations. Of course, crashing or corruption is not acceptable, but I'm all for a good-old assert or at least big fat warnings. Just don't waste too much time sanitizing nvbios since it clearly isn't meant for production. Thanks again and congrats for actually reading the code and documentation before contributing! I wish you good luck in generating the nvc0 memory timings :) Martin PS: Sorry it took me so long...
Seemingly Similar Threads
- [PATCH envytools] nva: Clean up nva tools doc
- [PATCH envytools] nva: Clean up nva tools doc
- [PATCH envytools] nva: Clean up nva tools doc
- [PATCH envytools] nva: Add nvaforcetemp to git ignore and sort it for better update
- [PATCH envytools] demmio: Add decoding of some MEM_TIMINGS registers for NVC0.