summaryrefslogtreecommitdiffstats
path: root/libpdbg
Commit message (Collapse)AuthorAgeFilesLines
* Revert incorrect version of "libpdbg/p8chip.c: ram state setup sequence ..."Alistair Popple2019-03-271-13/+28
| | | | | | This reverts commit eb1d866e30a1f8488fb794776bb5a1e0bc42d2e5. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* Revert incorrect version of "libpdbg: use MTMSRD opcode rather than MTMSR"Alistair Popple2019-03-271-1/+1
| | | | | | This reverts commit f795d2904010c0b2e2ad8d8163dffc906ce8cef7. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* Revert incorrect version of "libpdbg/p8chip.c: release special wakeups for P8"Alistair Popple2019-03-271-53/+8
| | | | | | | | This reverts commit 7de0ee34699e297f1f224fce1790c3cd03bc2f32. The incorrect version of "libpdbg/p8chip.c: release special wakeups for P8" was applied, the next patch will commit the correct version. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* api: Fix API interface for external usageArtem Senichev2019-03-262-1/+8
| | | | | | | | | | | 1. File 'ccan/short_types/short_types.h' is not used by external interface and should be used as internal dependency only (ccan directory is not installed by make script). 2. Extern "C" declaration of API allows us to call libpdbg functions from C++ modules. Signed-off-by: Artem Senichev <artemsen@gmail.com> Signed-off-by: Alistair Popple <alistair@popple.id.au>
* adu: Add new api for memory read/writeAmitay Isaacs2019-03-262-0/+23
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* adu: Set default blocksize for aduAmitay Isaacs2019-03-261-0/+6
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* adu: Add read/write methods for adu targetAmitay Isaacs2019-03-262-0/+6
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* adu: Convert __adu_{get, put}mem_blocksize to adu functionsAmitay Isaacs2019-03-261-23/+53
| | | | | | This will help add a generic read/write methods for adu class. Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg/p8chip.c: Emulate sreset using ramming for active threadsNicholas Piggin2019-03-081-6/+76
| | | | | | | | | | | Based on patch from Alistair, some fixes and changes: - account HILE bit, set/clear MSR_LE - clear MSR_PR - don't use raw ramming (clearer this way, not perf critical) At the moment, must manually stop all threads in the core, and manually restart them. Can change behaviour depending on what exactly we want (e.g., sreset all threads may be good for debugging).
* libpdbg/p8chip.c: ram state setup sequence match workbookNicholas Piggin2019-03-081-28/+13
| | | | | | | | | | | | | | | | | | This makes a few changes to stop and ram procedure. First of all, the existing thread_stop procedure is also setting up some of the ram state. Change that to just do the stop sequence from the workbook, and move the ram stuff into ram setup and destroy. The workbook calls for inactive threads being rammed to set a thread active state before ram mode is exited, in order for GPRs modified by ramming to avoid getting lost. Currently the code does that in the stop sequence before ram mode is activated. The code also currently deasserts the thread active bit after exiting ram mode, which is not part of the workbook, so this is no longer done. Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
* libpdbg: use MTMSRD opcode rather than MTMSRNicholas Piggin2019-03-081-1/+1
| | | | XXX: have to ensure this still does the right thing on P9
* libpdbg/p8chip.c: release special wakeups for P8Nicholas Piggin2019-03-081-8/+53
| | | | | | This copies the special wakeup release logic from p9chip.c Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
* libpdbg/p8chip.c: Only write the SP_STOP bit onceNicholas Piggin2019-03-081-2/+4
| | | | | | | | | The workbook recipe is to write SP_STOP once, then poll for status. Also add a small delay between polling to give a reasonable timeout and avoid hitting the scom bus hard for no good reason. Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
* libpdbg/p8chip.c: read status from correct targetNicholas Piggin2019-03-081-1/+1
|
* libpdbg: Fix CHECK_ERR macro to evaluate once in error caseNicholas Piggin2019-03-081-2/+3
| | | | Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
* adu: Add arugments for block sizeAlistair Popple2018-12-183-59/+148
| | | | | | | | | | | | | | Not all memory can be read with the default ADU block size of 8 bytes. Specifically cache-inhibited access to some MMIO regions such as PCIe BAR spaces requires 4 byte accesses to avoid check stopping the machine. This patch adds library functions to read/write IO memory which takes a block size argument and two new put/getmemio commands to allow a specific block size to be specified from the command line. Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Drop pdbg_target_chip_id()Amitay Isaacs2018-12-072-19/+0
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Use index instead of chip-id for idAmitay Isaacs2018-12-072-7/+10
| | | | | | | Instead of using two different ways to id various chiplets, consistently use "index" property. Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Fix probing of pibAmitay Isaacs2018-12-071-1/+1
| | | | | | The kernel uses "%08x" to create a directory in debugfs. Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Split nhtm hardware units for p8 and p9Amitay Isaacs2018-12-031-6/+21
| | | | | | | | | | Even though device tree compatible property can hold multiple strings, the struct pdbg_target definition can only take a single compatible string. Also, rename chtm hw unit to match nhtm. Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Remove zalloc macroAlistair Popple2018-12-031-2/+1
| | | | | Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Add an api for address translationAmitay Isaacs2018-11-162-0/+9
| | | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Alistair Popple <alistair@popple.id.au>
* libpdbg: Convert printf to DEBUG statementsAmitay Isaacs2018-11-161-5/+7
| | | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Alistair Popple <alistair@popple.id.au>
* device.c: Fix pdbg_target_addressAlistair Popple2018-11-091-5/+4
| | | | | | | | | | | | | | | | Commit 936dbdcedb27 ("libpdbg: Rework target addressing") introduced a bug leading to the following assertion failing: pdbg: libpdbg/device.c:634: pdbg_target_address: Assertion `(pos + n) <= p->len' failed. When this function was reworked the index parameter was dropped as every caller set index == 0. Removal should have also resulted in the local pos variable being removed. Instead it was set as if index == 1 resulting in the above violation. Fix the bug and add a test to check pdbg_target_address(). Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg: Remove device.hAlistair Popple2018-11-097-32/+6
| | | | | Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Make dt_root privateAlistair Popple2018-11-093-13/+11
| | | | | Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Rework target compatibleAlistair Popple2018-11-095-43/+35
| | | | | | | | | Rework the target compatible code to reuse existing libpdbg code where possible. Renames and exports these functions for use by external libraries. Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Remove old dt_prop functionsAlistair Popple2018-11-098-60/+54
| | | | | | | | | | 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-098-21/+15
| | | | | | | | 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: Rework chip-id functionsAlistair Popple2018-11-096-37/+21
| | | | | | | | | Rename the chip-id functions to be consistent with other libpdbg function names and move them in with the rest of the general libpdbg code. Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Rename property functionsAlistair Popple2018-11-094-8/+15
| | | | | | | | | | Some of the functions dealing with target properties have somewhat inconsistent naming. This patch renames them and adds #defines for backwards compatibility for external projects. These will be removed once older projects have moved over to the new names. Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Move property code into libpdbg/device.cAlistair Popple2018-11-093-82/+65
| | | | | Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Make more declarations staticAlistair Popple2018-11-094-87/+39
| | | | | | | | Many of the functions in device.c are only used within that file and should be made static. Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Remove unused codeAlistair Popple2018-11-094-379/+4
| | | | | | | | Much of the code in device.c was originally copied over from Skiboot and is not applicable or used by pdbg. Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Add xbus hardware unitAlistair Popple2018-11-092-0/+67
| | | | Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg: Add indirect address translation via callbackAlistair Popple2018-11-092-1/+13
| | | | | | | | | | Some hardware targets have more complicated addressing schemes than a simple base address + offset. It may be possible to determine a device-tree representation for these schemes but for the moment it is more straight forward to define a callback to do the translation. Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Add API to get device tree path and find target via pathAlistair Popple2018-11-092-0/+15
| | | | | Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: fix a bug in get_class_target_addrAlistair Popple2018-11-091-4/+3
| | | | | | | | | The root device tree node does not have a class. Therefore this assert was not useful as the strcmp() may cause a segfault comparing the root node class. Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg: Add api to get 32-bit device tree propertyAlistair Popple2018-11-092-0/+13
| | | | | Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Amitay Isaacs <amitay@ozlabs.org>
* pdbg/gdbserver: Add in basic skeleton for a gdbserver on p8Rashmica Gupta2018-11-023-3/+2
| | | | | | | | I have changed a few bits here and there but this patch is largely authored by Alistair Popple. Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com> Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg/chip: add HEIR and HID register to ram_state_threadRashmica Gupta2018-10-152-0/+9
| | | | | Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com> Reviewed-by: Alistair Popple <alistair@popple.id.au>
* libpdbg/adu: always release the adu lock before returning from an errorRashmica Gupta2018-10-152-14/+17
| | | | | Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com> Reviewed-by: Alistair Popple <alistair@popple.id.au>
* libpdbg/p8chip: Add in debug messagesRashmica Gupta2018-10-151-0/+3
| | | | | Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com> Reviewed-by: Alistair Popple <alistair@popple.id.au>
* adu: Avoid address truncation from 64-bit to 32-bitAmitay Isaacs2018-10-151-2/+2
| | | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Alistair Popple <alistair@popple.id.au>
* libpdbg/p9chip: MTNIA and MTMSR fixesNicholas Piggin2018-09-201-2/+3
| | | | | | | | This adjusts P9 MTNIA and MTMSR opcodes to match the workbook. Also allows MTNIA now that the driver uses a P9 compatible sequence. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Tested-by: Rashmica Gupta <rashmica.g@gmail.com>
* libpdbg/chip: implement putnia with a sequence compatible with P9Nicholas Piggin2018-09-201-4/+15
| | | | | | | | | P9 MTNIA uses LR as the source register, so set LR as well as GPR0. This will work on P8 and P9. This is a bit ugly, but it will work until we have general getspr/putspr calls for target backends. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Tested-by: Rashmica Gupta <rashmica.g@gmail.com>
* libpdbg: Add in enable_attn function for p8Rashmica Gupta2018-09-122-0/+42
| | | | Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com>
* libpdbg: Add in mtocrf and putcr functionRashmica Gupta2018-09-123-0/+28
| | | | | Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
* libpdbg: Make getcr actually get all of the Condition RegisterRashmica Gupta2018-09-122-10/+18
| | | | | Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
* libpdbg: Add in getxer and putxer functionsRashmica Gupta2018-09-127-13/+177
| | | | | Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
OpenPOWER on IntegriCloud