summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* main: Use new command handling for HTMCyril Bur2018-02-163-60/+21
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Use new command handling for threadsCyril Bur2018-02-163-44/+56
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Use new command handling for registersCyril Bur2018-02-163-68/+165
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Use new command handling for memory commandsCyril Bur2018-02-163-33/+73
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Use new command handling for scomsCyril Bur2018-02-163-22/+52
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Use new command handling for cfamsCyril Bur2018-02-164-24/+52
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Prepare to change command handlingCyril Bur2018-02-161-4/+44
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Pull HTM functions out of main.cCyril Bur2018-02-163-206/+259
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Pull thread control accessors out of main.cCyril Bur2018-02-164-80/+135
| | | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com> Signed-off-by: Alistair Popple <alistair@popple.id.au>
* main: Pull memory accessors out of main.cCyril Bur2018-02-123-26/+67
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Pull register accessors out of main.cCyril Bur2018-02-124-67/+133
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Pull out scom functions from main.cCyril Bur2018-02-123-21/+63
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Pull cfam functions out of main.cCyril Bur2018-02-123-19/+63
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Pull out command parsing from option parsingCyril Bur2018-02-121-16/+33
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Use endptr to better check the result of strtoull()Cyril Bur2018-02-121-22/+29
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Handle unknown getopt argumentCyril Bur2018-02-121-0/+1
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Alphabetise getopt()Cyril Bur2018-02-121-5/+6
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* main: Remove unused variable oidxCyril Bur2018-02-121-2/+2
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* Rename chiplet to coreAlistair Popple2017-12-111-8/+8
| | | | | | | | A core is a specific subset of chiplets so rename the existing usage of chiplet to core so that we may add other types of chiplets to the system. No functional change. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* Refactor for an exportable APIAlistair Popple2017-12-081-175/+134
| | | | | | | | | | The existing API between libpdbg and pdbg was poorly defined. Other programs are beginning to utilise libpdbg so a more strictly defined API would be beneficial. This patch introduces a new header (libpdbg.h) which includes the definition of a public API for libpdbg and updates pdbg to only depend on this. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* Rename struct target to struct pdbg_targetAlistair Popple2017-12-061-28/+28
| | | | | | | In preparation for a better defined libpdbg API rename "struct target" to something less generic so that we can export the name. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* i2c: Update i2c device node in dt when specifiedJoel Stanley2017-11-241-1/+11
| | | | | | | | When the user specifies a device node on the command line, use that value to update the entry in the pib node. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Alistair Popple <alistair@popple.id.au>
* Error out when no device type is specifiedJoel Stanley2017-11-221-0/+8
| | | | | | | The host and FSI backend require the device type to be specified. When a user forgets, we pass a null pointer to strcmp and segfault. Signed-off-by: Joel Stanley <joel@jms.id.au>
* Hardware Trace Macro (HTM)Cyril Bur2017-09-221-1/+248
| | | | | | | | | | | | This is not Hardware Transactional Memory, rather it is the Hardware Trace Macro (HTM) which can be used to gather data about hardware activity. Currently only Nest HTM is implemented. Only runs on a PPC host on a kernel built with CONFIG_PPC_MEMTRACE and CONFIG_PPC_SCOM. Signed-off-by: Cyril Bur <cyrilbur@gmail.com> Signed-off-by: Alistair Popple <alistair@popple.id.au>
* Add backend for host based debugfsAlistair Popple2017-08-141-1/+19
| | | | | | | | Linux kernels configured with CONFIG_SCOM_DEBUGFS can be used to access SCOM registers on the PowerPC machine running pdbg. Add a backend which can be use to access SCOM registers via debugfs. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg: Add sreset commandAlistair Popple2017-07-311-1/+12
| | | | Signed-off-by: Alistair Popple <alistair@popple.id.au>
* src/main.c: Check result of writing to stdoutAlistair Popple2017-07-141-2/+4
| | | | | | Fixes a compilation error due to an unused result on some systems. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* src/main.c: Add error message when no command could be runAlistair Popple2017-07-141-15/+23
| | | | | | | | All commands need a target to operate on. Running a command with no target would produce no output which can be confusing. Instead return an error message and a hint. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg: Add a more complete fake backendAlistair Popple2017-07-131-0/+2
| | | | | | | The fake backend we had couldn't be used as src/main.c was missing the option to enable it. It was also missing an implementation of a fake pib so add that too. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* src/main.c: Fixup thread step callAlistair Popple2017-06-281-5/+1
| | | | | | Fixes a compiler warning due to passing the wrong pointer type. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* pdbg: Re-add probe commandAlistair Popple2017-06-281-0/+46
| | | | | | | The update to targeting with device-tree broke probe function which shows detected/available targets. This was a useful function so add it back in. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg: Add support for P9 thread operationsAlistair Popple2017-06-281-8/+6
| | | | | | | This patch adds support for starting and stopping threads on POWER9 as well as instruction ramming which is required to read/write GPRs, etc. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg: Add target index cacheAlistair Popple2017-06-281-8/+8
| | | | | | | | The target index is needed multiple times by code using the library. Rather than requiring parsing the device-tree each time it makes sense to cache the parsed value in the struct target. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* Clean-up target configuration in preparation for adding P9 supportAlistair Popple2017-03-301-549/+357
| | | | | | | | | | The previous implementation of targeting was hardcoded, cumbersome and difficult to reconfigure for different chip types. This moves to a method of configuring targets using device-tree which is much easier to maintain and allows methods to be added to support operations like getmem on POWER9. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* src/main.c: Fix kernel cfam processor selectionAlistair Popple2017-02-221-2/+4
| | | | | | | | The openfsi backend was adding cfams regardless of the selected processor (-p0, -p1, etc.). This resulted in reading/writing all the cfam registers when doing a get/putcfam. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libdbg: Introduce kernel FSI driver backendJoel Stanley2017-02-181-3/+47
| | | | | | | | | | | | Creatively named 'kernel', this uses the SoftFSI aka OpenFSI aka fsi kernel driver. This backend triggers a probe of all attached FSI devices by the kernel. This assumes a single slave appears in sysfs, and uses the 'raw' device to perform reads and writes directly to the CFAM address space and SCOM space. Signed-off-by: Joel Stanley <joel@jms.id.au>
* pdbg: Fix bug selecting processor CFAMs when using the FSI backendAlistair Popple2017-01-091-4/+6
| | | | | | | | | | | | | When using the FSI GPIO backend and selecting processor 0 as a target for a cfam operation all detected processors are targeted: p0:0x900: 0x0000000000000001 p1:0x900: 0x0000000000000000 This patch fixes the above to ensure only specifically selected processors are targeted. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg/bmcfsi.c: Add Zaius gpio pinoutXo Wang2016-12-131-0/+2
| | | | Signed-off-by: Xo Wang <xow@google.com>
* libpdbg/bmcfsi.c: Add Romulus gpio pinoutAlistair Popple2016-12-131-0/+2
| | | | Signed-off-by: Alistair Popple <alistair@popple.id.au>
* src/main.c: Add long FSI device namesAlistair Popple2016-12-081-1/+1
| | | | | | | | OpenBMC uses the system name (eg. Witherspoon) as configuration identifiers. To ease integration with OpenBMC also allow long machine names as options to select the FSI GPIO pinout. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* src/main.c: Make p9w (Witherspoon) the default FSI backendAlistair Popple2016-12-081-1/+1
| | | | | | | To avoid breaking scripts make p9w the default GPIO layout for the FSI backend. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg/bmcfsi.c: Support multiple GPIO backend mappingsAlistair Popple2016-12-021-9/+21
| | | | | | | Different boards have different FSI GPIO mappings. This adds support for selecting a board variant by passing -d to the bmcfsi backend. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* src/main.c: Add an optional mask to putscom/putcfamAlistair Popple2016-12-021-28/+57
| | | | | | | Implement read-modify-write functionality for putscom/putcfam in the form of a mask. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* src/main.c: Make return codes consistentAlistair Popple2016-12-021-2/+4
| | | | | | Always return -1 when encountering an error and 0 for success. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* src/main.c: Don't abort execution when encountering an inactive threadAlistair Popple2016-12-021-19/+31
| | | | Signed-off-by: Alistair Popple <alistair@popple.id.au>
* Fix thread status checks during instruction rammingAlistair Popple2016-11-301-18/+61
| | | | | | | | | | | | Instructions can only be rammed into a thread is all threads on a chiplet are quiesced or sleeping. This was not properly enforced which leads to system checkstops when ramming threads if the chip isn't fully quiesced. This adds a check to ensure all threads are quiesced. It also changes the startchip/stopchip behaviour to stop all threads on the given chiplet regards of which threads are selected. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg/adu.c: Implement a basic putmemAlistair Popple2016-11-281-0/+39
| | | | Signed-off-by: Alistair Popple <alistair@popple.id.au>
* src/main.c: Fix segfault when reading memory without specifying a processorAlistair Popple2016-11-281-3/+8
| | | | | | | Reading memory without specifying a processor would result in a segfault. Instead display an error message and exit gracefully. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* src/main.c: Fix SPR encodingAlistair Popple2016-11-281-5/+9
| | | | | | | | | | | | The internal getreg/putreg functions encode the register to read by assuming registers > R31 are special purpose registers (SPR). However when reading/writing the SPR this offset was not removed and so the incorrect SPR was read (or written). This is fixed by subtracting the correct offset. Also fixes a minor whitespace issue. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg/chip.c: Add command to read virtual addressesAlistair Popple2016-11-221-8/+22
| | | | | | | | | Adds a command to read a 64-bit word from a given virtual address. The address is read in the current thread context and may cause an exception. In the case of exception it will be raised on the host when thread execution is resumed. Signed-off-by: Alistair Popple <alistair@popple.id.au>
OpenPOWER on IntegriCloud