summaryrefslogtreecommitdiffstats
path: root/libpdbg/cfam.c
Commit message (Collapse)AuthorAgeFilesLines
* libpdbg: Remove old dt_prop functionsAlistair Popple2018-11-091-1/+1
| | | | | | | | | | The dt_prop functions were copied over from Skiboot. Rework and rename these to make use of the existing libpdbg property functions. These should not have been used by external projects so maintaining backwards compatibility is not a concern. Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Rework target addressingAlistair Popple2018-11-091-2/+2
| | | | | | | | Clean up the target addressing functions and rename them to be consistent with other libpdbg function names. Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: When searching for a parent ensure the correct class is enforcedAlistair Popple2018-08-131-2/+2
| | | | | | | | Functions were added to allow a targets parents to be traversed until a parent of the correct class is found. Switch to using those instead of blindly assuming a particular node is always a child of the desired class. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg: Fix a typoAmitay Isaacs2018-08-021-1/+1
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* debug: Add printf attribute to logging functionJoel Stanley2018-06-011-3/+3
| | | | | | | | | | | This allows the compiler to warn about mismatched types in printf arguments. Without this we don't get warnings from the logging macros when format specifiers and arguments don't match up, and instead you get segfaults. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg: Start using pdbg logging apiAmitay Isaacs2018-05-181-3/+1
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: staticify unit structsNicholas Piggin2018-05-161-4/+4
| | | | Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
* libpdbg: Lazy probingCyril Bur2018-04-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When libpdbg runs though the device tree and calls probe() on all the targets it marks any node (and all its children) which fails to probe as "disabled". When pdbg recieves arguments to specifiy a pib, core or thread (-p -c -t) it runs though the device tree and marks nodes which do not match the specified -p -c or -t as "disabled". These two scenarios are related - that is we don't want to be operating on any disabled nodes. However, they are not the same. Consider HTM wanting to know if the machine has powersave disabled. A simple way would be to loop through all the threads and if any of them are not in "active" state then powersave must be enabled. In this scenario HTM want to be able to get the status of every thread on the machine regardless of -p -c -t flags but if the machine isn't fully speced out and has cores which didn't probe, HTM wants to know to ignore those threads. This patch introduces a "nonexistant" pdbg target status which is set during libpdbg probe() time. Later pdbg can mark nodes to targets that do 'exist' but it would like to avoid as "disabled". Attempting to solve the above problem with only a "nonexistant" flag would also require everything to be probed before selecting out chips and threads that the user is not interested in. This would be highly inefficient. This patch probes the system lazily. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* libpdbg: Move struct dt_node into struct pdbg_targetCyril Bur2018-04-241-6/+6
| | | | | | | | | | | Currently we have this terrible mess of dt_nodes pointing to targets and targets pointing to dt_nodes. This has been the cause of bugs due to folling NULL pointers from a target expecting a node and vice versa. Consolidating these structs means that there must be a node for a target. Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* libpdbg/cfam.c: Remove fsi2pib engine resetAlistair Popple2018-02-211-2/+11
| | | | | | | | | | | | | Prior to every pib read and write we would reset the fsi2pib engine. This was primarily added to improve reliability on P8 BMC's which do not allow exclusive access to the GPIO registers for bitbanging FSI. Newer BMC's have a built in kernel driver to allow FSI access and this reset causes the fsi2pib engine to loose existing settings such as the true mask register. To avoid this only reset the PIB master interface once at startup. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* Rename struct target to struct pdbg_targetAlistair Popple2017-12-061-5/+5
| | | | | | | 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>
* Makefile.am: Enable -Wall -Werror for libpdbgAlistair Popple2017-07-141-3/+4
| | | | | | | Several minor fixes were required to enable building on both x64 and ARM with -Wall -Werror, mostly related to unused variables and bad printf string formats. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg/cfam.c: Enable hmfsi portsAlistair Popple2017-06-281-1/+11
| | | | | | | | Errors on the hmfsi port can cause them to be disabled. So rather than relying on the host to enable the corresponding FSI ports enable them during probing of the downstream FSI link. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* Clean-up target configuration in preparation for adding P9 supportAlistair Popple2017-03-301-66/+125
| | | | | | | | | | 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>
* Add detection of chip typesAlistair Popple2016-12-021-4/+17
| | | | | | | Support detecting different chip types so we enable chip type dependent behaviour. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* Add support for i2c access to secondary processorsAlistair Popple2016-10-251-0/+261
This includes better support for selecting targets, probing thread status and a number of other minor bugfixes. Also adds an option to print version numbers. Signed-off-by: Alistair Popple <alistair@popple.id.au>
OpenPOWER on IntegriCloud