| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
Blackfin has a non-empty __USER_LABEL_PREFIX__, which means that a
symbol called "foo" in C must be named "_foo" in assembler.
We now use the preprocessor to set the variables in template.S instead
of using sed.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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 .dtb.o files are currently generated by compiling the .dts into
.dtb, and then making a pass of objcopy to turn them into an ELF file
that can be linked with the rest of pdbg.
Unfortunately, this objcopy logic doesn't work on all platforms,
because it doesn't generate an object file with the correct ABI
flags. For example, on mips32r6, it fails to build with:
mipsel-buildroot-linux-gnu/bin/ld: fake.dtb.o: warning: linking abicalls files with non-abicalls files
mipsel-buildroot-linux-gnu/bin/ld: fake.dtb.o: linking -mnan=legacy module with previous -mnan=2008 modules
mipsel-buildroot-linux-gnu/bin/ld: failed to merge target specific data of file fake.dtb.o
mipsel-buildroot-linux-gnu/bin/ld: p8-fsi.dtb.o: warning: linking abicalls files with non-abicalls files
In order to fix this, we want to generate a proper object file with
gcc instead of playing tricks with objcopy, and this is what this
commit implement.
We have a template.S file, which gets sed'ed on the fly to point to
the right file / use the right symbol name, and then is fed to gcc.
This allows to remove all the objdump/objcopy logic from the
configure.ac script as well.
This fixes build issues of pdbg seems inside the Buildroot project:
http://autobuild.buildroot.net/?reason=pdbg-77158819158d1d7053a737ac090d04fdfbfe9265
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Cyril Bur <cyrilbur@gmail.com>
[joel:
- integrate Cyril/Stephen's tr change
- fix out of tree builds]
Signed-off-by: Joel Stanley <joel@jms.id.au>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|\
| |
| | |
docs: Add HTM to README.md
|
| |
| |
| |
| | |
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
|
|/
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
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: Cyril Bur <cyrilbur@gmail.com>
|
|
|
|
| |
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
|
|
|
|
|
|
|
| |
This allows tools that do tarball builds from git (eg. buildroot) to
manually set the GIT SHA1.
Signed-off-by: Joel Stanley <joel@jms.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>
|
|
|
|
|
|
|
|
|
| |
The description of the PIB is the same regardless of access mechanism
(OpenFSI, direct, etc.) so to ease updates move the common definitions into
a seperate file which can be easily shared between backends similar to how
P8 works.
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>
|
|
|
|
|
|
|
|
|
|
| |
The OpenBMC Yocto build process uses an out of tree build model. Now
that pdbg supports that, add it to the Travis build so it does not
regress.
This also updates to an Ubuntu 17.04 container.
Signed-off-by: Joel Stanley <joel@jms.id.au>
|
|
|
|
|
|
| |
ssssshhh.
Signed-off-by: Joel Stanley <joel@jms.id.au>
|
|
|
|
|
|
| |
This avoids warnings about GNU make extensions.
Signed-off-by: Joel Stanley <joel@jms.id.au>
|
|
|
|
| |
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
| |
Out of tree builds would occasionally fail due to not finding a generated
include file for the device-tree.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
| |
We were using the system objcopy which doesn't always recognise the host file
formats. Instead use the target objcopy.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
| |
The m4 targets had include directories based on relative paths. This broke
out-of-tree builds so turn them into absolute paths.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
| |
Fixes a compilation error due to an unused result on some systems.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
|
|
|
|
| |
Changes:
- Move to a generic description of the hw topography using device-tree
- General build bugfixes
- Build libpdbg as a shared library
- Complete support for POWER9 including get/putmem and register operations
- Minor code clean-ups
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
| |
Update documentation to match latest usage patterns.
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
The objcopy parameters required to turn device-tree blobs into elf objects for
linking are architecture specific but were hard-coded. This required manual
updates to Makefile.am when compiling for other architectures. Instead detect
the parameters using an autoconf test.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
|
|
|
| |
Libraries were incorrectly added in pdbg_LDFLAGS. This means the pdbg build
target was not dependent on libpdbg and libfdt so make would occasionally try to
link to them before building them resulting in a build failure (especially
during parallel building). Instead the libraries should have been added to
pdbg_LDADD.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
| |
It should be set when configuring the program rather than hardcoded in the
Makefile.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
|
|
| |
Previously static linking did not work as the linker was not able to work out
that the HW units were referenced so it would throw that code away resulting in
the probing code finding no valid targets. This is fixed by adding some linker
flags to ensure the relevant code is always added to the binary.
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>
|
|
|
|
|
|
| |
Fixes a compiler warning due to passing the wrong pointer type.
Signed-off-by: Alistair Popple <alistair@popple.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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|