| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
A lot of the device-tree parsing code was borrowed from Skiboot. This
includes dt_for_each_node() which iterates over all the child device-tree
nodes. It was incorrectly assumed this only iterated over direct children,
rather than every child in the tree. This lead to each target being probed
multiple times when the children were explicitly (and incorrectly) iterated
over.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
| |
This was not implemented, so the user always got the default /dev/i2c4
no matter what the device tree specified.
Signed-off-by: Joel Stanley <joel@jms.id.au>
|
|
|
|
| |
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The compiler.h header contains a macro that defines __unused. When
building against uClibc this collides with uClibc_stdio.h:
In file included from /usr/include/stdio.h:71:0,
from libpdbg/fake.c:17:
/usr/include/bits/uClibc_stdio.h:149:16: error: expected identifier or ‘(’ before ‘;’ token
void *__unused; /* Placeholder for codeset binding. */
^
As it is unused in pdbg, remove it.
Signed-off-by: Joel Stanley <joel@jms.id.au>
|
|
|
|
|
|
|
|
|
|
| |
The code in device.c was largely based on code from Skiboot which included calls
to _fdt_check_node_offset and _fdt_offset_ptr which are internal libfdt
functions. This makes packaging difficult so remove the usage of these functions
and call the correct public library API equivalents.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Suggested-by: Frédéric Bonnard <frederic@fr.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When cross compiling with uclibc under buildroot, we get the following
clash:
./ccan/endian/endian.h:84:24: error: redefinition of ‘__bswap_32’
static inline uint32_t bswap_32(uint32_t val)
^
In file included from usr/include/bits/byteswap.h:1:0,
from usr/include/byteswap.h:22,
from usr/include/endian.h:59,
from usr/include/bits/pthreadtypes.h:21,
from usr/include/bits/uClibc_stdio.h:92,
from usr/include/stdio.h:71,
from libpdbg/device.c:18:
usr/include/bits/byteswap-common.h:44:1: note: previous definition of ‘__bswap_32’ was here
__bswap_32 (unsigned int __bsx)
^~~~~~~~~~
Work around it by not using ccan's endian. There's only one call site, and we
can use a libc function instead.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
| |
This fixes a compile failure when cross compiling with musl libc under
buildroot.
Signed-off-by: Joel Stanley <joel@jms.id.au>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
The device trees inside pdbg use 'chip-id'. This function can tell the
consumer of any target what chip it is on, if it searches for the correct
attribute.
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
| |
Signed-off-by: Joel Stanley <joel@jms.id.au>
|
|
|
|
|
|
|
| |
Allows access to scom addresses with IBM bit 0 set (ie. indirect scom
addresses).
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
When multiple device tree nodes exist at the top level subsequent nodes were not
getting probed. Fix this.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
| |
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
While this may break users of the old kernel driver ABI, in reality they
are already broken since d4f73e9be635 ("Reads and writes to the FSI bus
are in bus-endian format, so we need to convert.") which hardcodes the
modern ABI's endian requirements.
Signed-off-by: Joel Stanley <joel@jms.id.au>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
convert.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|\
| |
| | |
bmcfsi: Fix Romulus pin mapping comment
|
| |
| |
| |
| | |
Signed-off-by: Joel Stanley <joel@jms.id.au>
|
|/
|
|
|
|
|
| |
Modified the computing of OpenFSI CFAM address masking
for putcfam and getcfam.
Signed-off-by: Dinesh Chinari <chinari@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
The FSI byte address conversion code was copied directly from
bmcfsi.c. However the bmcfsi backend needs to set the slave-id
directly where as the OpenFSI kernel driver takes it from the given
address. So instead of masking off the upper two bits we need to pass
them directly through to the kernel driver.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
|
|
| |
The hmfsi attempts to read 0xc09 from every link to check if something
is present on the link. This means we expect reads of 0x????c09 to
occasionally fail. Future improvments to the probing code should
eliminate these reads, but in the meantime silence the warnings.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 4ecabf7 (libpdbg/bmcfsi.c: Add Zaius gpio pinout) introduced
support for the Zaius platform. Unfortunately a break statement was
missed which resulted in the Zaius pin mappings also being used for
the Romulus target.
Add the break statement so that the Romulus platform can be selected.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
|
|
|
| |
Update pin assignments for the board revision that replaces all current
Zaius boards.
The schematic indicates pins G0 and G1 for clock and data but contains
an error that forced rework for all EVT2 and EVT3 boards to use C3 and
C2 for FSI.
Signed-off-by: Xo Wang <xow@google.com>
|
|
|
|
| |
Signed-off-by: Xo Wang <xow@google.com>
|
|
|
|
| |
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
| |
The processor chip type was not being detected correctly resulting in
attempts to probe unsupported system components.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
| |
Putting CRC error messages into stderr helps with scripting that parses
the output of pdbg.
Signed-off-by: Xo Wang <xow@google.com>
|
|
|
|
|
|
|
| |
Support detecting different chip types so we enable chip type
dependent behaviour.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
The ADU always seems to return data in 8-byte chunks so rework the
code to only read 8-byte data chunks and reformat into correct size in
the output array.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
|
|
| |
It is also possible to access the host processor via an I2C bus. This
proves to be both more reliable and quicker than bit-banging the FSI
bus so add this as a new backend and make it the default access
method.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
| |
Rename bmcfsi.h to backend.h in preparation for adding new backends.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The self boot engine (SBE) requires clocking when first powering on
the system. The tool attempted to do this but it failed to correctly
boot a system. This seemed to be due to sending the FSI break sequence
afterwards.
Instead move the FSI break sequence to the initialisation so that this
tool can be used to boot the system.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
| |
We can't build against ulibc with this. Luckily we don't use it, so
remove the include.
Signed-off-by: Joel Stanley <joel@jms.id.au>
|
|
|
|
|
|
|
| |
Adds the -p option to select secondary processors and the 'probe'
command to detect which processors and threads are present.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
pdbg is a tool to access P8 host registers and memory from the BMC for
kernel and firmware debugging purposes.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|